The format of CREG/CGREG/CEREG responses is not very precisely defined
in or strictly enforced by the 3GPP specifications. That leads to the
fact that some modems put leading zeros in integer type fields (e.g.
<n>, <stat>, <AcT>), and not all modems put double quotes around string
type fields (e.g. <lac>, <ci>) in those C*REG responses.
For example, 0001 can be a valid value for both <stat> and <lac>. The
original C*REG parsing code in ModemManager could potentially interpret
'+CREG: <stat>,<lac>,<ci>,<AcT>' as '+CREG: <n>,<stat>,<lac>,<ci>'. This
patch addresses this issue by refining the regular expressions returned
by mm_3gpp_creg_regex_get() with the following assumptions:
1. If a modem puts leading zeros in integer type fields, it puts double
quotes around string type fields.
2. If a modem omits double quotes around string type fields, it does not
put leading zeros in integer type fields.
When we're exposing not-yet-completed multipart messages, we need to provide a
correct value for the validity property, or gdbus may crash, see e.g.:
https://bugzilla.gnome.org/show_bug.cgi?id=704319
This patch fixes the following incorrect conversions from double to gint32:
mm-broadband-modem-qmi.c:4785:27: error: implicit conversion from 'double' to 'gint32' (aka 'int')
changes value from 2.225073858507201E-308 to 0 [-Werror,-Wliteral-conversion]
gint32 bs_longitude = MM_LOCATION_LONGITUDE_UNKNOWN;
~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm-broadband-modem-qmi.c:4786:26: error: implicit conversion from 'double' to 'gint32' (aka 'int')
changes value from 2.225073858507201E-308 to 0 [-Werror,-Wliteral-conversion]
gint32 bs_latitude = MM_LOCATION_LATITUDE_UNKNOWN;
~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
This patch fixes the following enumeration type mismatches:
mm-modem-helpers-qmi.c:980:12: error: implicit conversion from
enumeration type 'QmiNasRatModePreference' to different
enumeration type 'QmiNasRadioTechnologyPreference' [-Werror,-Wenum-conversion]
return qmi;
~~~~~~ ^~~
mm-modem-helpers-qmi.c:1082:12: error: implicit conversion from
enumeration type 'MMModemMode' to different
enumeration type 'QmiNasGsmWcdmaAcquisitionOrderPreference' [-Werror,-Wenum-conversion]
return MM_MODEM_MODE_NONE;
~~~~~~ ^~~~~~~~~~~~~~~~~~
mm-modem-helpers-qmi.c:1096:16: error: implicit conversion from
enumeration type 'QmiNasRegistrationState' to different
enumeration type 'MMModem3gppRegistrationState' [-Werror,-Wenum-conversion]
return QMI_NAS_REGISTRATION_STATE_NOT_REGISTERED;
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Prints out a warning if ioctl(TIOCSSERIAL) fails to set closing_wait to
none. This helps debug issues when a serial driver does not support or
properly handle closing_wait, which may cause closing of the serial port
to block.
Icera-based Nokia modems may reply correctly to the Icera probing only in some
AT ports, not in all. In order to handle this situation we override the final
plugin selected to be the Icera-based one if we find that the mismatched plugins
have the 'icera-allowed' and 'icera-forbidden' filters.
https://bugzilla.gnome.org/show_bug.cgi?id=703022
We will expose a new 'Ports' property listing all ports currently known by a
given modem. Ports which are not used but are detected as being part of the
modem will be listed with an 'unknown' port type.
This change uses the new 'MMModemPortType' enum and the new 'MMModemPortInfo'
helper struct to handle these values in libmm-glib. The already available
'MMPortType' enum hasn't been re-used for the interface because it contains
values that we don't need (e.g. IGNORED).
The port list is now also included in the modem information command of mmcli:
$ sudo mmcli -m 0
/org/freedesktop/ModemManager1/Modem/0 (device id '97b7b99e3e2bea103880545b619fb05a3cc81b26')
-------------------------
System | device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4'
| drivers: 'qcserial, qmi_wwan'
| plugin: 'Gobi'
| primary port: 'cdc-wdm0'
| ports: 'ttyUSB0 (qcdm), ttyUSB1 (at), cdc-wdm0 (qmi), wwp0s29u1u4 (net)'
https://bugzilla.gnome.org/show_bug.cgi?id=702678
The real power state value of the modem may be changed by other means, e.g.
rfkill. So when changing power state of the modem in MM, we better recheck
which the current power status is.
A better full approach would be to follow rfkill changes, but this fix should
help until that is done.
https://bugzilla.gnome.org/show_bug.cgi?id=702838
My Huawei MBIM modem notifies of standard new messages using MBIM_CID_MESSAGE_STORE_STATUS
notifications, which is kind of wrong, as they should really be notified using
MBIM_SMS_READ notifications; but anyway, try to handle those.
Tests had either their own g_print()s or they would enable a _mm_log() method to
get all g_debug()s from the libraries printed. In order to cleanup the result of
the tests run, avoid this stdout dumps by default, and only enable them if
explicitly enabled in CFLAGS, e.g.:
$> ./configure CFLAGS="-DENABLE_TEST_MESSAGE_TRACES"
Some modems do require it, but some others won't (e.g. CDMA based ones), so
just make the operation optional, but only if the modem replies NoDeviceSupport.
https://bugzilla.gnome.org/show_bug.cgi?id=702419
It is quite common to have modems handled with QMI but with very limited
services implemented, e.g. without WMS:
[/dev/cdc-wdm0] QMI Device supports 5 services:
[/dev/cdc-wdm0] ctl (1.3)
[/dev/cdc-wdm0] wds (1.5)
[/dev/cdc-wdm0] dms (1.2)
[/dev/cdc-wdm0] nas (1.0)
[/dev/cdc-wdm0] cat (0.0)
We'll now fallback to use plain AT commands when no QMI WMS service is found.
It sometimes provides a much better view of the supported modes than the WS46=?
command, which is not always properly implemented. E.g.:
Nokia N950:
---------------
at+ws46=?
(12)
OK
at*cnti=2
*CNTI: 2,GSM,GPRS,EDGE,UMTS,HSDPA,HSUPA
OK
Sierra AC313u
---------------
at+ws46=?
ERROR
at*cnti=2
*CNTI: 2,GSM,GPRS,EDGE,UMTS,HSDPA/HSUPA,HSPA+,LTE
OK
We may be asking to load supported modes while in locked state, so the commands
may fail. In order to re-load them properly once we're unlocked, we better just
return an error instead of setting defaults.
We won't allow changing modes or bands through Simple.Connect(). Applications
should instead look at the corresponding SupportedBands or SupportedModes, and
then use SetCurrentBands() or SetCurrentModes() explicitly.