On Sun, Jan 10, 2016 at 9:25 PM, Brendan Simon (eTRIX) <brendan.si...@etrix.com.au> wrote: > I'm looking for a Python example/sample/snippet to send an SMS message to a > mobile phone. > > All I can find is older code that uses EnumerateDevices() method. > > e.g. > https://github.com/miurahr/ModemManager/blob/master/test/mm-send-sms.py > > which appears to be old and obsolete, and not supported on my system (Debian > Jessie, modemmanager v 1.4). > > I've read some of the ModemManager and DBus docs (not that easy going). > All I can work out is that the API is now more generic but I can't find the > right set of methods to use. e.g. to get a list of modems. > > Is there an equivalent to the sample above?
The modem watcher example will give you an insight on how to get the list of modem objects (we use the standard DBus ObjectManager interface): http://cgit.freedesktop.org/ModemManager/ModemManager/tree/examples/modem-watcher-python Once you have the modem to use, you'll need to (at least): 1) Modem.Enable() http://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.html#gdbus-method-org-freedesktop-ModemManager1-Modem.Enable 2) Modem.Messaging.Create() // returns DBus path of newly created SMS http://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.Messaging.html#gdbus-method-org-freedesktop-ModemManager1-Modem-Messaging.Create 3) SMS.Send() http://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Sms.html#gdbus-method-org-freedesktop-ModemManager1-Sms.Send -- Aleksander https://aleksander.es _______________________________________________ ModemManager-devel mailing list ModemManager-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel