cosimo / perl5-device-modem Goto Github PK
View Code? Open in Web Editor NEWDevice::Modem CPAN module, interface to any AT-command-set based device
Home Page: http://search.cpan.org/dist/Device-Modem
Device::Modem CPAN module, interface to any AT-command-set based device
Home Page: http://search.cpan.org/dist/Device-Modem
======================================================================= Device::Modem - a Perl class to interface generic modems (AT-compliant) Copyright (C) 2002-2020 Cosimo Streppone, [email protected] ======================================================================= This is a perl extension to talk to AT compliant devices via serial port. It should be enough platform independent as you need. For more details, look at the "docs/" folder where you will find a minimal FAQ ("docs/FAQ.pod"), and the full documentation for this extension ("docs/Modem.pod"). Please contact me for any problems you may encounter using this beast. Have fun! Prerequisites ------------- + working perl installation >= 5.006 + Device::SerialPort >= 0.19 (Win32::SerialPort in on Windows platform) + a modem or AT-compliant device if you want to use it for some real work Installation ------------ This module installs like all other good old perl modules: $ perl Makefile.PL $ make $ make test $ make install Licensing terms --------------- This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Use this software at your own risk without *ANY* warranty! Advertising :-) --------------- Check out also Device::Gsm module from the same author to work with GSM devices connected via serial port.
When using the syslog driver, all messages are sent to syslog, regardless of log level set at module init.
i'm using multiple Device::Modem instances and want to reuse the log object.
my $a = new Device::Modem( port => '/dev/USB0', log => 'file,/tmp/log1',
loglevel => 'debug' );
later i want to reuse that log object:
my $b = new Device::Modem( port => '/dev/USB2', log => $a->log );
only 'warning' messages or above are written to the logfile. i have to add loglevel => 'debug' for every instance. is this a feature?
i would expect the loglevel value is used from:
--- a/lib/Device/Modem.pm
+++ b/lib/Device/Modem.pm
@@ -94,6 +94,11 @@ sub new {
# Force logging to file if this is windoze and user requested syslog mechan
$aOpt{'log'} = 'file' if( $aOpt{'ostype'} eq 'windoze' && $aOpt{'log'} =~ /
+ if( ref $aOpt{'log'} ) {
+ # 1st from new() attribute, 2nd from the instanced log object
+ $aOpt{'loglevel'} ||= $aOpt{'log'}->loglevel();
+ }
+ # or 3rd - use the default
$aOpt{'loglevel'} ||= 'warning';
if( ! ref $aOpt{'log'} ) {
i'm using multiple instances of Device::Modem.
reproduce:
first create instance1 with logfile /tmp/logfile1
than create instance2 with logfile /tmp/logfile2
the file handle of instance1 is set to logfile2.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.