NAME
GSM::SMS::Transport - Act as a single point of access to the transports
DESCRIPTION
This class implements an object factory for the transports found in the GSM::SMS::Transport:: namespace. Given a transport config file, it will dynamically loads the transports and initialize them. It will keep a reference to all instantiated transports.
METHODS
- new - Constructor
-
Create a new transport layer with the settings as in the config file. Please look in the example config file for the transport specific configuration settings.
- send - Send a PDU message.
-
Send a PDU message to the the msisdn. The transport layer will choose a transport according to the regular expression defined in the config file. This regexp matches against the msisdn.
$transport->send( $msisdn, $pdu );
- receive - Receive a PDU message
-
Receive a pdu message from the transport layer. Undef when no new message available.
$pdu = $transport->receive();
- get_transports - Return an array containg the transports
-
@transports = $transport->get_transports(); foreach my $i (@transports) { print $i->ping(); }
- add_transport - Push a transport on the transport stack
- get_transport_by_name - Return a specific transport by name
-
my $serial_transport = $transport->get_transport_by_name('serial01'); $serial_transport->at("ATDT 555");
This method allows to get a reference to a specific transport object. It can be usefull if you want to do other things with the transport. It is especially intented for use with the serial transport, so you can do other things with your GSM modem without the need to close the transports.
- close
-
Shut down transport layer, calls the transport specific close method.
AUTHOR
Johan Van den Brande <johan@vandenbrande.com>