Received SMS with python

Aleksander Morgado aleksander at
Tue Sep 26 13:38:51 UTC 2017

On Tue, Sep 19, 2017 at 10:03 AM,  <colin.helliwell at> wrote:
> I came across an old example ( using dbus, but are there any
> examples via gi/Glib for reading and deleting received SMSs (and any events
> that can be hooked for catching the reception)?
> I'm guessing the ModemMessaging class is the starting point? Then, in the
> Sms class, when would be the times to use the 'dup_' functions instead of
> 'get_'?

On the get() method, the returned value isn't owned by the caller, and
will exist as long as the internal value owned by the object isn't
removed. You can only guarantee that on single-threaded programs.

On the dup() method, the returned value is owned by the caller (e.g.
the caller gets a whole copy of the value), so it's safe in a
multi-threaded application.

That said, it probably doesn't makes sense to have both introspected,
we can probably just (skip) the _get() one and leave only _dup().


More information about the ModemManager-devel mailing list