NAME
POCSAG::PISS - A perl module for accessing the PISS modem
ABSTRACT
PISS is a simple protocol to talk to a synchronous POCSAG bit-banger module. At concept level, much like KISS (Keep It Simple Stupid), but for POCSAG instead of AX.25.
DESCRIPTION
Unless a debugging mode is enabled, all errors and warnings are reported through the API (as opposed to printing on STDERR or STDOUT), so that they can be reported nicely on the user interface of an application.
OBJECT INTERFACE
- new(config)
-
Returns a new instance of the PISS modem driver. Usage:
my $modem = new POCSAG::PISS( 'serial' => '/dev/ttyUSB0', 'serial_speed' => 9600, 'max_tx_len' => 1000, );
- get_error($modem)
-
Returns the error code and error message string for the last error experienced.
my($code, $message) = $modem->get_error();
- error_msg($modem)
-
Gets just the error message string for the last error experienced. Good for
$modem->open() || die "Failed to open modem: " . $modem->error_msg();
- open()
-
Opens the serial device after locking it using a lock file in /var/lock, sets serial port parameters, and flushes the input buffer by reading whatever the modem has transmitted to us since we last read from the port.
The flushing part does take a couple of seconds, so be patient.