be8c8a99bb29d340720715874696bc1fae11d331
This patch fixes a crash in mm_device_grab_port() when doing a string comparison on a NULL returned by g_udev_device_get_driver(). Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 ) 0x76b760b4 [libc-2.15.so] - strcmp.c:38 strcmp 0x76c66a7d [libglib-2.0.so.0.3200.4] - ghash.c:1704 g_str_equal 0x76ee0e5d [ModemManager] - mm-device.c:147 mm_device_grab_port 0x76edf9d9 [ModemManager] - mm-manager.c:313 device_added 0x76e95b2d [libgudev-1.0.so.0.1.0] - extras/gudev/gudevmarshal.c:84 g_udev_marshal_VOID__STRING_OBJECT 0x76d1fb2b [libgobject-2.0.so.0.3200.4] - gclosure.c:777 g_closure_invoke 0x76d2b88b [libgobject-2.0.so.0.3200.4] - gsignal.c:3551 signal_emit_unlocked_R 0x76d313c5 [libgobject-2.0.so.0.3200.4] - gsignal.c:3300 g_signal_emit_valist 0x76d31569 [libgobject-2.0.so.0.3200.4] - gsignal.c:3356 g_signal_emit 0x76e93bdd [libgudev-1.0.so.0.1.0] - extras/gudev/gudevclient.c:105 monitor_event 0x76c9beb7 [libglib-2.0.so.0.3200.4] - giounix.c:166 g_io_unix_dispatch 0x76c714c1 [libglib-2.0.so.0.3200.4] - gmain.c:2539 g_main_context_dispatch 0x76c71745 [libglib-2.0.so.0.3200.4] - gmain.c:3146 g_main_context_iterate 0x76c71a59 [libglib-2.0.so.0.3200.4] - gmain.c:3340 g_main_loop_run 0x76ede8ed [ModemManager] - main.c:142 main 0x76b35f79 [libc-2.15.so] - libc-start.c:226 __libc_start_main 0x76edea49 [ModemManager] + 0x00014a49 0x76eb4eab [ld-2.15.so] + 0x0000aeab
license: use GPLv2 as top level COPYING for now to reflect the license actually used by source files
ModemManager. The problem ModemManager tries to solve is to provide a unified high level API for communicating with (mobile broadband) modems. While the basic commands are standardized, the more advanced operations (like signal quality monitoring while connected) varies a lot. Using. ModemManager is a system daemon and is not meant to be used directly from the command line. However, since it provides DBus API, it is possible to use 'dbus-send' command to control it from the terminal. There's an example program (tests/mm-test.py) that demonstrates the basic API usage. Implementation. ModemManager is a DBus system bus activated service (meaning it's started automatically when a request arrives). It is written in C. The devices are queried from udev and automatically updated based on hardware events. There's a GInterface (MMModem) that defines the modem interface and any device specific implementation must implement it. There are two generic MMModem implementations to support the basic operations (one for GSM, one for CDMA,) which are common for all cards. 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 MMModem 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's a fully working plugin in the plugins/ directory for Huawei cards that can be used as an example for writing new plugins. Writing new plugins is highly encouraged! API. The 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!
Languages
C
98.6%
Meson
0.8%
Python
0.4%
Shell
0.2%