boskar has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I'm writing a small applet (Gtk/Glib) which used to bind via dbus to some dbus signals, etc.(ModemManager/NetworkManager).
As MM/NM dbus API became insufficient, I'd like to communicate directly to modem (using Device::Modem::Gsm).
Modem is responding to AT commands ( $modem->atsend() ), I get responses via $modem->answer().
The problem is - once upon a time modem sends some data (AT compilant data) to the port, without any AT command sent (like signal quality being changed, BTS change, etc). I'd like to parse them in some way, parsing would be easy using regexp, but how to get them and send as a parameter to function?
I haven't found any information in Device::Modem, nor Device::Modem::Gsm. Maybe this feature is inherited somehow from other libraries?
Comment on Device::Modem main loop, events for periodically reported data
This is just brainstorming, but have you looked at Device::Modem::Log::File ? You can at least see if your AT commands are being logged, and if so, the docs mention: implement your own new(), write() and close() methods. . So it seems possible to intercept the log file write() and parse it.