Questing about the use of libmm

Troels Olesen to at movis.dk
Mon Feb 8 08:59:08 UTC 2016


Hi ModemManager developers.

I have some questions about the how to use the "libmm" library, in an 
modem handler application.

I have read your API wiki, at 
"http://www.freedesktop.org/software/ModemManager/libmm-glib/latest/",
and i have managed to make an application that like mmcli can get 
information from the ModemManager daemon.

But i have some problems getting updated information from the MM objects 
i create.

The way i understand the MM object structure is that the MMManager* 
object gives a list of MMObject*, and from the MMObject* it is possible 
to get MMModem*, MMModemLocation* and MMModem3gpp* objects witch gives 
the information that i am searching for.

It is also possible for me to generate these pointer objects, but i have 
some problems getting them updated, in such a manner that i can run a 
loop application to check status of the modem.

Especially the function "mm_modem_get_state(MMModem*)", does not seem to 
update its information, when i run it without resetting all above 
pointer objects. it this the correct behavior for this function?

Should i consider all MM object pointers as a snapshot frozen in time, 
from when the MMManager* or MMObject* was generated?

Another problem i have, is understanding the correct clearing/unref 
procedure for MMManager*, it does not say in the API wiki, if it should 
be cleared with g_object_unref or NULL, or some other way. an no matter 
how i try to clear this object it seams that i end up with a memory leak 
or a double free pointer error.

I hope you can help me.
Thanks

Troels Olesen.



More information about the ModemManager-devel mailing list