Taking data bearer technology string

Aleksander Morgado aleksander at aleksander.es
Fri May 15 16:36:29 UTC 2020


> Thanks. Yes, I have a GLib main loop running.
> Well, my code is a bit large, but for this specific problem it would be enough for me if I can find out just how it would be possible to receive the result of "sudo qmicli -d /dev/cdc-wdm0 --wds-get-data-bearer-technology -p" on the qmicli main, suppossing the original qmicli.c and qmicli-wds.c codes and just printing out that result (the bearer technology) from the qmicli main (instead of from get_data_bearer_technology_ready method on qmicli-wds.c)

You're really already receiving that info in the "main" if you think
about it. The "main" of qmicli is the one who runs the GLib main loop.
The get_data_bearer_technology_ready() method is a callback that is
run inside that GLib main loop.

It all depends on whether you want to keep the main loop running after
the call to get_data_bearer_technology_ready() or not. If you want the
result in your "main" you would need to store it somewhere and then
stop the main loop, so that the logic returns to your "main". But that
is very nasty, because you still would need to deallocate the QMI
clients and what not.

The idea of running the GLib main loop in a separate thread, and keep
that loop running forever (as your program is not a CLI) sounds a
better approach.

But again, without an example code of what you're trying to achieve,
it's hard to say.


More information about the libqmi-devel mailing list