[libmm-glib] MM API usage and GLib

Alejandro Vega alexvega48 at gmail.com
Thu Jul 26 10:18:11 UTC 2018


Hello,

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.

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 ?

Thank you very much!

2018-06-21 10:26 GMT+02:00 Aleksander Morgado <aleksander at aleksander.es>:

> Hey,
>
> > I am currently facing the implementation of a application which makes
> use of
> > the libmm-glib high level API and I am facing some problems when I try to
> > use this API in my C++ application.
> >
> > Until now in my C++ application I have been using Boost::Asio in order to
> > manage asynchronous calls and keep the program alive while performing
> > operations with io.run(). However, when I started using libmm-glib API I
> > took a look at qmicli (which , if I am not wrong, it is an example of
> use of
> > this API) and noticed that it makes use of Glib library.
> >
> > After making some tests I noticed that io.run() is totally incompatible
> with
> > making async queries using g_main_loop_run() as they both launch a loop
> > separately and I cant find a elegant and working solution to use both.
> >
> > Keeping in mind that I want to keep using asio to manage the operations
> in
> > my application,
> >
> > - what could be the best way to make use of this API ? (threads,
> > starting/exiting loop, ...)
> > - has anyone faced the development of an application in which
> Boost::asio
> > and Glib interact ?
> >
>
> No idea how to sync Boost::asio and GLib main loops :) I know that the
> GLib main loop may be extended with additional loops "scheduling" the
> additional loop within the GLib main loop, but I don't know if
> Boost::asio can do that easily... I  have used both things myself,
> never together.
> For C++ programs you could use Qt, as Qt reuses the GLib main loop, so
> libmm-glib works out of the box. Or, even better, just use
> ModemManagerQt... Have to say that writing lambdas in Qt5 for async
> calls is extremely nice, even if I find the ModemManagerQt layer a bit
> redundant (works on top of the libmm-glib library). I've worked with
> ModemManagerQt in the past months and does the job for me.
>
> --
> Aleksander
> https://aleksander.es
>



-- 


Alejandro Vega
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20180726/0161f189/attachment.html>


More information about the ModemManager-devel mailing list