a9797f44aedac4dcbb6d57def2b8824068462605
There are modems out there (e.g. SIM7600E) where we connect a given
CID >1 but once connected, only CID=1 is reported as connected, and
not the one we explicitly attempted to connect. In this situation the
modem is connected successfully, and we're properly ignoring the
disconnection report detected from CGACT? responses, but we're
probably better logging this situation only in debug level, not as
info, because this check is done periodically every 5s...
<debug> [1568649020.333263] (ttyUSB5): --> 'AT+CGDCONT=7,"IP","inet.es"<CR>'
<debug> [1568649020.383517] (ttyUSB5): <-- '<CR><LF>OK<CR><LF>'
<debug> [1568649020.383617] (ttyUSB5) device open count is 3 (open)
<debug> [1568649020.383655] Connection through a plain serial AT port (ttyUSB5)
<debug> [1568649020.383683] (ttyUSB5) device open count is 4 (open)
<debug> [1568649020.383802] (ttyUSB5) device open count is 3 (close)
<debug> [1568649020.383873] (ttyUSB5): --> 'ATD*99***7#<CR>'
<debug> [1568649020.405767] (ttyUSB5): <-- '<CR><LF>CONNECT 115200<CR><LF>'
<debug> [1568649020.405853] [ttyUSB5] Setting flow control: rts-cts
<debug> [1568649020.405878] (ttyUSB5): enabling RTS/CTS flow control
<debug> [1568649020.405897] (ttyUSB5): port attributes not fully set
<debug> [1568649020.405910] (ttyUSB5): flow control settings updated to rts-cts
<debug> [1568649020.405940] (ttyUSB5): port now connected
<debug> [1568649020.405983] Connected bearer '/org/freedesktop/ModemManager1/Bearer/0'
<debug> [1568649020.406081] PPP is required for connection, will ignore disconnection reports
<info> [1568649020.406155] Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> connected)
<info> [1568649020.406361] Simple connect state (8/8): All done
<debug> [1568649020.406461] (ttyUSB5) device open count is 2 (close)
<debug> [1568649020.448483] (net/ppp0): adding device at sysfs path: /sys/devices/virtual/net/ppp0
<debug> [1568649020.448738] (net/ppp0) could not get vendor/product id
<debug> [1568649020.448776] [filter] (net/ppp0) port filtered: virtual device
<debug> [1568649050.395662] (ttyUSB6) device open count is 2 (open)
<debug> [1568649050.395871] (ttyUSB6): --> 'AT+CGACT?<CR>'
<debug> [1568649050.408638] (ttyUSB6): <-- '<CR><LF>+CGACT: 1,1<CR><LF>+CGACT: 2,0<CR><LF>+CGACT: 3,0<CR><LF>+CGACT: 4,0<CR><LF>+CGACT: 5,0<CR><LF>+CGACT: 6,0<CR><LF>+CGACT: 7,0<CR><LF><CR><LF>OK<CR><LF>'
<debug> [1568649050.408803] connection status loaded: disconnected
---> <info> [1568649050.408825] ignoring disconnection report for bearer '/org/freedesktop/ModemManager1/Bearer/0'
<debug> [1568649050.408848] (ttyUSB6) device open count is 1 (close)
<debug> [1568649055.398994] (ttyUSB6) device open count is 2 (open)
<debug> [1568649055.399084] (ttyUSB6): --> 'AT+CGACT?<CR>'
<debug> [1568649055.411489] (ttyUSB6): <-- '<CR><LF>+CGACT: 1,1<CR><LF>+CGACT: 2,0<CR><LF>+CGACT: 3,0<CR><LF>+CGACT: 4,0<CR><LF>+CGACT: 5,0<CR><LF>+CGACT: 6,0<CR><LF>+CGACT: 7,0<CR><LF><CR><LF>OK<CR><LF>'
<debug> [1568649055.411652] connection status loaded: disconnected
---> <info> [1568649055.411674] ignoring disconnection report for bearer '/org/freedesktop/ModemManager1/Bearer/0'
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+.
Languages
C
98.6%
Meson
0.8%
Python
0.4%
Shell
0.2%