997848ef4f6417bbd10696447e6754b7b69d8ee2
The "NAS Get System Selection Preference" response may come without "Mode
Preference". If that is found, look for "Band Preference" and "LTE Band
Preference" TLVs and try to build capabilities from those.
This makes my UML290 properly report CDMA/EVDO+LTE capabilities:
ModemManager[16586]: [/dev/cdc-wdm0] Received message...
>>>>>> QMUX:
>>>>>> length = 55
>>>>>> flags = 0x80
>>>>>> service = "nas"
>>>>>> client = 1
>>>>>> QMI:
>>>>>> flags = "response"
>>>>>> transaction = 1
>>>>>> tlv_length = 43
>>>>>> message = "Get System Selection Preference" (0x0034)
>>>>>> TLV:
>>>>>> type = "Result" (0x02)
>>>>>> length = 4
>>>>>> value = 00:00:00:00
>>>>>> translated = SUCCESS
>>>>>> TLV:
>>>>>> type = "Emergency mode" (0x10)
>>>>>> length = 1
>>>>>> value = 00
>>>>>> translated = 0
>>>>>> TLV:
>>>>>> type = "Band Preference" (0x12)
>>>>>> length = 8
>>>>>> value = 07:00:00:00:00:00:00:00
>>>>>> translated = 7
>>>>>> TLV:
>>>>>> type = "CDMA PRL Preference" (0x13)
>>>>>> length = 2
>>>>>> value = FF:3F
>>>>>> translated = 16383
>>>>>> TLV:
>>>>>> type = "Roaming Preference" (0x14)
>>>>>> length = 2
>>>>>> value = FF:00
>>>>>> translated = 255
>>>>>> TLV:
>>>>>> type = "LTE Band Preference" (0x15)
>>>>>> length = 8
>>>>>> value = 00:00:00:00:00:00:00:00
>>>>>> translated = 0
ModemManager[16586]: KEY: 01:00:01:03:00:00:00:00
ModemManager[16586]: Service: 03
ModemManager[16586]: Client ID: 01
ModemManager[16586]: Transaction ID: 01:00
ModemManager[16586]: <debug> [1347005734.979115] [mm-broadband-modem-qmi.c:321] load_current_capabilities_get_system_selection_preference_ready(): Mode preference not reported in system selection preference
ModemManager[16586]: <debug> [1347005734.979131] [mm-broadband-modem-qmi.c:333] load_current_capabilities_get_system_selection_preference_ready(): Valid bands reported in system selection preference: 'bc-0-a-system, bc-0-b-system, bc-1-all-blocks'
ModemManager[16586]: <debug> [1347005734.979141] [mm-broadband-modem-qmi.c:341] load_current_capabilities_get_system_selection_preference_ready(): LTE band preference found
ModemManager[16586]: [/dev/cdc-wdm0] Sending message...
<<<<<< QMUX:
<<<<<< length = 12
<<<<<< flags = 0x00
<<<<<< service = "dms"
<<<<<< client = 1
<<<<<< QMI:
<<<<<< flags = "none"
<<<<<< transaction = 1
<<<<<< tlv_length = 0
<<<<<< message = "Get Capabilities" (0x0020)
ModemManager[16586]: KEY: 01:00:01:02:00:00:00:00
ModemManager[16586]: Service: 02
ModemManager[16586]: Client ID: 01
ModemManager[16586]: Transaction ID: 01:00
ModemManager[16586]: <debug> [1347005734.982676] [mm-at-serial-port.c:392] debug_log(): (ttyACM0): <-- '<CR><LF>OK<CR><LF>'
ModemManager[16586]: <debug> [1347005734.982751] [mm-serial-port.c:969] mm_serial_port_close(): (ttyACM0) device open count is 2 (close)
ModemManager[16586]: <debug> [1347005734.982797] [mm-at-serial-port.c:392] debug_log(): (ttyACM0): --> 'AT+CMEE=1<CR>'
ModemManager[16586]: [/dev/cdc-wdm0] Received message...
>>>>>> QMUX:
>>>>>> length = 38
>>>>>> flags = 0x80
>>>>>> service = "dms"
>>>>>> client = 1
>>>>>> QMI:
>>>>>> flags = "response"
>>>>>> transaction = 1
>>>>>> tlv_length = 26
>>>>>> message = "Get Capabilities" (0x0020)
>>>>>> TLV:
>>>>>> type = "Result" (0x02)
>>>>>> length = 4
>>>>>> value = 00:00:00:00
>>>>>> translated = SUCCESS
>>>>>> TLV:
>>>>>> type = "Info" (0x01)
>>>>>> length = 16
>>>>>> value = B0:9D:57:00:00:DD:6D:00:03:02:05:01:02:04:05:08
>>>>>> translated = [ max_tx_channel_rate = '5742000' max_rx_channel_rate = '7200000' data_service_capability = '3' sim_capability = '2' radio_interface_list = '{ [0] = '1 ' [1] = '2 ' [2] = '4 ' [3] = '5 ' [4] = '8 '}' ]
ModemManager[16586]: KEY: 01:00:01:02:00:00:00:00
ModemManager[16586]: Service: 02
ModemManager[16586]: Client ID: 01
ModemManager[16586]: Transaction ID: 01:00
ModemManager[16586]: <debug> [1347005734.983353] [mm-broadband-modem-qmi.c:183] modem_load_current_capabilities_finish(): loaded current capabilities: cdma-evdo, lte
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%