Device::Gsm - Perl extension to interface GSM cellular / modems
This is C<PRE-ALPHA> software, still needs extensive testing and support for custom GSM commands, so use it at your own risk, and without C<ANY> warranty! Have fun.
use Device::Gsm;
my $gsm = new Device::Gsm( port => '/dev/ttyS1', pin => 'xxxx' );
if( $gsm->connect() ) { print "connected!\n"; } else { print "sorry, no connection with gsm phone on serial port!\n'; }
# Register to GSM network (you must supply PIN number in above new() call) $gsm->register();
# Get the manufacturer and model code of device my $mnf = $gsm->manufacturer(); my $model = $gsm->model(); print 'soft version is ", $gsm->software_version(), "\n";
my $imei = $gsm->imei() or $imei = $gsm->serial_number();
# Test for command support if( $self->test_command('CGMI') ) { # `AT+CGMI' is supported! } else { # No luck, CGMI command not available }
print 'Service number is now: ', $gsm->service_number(), "\n"; $gsm->service_number( '+001505050' ); # Sets new number
# Send quickly a short text message $modem->send_sms( recipient => '+3934910203040', content => 'Hello world! from Device::Gsm' );
# The long way... $modem->send_sms(
recipient => '34910203040', content => 'Hello world again, with more args',
# SMS Class (can be `normal' or `flash') # `flash' mode delivers instantly! class => 'normal',
# SMS sending mode # try `text' or old phones or GSM modems # `pdu' is the default nowadays mode => 'pdu' );
Device::Gsm
class implements basic GSM functions, network registration and SMS sending.
This class supports also PDU
mode to send SMS
messages, and should be
fairly usable. I'm developing and testing it under Linux RedHat 7.1
with a 16550 serial port and Siemens C35i
/ C45
GSM phones attached with
a Siemens-compatible serial cable.
Please be kind to the universe and contact me if you have troubles or you are interested in this.
None
validity period
option on SMS sending. Tells how much time the SMS
Service Center must hold the SMS for delivery.
always
test each command to know whether it is supported or not, because this takes
too time to be done every time.
Cosimo Streppone, cosimo@cpan.org
the Device::Modem manpage, the Device::SerialPort manpage, the Win32::SerialPort manpage, perl(1)