<div dir="ltr"><div>Hello, <br></div><div><br></div><div>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:</div><div><br></div><div>- 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. <br></div><div><br></div><div> On other hand, I decided to check out the ModemManagerQt code and some questions have arised:<br></div><div><br></div><div>- 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 ?</div><div><br></div><div>- 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 ?<br></div><div><br></div><div>Thank you very much!<br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-06-21 10:26 GMT+02:00 Aleksander Morgado <span dir="ltr"><<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey,<br>
<span class="gmail-"><br>
> I am currently facing the implementation of a application which makes use of<br>
> the libmm-glib high level API and I am facing some problems when I try to<br>
> use this API in my C++ application.<br>
><br>
> Until now in my C++ application I have been using Boost::Asio in order to<br>
> manage asynchronous calls and keep the program alive while performing<br>
> operations with io.run(). However, when I started using libmm-glib API I<br>
> took a look at qmicli (which , if I am not wrong, it is an example of use of<br>
> this API) and noticed that it makes use of Glib library.<br>
><br>
> After making some tests I noticed that io.run() is totally incompatible with<br>
> making async queries using g_main_loop_run() as they both launch a loop<br>
> separately and I cant find a elegant and working solution to use both.<br>
><br>
> Keeping in mind that I want to keep using asio to manage the operations in<br>
> my application,<br>
><br>
> - what could be the best way to make use of this API ? (threads,<br>
> starting/exiting loop, ...)<br>
> - has anyone faced the development of an application in which Boost::asio<br>
> and Glib interact ?<br>
><br>
<br>
</span>No idea how to sync Boost::asio and GLib main loops :) I know that the<br>
GLib main loop may be extended with additional loops "scheduling" the<br>
additional loop within the GLib main loop, but I don't know if<br>
Boost::asio can do that easily... I have used both things myself,<br>
never together.<br>
For C++ programs you could use Qt, as Qt reuses the GLib main loop, so<br>
libmm-glib works out of the box. Or, even better, just use<br>
ModemManagerQt... Have to say that writing lambdas in Qt5 for async<br>
calls is extremely nice, even if I find the ModemManagerQt layer a bit<br>
redundant (works on top of the libmm-glib library). I've worked with<br>
ModemManagerQt in the past months and does the job for me.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
-- <br>
Aleksander<br>
<a href="https://aleksander.es" rel="noreferrer" target="_blank">https://aleksander.es</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><br><div><br></div><div>Alejandro Vega</div></div></div>
</div></div>