Skip to content

New 'ConnectionError' property in the Bearer object

When a connection attempt fails, the process that started the attempt will get an error specifying the reason for the failure (if reported by the modem). This error would usually just get logged by the process that started the connection (e.g. NetworkManager) and not much more would be done with it.

When a connection is ongoing and the network disconnects the modem, we may also get a detailed error with the reason for the disconnection (if reported by the modem). This error would be logged by ModemManager itself, and nothing else would be done with it.

This merge request improves how these errors are handled, by exposing them in a new "ConnectionError" property in the Bearer object. This property is cleared on every new connection attempt.

This merge request also includes the commits that were originally suggested in !527 (closed), so it includes all the new mobile equipment errors defined in the latest 3GPP specs, as well as the improved MBIM and QMI error mappings to such errors.

The reported connection errors can now be inspected via mmcli easily, e.g. this bearer had a connection attempt failure due to a user cancellation:

$ mmcli -b 0
  --------------------------------------
  General    |                     path: /org/freedesktop/ModemManager1/Bearer/0
             |                     type: default
  --------------------------------------
  Status     |                connected: no
             |    connection error name: org.freedesktop.ModemManager1.Error.Core.Cancelled
             | connection error message: operation cancelled
             |                suspended: no
             |              multiplexed: no
             |               ip timeout: 20
  --------------------------------------
  Properties |                      apn: internet
             |                  roaming: allowed
             |                  ip type: ipv4
  --------------------------------------
  Statistics |                 attempts: 1

And this one was successfully connected, but it was later on disconnected automatically (i.e. no user disconnect was triggered):

$ mmcli -b 1
  --------------------------------------
  General    |                     path: /org/freedesktop/ModemManager1/Bearer/1
             |                     type: default
  --------------------------------------
  Status     |                connected: no
             |    connection error name: org.freedesktop.ModemManager1.Error.MobileEquipment.Unknown
             | connection error message: Call failed: internal error: mmgdsi-card-event
             |                suspended: no
             |              multiplexed: no
             |               ip timeout: 20
  --------------------------------------
  Properties |                      apn: internet
             |                  roaming: allowed
             |                  ip type: ipv4
  --------------------------------------
  Statistics |                 duration: 18
             |                 attempts: 1
             |           total-duration: 18
Edited by Aleksander Morgado

Merge request reports