The GTask stored in the private modem struct indicates whether a power update operation is ongoing. We should keep this task stored always until just before completing the GTask. We also make sure that any additional step (e.g. disabling DMS event report indications) is included in the power update operation, so that they are correctly synchronized also in the modem. This fix should solve a crash triggered by a DMS event report indication being received while setting up the next power update operation. 0x0000007aa67de878 (libc.so.6 + 0x0007e878) pthread_key_delete 0x0000007aa6799d28 (libc.so.6 + 0x00039d28) gsignal 0x0000007aa6786e2c (libc.so.6 + 0x00026e2c) abort 0x0000007aa6feb188 (libglib-2.0.so.0 - gtestutils.c: 3256) g_assertion_message 0x0000007aa6feb1f8 (libglib-2.0.so.0 - gtestutils.c: 3282) g_assertion_message_expr 0x0000005a58199b7c (ModemManager - mm-broadband-modem-qmi.c: 1926) dms_set_event_report_operating_mode_activate_ready 0x0000007aa6e4b7a0 (libgio-2.0.so.0 - gtask.c: 1232) g_task_return_now 0x0000007aa6e4a6b0 (libgio-2.0.so.0 - gtask.c: 1301) g_task_return 0x0000007aa6b58400 (libqmi-glib.so.5 - qmi-dms.c: 32600) set_event_report_ready 0x0000007aa6e3642c (libgio-2.0.so.0 - gsimpleasyncresult.c: 804) g_simple_async_result_complete 0x0000007aa6e36538 (libgio-2.0.so.0 - gsimpleasyncresult.c: 816) complete_in_idle_cb 0x0000007aa6fc6390 (libglib-2.0.so.0 - gmain.c: 3444) g_main_context_dispatch 0x0000007aa6fc66c4 (libglib-2.0.so.0 - gmain.c: 4238) g_main_context_iterate 0x0000007aa6fc6a34 (libglib-2.0.so.0 - gmain.c: 4438) g_main_loop_run 0x0000005a58119274 (ModemManager - main.c: 221) main 0x0000007aa67870f8 (libc.so.6 + 0x000270f8) __libc_init_first 0x0000007aa67871c8 (libc.so.6 + 0x000271c8) __libc_start_main 0x0000005a58118aec (ModemManager + 0x000a8aec) _start
ModemManager
ModemManager provides a unified high level API for communicating with mobile broadband modems, regardless of the protocol used to communicate with the actual device (Generic AT, vendor-specific AT, QCDM, QMI, MBIM...).
Using
ModemManager is a system daemon and is not meant to be used directly from the command line. However, since it provides a DBus API, it is possible to use 'dbus-send' commands or the new 'mmcli' command line interface to control it from the terminal. The devices are queried from udev and automatically updated based on hardware events, although a manual re-scan can also be requested to look for RS232 modems.
Implementation
ModemManager is a DBus system bus activated service (meaning it's started automatically when a request arrives). It is written in C, using glib and gio. Several GInterfaces specify different features that the modems support, including the generic MMIfaceModem3gpp and MMIfaceModemCdma which provide basic operations for 3GPP (GSM, UMTS, LTE) or CDMA (CDMA1x, EV-DO) modems. If a given feature is not available in the modem, the specific interface will not be exported in DBus.
Plugins
Plugins are loaded on startup, and must implement the MMPlugin interface. It consists of a couple of methods which tell the daemon whether the plugin supports a port and to create custom MMBroadbandModem implementations. It most likely makes sense to derive custom modem implementations from one of the generic classes and just add (or override) operations which are not standard. There are multiple fully working plugins in the plugins/ directory that can be used as an example for writing new plugins. Writing new plugins is highly encouraged! The plugin API is open for changes, so if you're writing a plugin and need to add or change some public method, feel free to suggest it!
License
The ModemManager and mmcli binaries are both GPLv2+. The libmm-glib library is LGPLv2+.
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms, which you can find in the following link: https://www.freedesktop.org/wiki/CodeOfConduct
CoC issues may be raised to the project maintainers at the following address: modemmanager-devel-owner@lists.freedesktop.org