[libmm-glib] MM API usage and GLib

Aleksander Morgado aleksander at aleksander.es
Thu Jul 26 10:35:18 UTC 2018


Hey,

>
> I have been making further tests to try to combine Glib and Boost::asio
> loops without much success. Regarding this and keeping in mind I should keep
> using Boost::asio in my application:
>
> - Do you it may be possible to make use of libmm-glib API performing only
> sync calls ? Could this be a good approach ? At least this way I could get
> rid of the GMainLoop.
>

The sync calls would still use implicit GMainLoops in the inner
workings, you just won't see them :)
Regarding whether it's good or bad, well, it will work, but the calls
will block until they finish, and that then depends on you whether you
want to accept that.

> On other hand, I decided to check out the ModemManagerQt code and some
> questions have arised:
>
> - If I am not wrong , ModemManagerQt seems to use the Low level MM DBus API.
> Do you know the reasons (advantages / disadvantages ) behind using this
> interface instead of the High level one ?
>
> - How should a developer decide whether to use the Low Level or the High
> level API ? Which may be easier to integrate it in a C++ application ?
>

There's not much difference really in both APIs, the high level one
gives you some nicer things like objects directly instead of paths to
create objects, and things like that. The high level API uses the low
level API internally, so whatever is used is fine, it all depends on
your needs. ModemManagerQt uses the Qt main loop logic, and Qt uses
GLib's main loop internally anyway, so all plays nicely together. I'm
sure there are ways to merge Boost/Asio's main loops with GLib's main
loops... Worst case, you could even run GLib main loop in a separate
thread and your main application using Boost/Asio main loops.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list