Code Monkey home page Code Monkey logo

perl5-device-modem's Introduction

=======================================================================
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.

perl5-device-modem's People

Contributors

cosimo avatar ewildgoose avatar genio avatar ghciv6 avatar gjtorikian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

perl5-device-modem's Issues

loglevel + instanced log object

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:

  1. attribute of new()
  2. the instanced log object
  3. default value
--- 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'} ) {

multi instance logfile handling

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.