Device::Modem - Perl extension to talk to modem devices connected via serial port
This is C<ALPHA> software, still needs extensive testing and support for generic AT commads, so use it at your own risk, and without C<ANY> warranty! Have fun.
use Device::Modem;
my $modem = new Device::Modem( port => '/dev/ttyS1' )
if( $modem->connect( baudrate => 9600 ) ) { print "connected!\n"; } else { print "sorry, no connection with serial port!\n'; }
$modem->attention(); # send `attention' sequence (+++)
$modem->dial('02270469012'); # dial phone number
$modem->echo(1); # enable local echo $modem->echo(0); # disable it
$modem->offhook(); # Take off hook (ready to dial) $modem->hangup(); # returns modem answer
$modem->is_active(); # Tests whether modem device is active or not # So far it works for modem OFF/ modem ON condition
$modem->reset(); # hangup + attention + restore setting 0 (Z0)
$modem->restore_factory_settings(); # Handle with care!
$modem->send_init_string(); # Send initialization string # Now this is fixed to `ATZ0H0V1Q0E0'
$modem->repeat(); # Repeat last command
$modem->verbose(0); # Modem responses are numerical $modem->verbose(1); # Normal text responses
# # Some raw AT commands # $modem->atsend( 'ATH0' ); print $modem->answer();
$modem->atsend( 'ATDT01234567' . Device::Modem::CR ); print $modem->answer();
Device::Modem class implements basic AT (Hayes) compliant device abstraction. It is meant to be inherited by sub classes (as Device::Gsm), which are based on serial connections.
None
Explain which type of logging hooks you can use with Device::Modem and its sub-classes (Device::Gsm). For now, they are only `file' and `syslog'
An AT command script with all interesting commands is run when `autoscan' is invoked, creating a `profile' of the current device, with list of supported commands, and database of brand/model-specific commands
Cosimo Streppone, cosimo@cpan.org
(C) 2002 Cosimo Streppone, cosimo@cpan.org
This library is free software; you can only redistribute it and/or modify it under the same terms as Perl itself.
Device::SerialPort, Win32::SerialPort, perl