Hey! > If your using c/c++ consider looking into the library ModemManager > exposes, this is how mmcli works > (https://cgit.freedesktop.org/ModemManager/ModemManager/tree/libmm-glib). > It handles the dbus calls for you and just exposes some nice c code > wrappers. In your case you should look at how 'mm-modem-signal.c' > works and consider linking the library and including the libmm-glib.h > header. > > If you're using another language you could also use dbus to access > information from ModemManager directly, you can read up more on dbus > here (https://www.freedesktop.org/wiki/Software/dbus/). For all the > API's exposed by ModemManager via dbus you can checkout the API doc > page (https://www.freedesktop.org/software/ModemManager/api/latest/). > Python has a very nice dbus support library and there are lot's of > examples online. Hope that helps. >
Definitely this, yes. Running mmcli commands and parsing its output is not a good idea right now, as the output of mmcli may change at any point in time so your parsing may break in a future MM update. The DBus API is stable, and any program written using that API directly will always work as long as new MM releases are API compatible. For a simple program that parses the signal output, doing this in python should be extremely easy. That said, my OpenWRT integration (that I assume Nick is using, given he talks about uqmi as well), is based on.... parsing mmcli command outputs :D yeah, that's very nasty, but in my mind this was because I did want to have the mmcli output not in human-readable way (hard to parse) but in some other optional way that would be easier to use via shell scripts, e.g. returning a list of key=value pairs one per line directly (and maintaining that API compatible in newer releases). That idea is still open and I would love to have that implemented, so that mmcli can then be used safely and easily from within shell scripts. -- Aleksander https://aleksander.es _______________________________________________ ModemManager-devel mailing list ModemManager-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel