[PATCH] QMI modems ignore IMEI's with 0 prefix

David McCullough david.mccullough at accelecon.com
Tue May 26 23:12:32 PDT 2015


Hi all,

A small patch to allow ModemManager to handle the IMEI on my AT&T Beam (340u).
It has the IMEI printed on the back:

    013323000226606

The ATI command reports:

    mmcli -m 0 --command=i
    response: 'Manufacturer: Sierra Wireless, Incorporated
    Model: AirCard 340U
    Revision: SWI9X15C_01.05.11.23 r13063 carmd-fwbuild1 2013/03/30 23:11:32
    IMEI: 013323000226606
    IMEI SV: 6
    FSN: EV303400260610
    +GCAP: +CGSM,+DS,+ES'

The QMI trace shows it loaded correctly:

    May 27 05:30:50 5400-RM syslog[152]: <debug> [1432704650.928408] [mm-broadband-modem-qmi.c:1292] modem_load_equipment_identifier(): loading equipment identifier...
    May 27 05:30:50 5400-RM syslog[152]: [/dev/cdc-wdm0] Sent message... <<<<<< RAW: <<<<<<   length = 13 <<<<<<   data   = 01:0C:00:00:02:01:00:06:00:25:00:00:00
    May 27 05:30:50 5400-RM syslog[152]: [/dev/cdc-wdm0] Sent message (translated)... <<<<<< QMUX: <<<<<<   length  = 12 <<<<<<   flags   = 0x00 <<<<<<   service = "dms" <<<<<<   client  = 1 <<<<<< QMI: <<<<<<   flags       = "none" <<<<<<   transaction = 6 <<<<<<   tlv_length  = 0 <<<<<<   message     = "Get IDs" (0x0025)
    May 27 05:30:50 5400-RM syslog[152]: [/dev/cdc-wdm0] Received message... >>>>>> RAW: >>>>>>   length = 42 >>>>>>   data   = 01:29:00:80:02:01:02:06:00:25:00:1D:00:02:04:00:00:00:00:00:10:01:00:30:11:0F:00:30:31:33:33:32:33:30:30:30:32:32:36:36:30:36
    May 27 05:30:50 5400-RM syslog[152]: [/dev/cdc-wdm0] Received message (translated)... >>>>>> QMUX: >>>>>>   length  = 41 >>>>>>   flags   = 0x80 >>>>>>   service = "dms" >>>>>>   client  = 1 >>>>>> QMI: >>>>>>   flags       = "response" >>>>>>   transaction = 6 >>>>>>   tlv_length  = 29 >>>>>>   message     = "Get IDs" (0x0025) >>>>>> TLV: >>>>>>   type       = "Result" (0x02) >>>>>>   length     = 4 >>>>>>   value      = 00:00:00:00 >>>>>>   translated = SUCCESS >>>>>> TLV: >>>>>>   type       = "Esn" (0x10) >>>>>>   length     = 1 >>>>>>   value      = 30 >>>>>>   translated = 0 >>>>>> TLV: >>>>>>   type       = "Imei" (0x11) >>>>>>   length     = 15 >>>>>>   value      = 30:31:33:33:32:33:30:30:30:32:32:36:36:30:36 >>>>>>   translated = 013323000226606
    May 27 05:30:50 5400-RM syslog[152]: <debug> [1432704650.958551] [mm-broadband-modem-qmi.c:1189] modem_load_equipment_identifier_finish(): loaded equipment identifier: unknown

The code as seen in the patch below just didn't allow an IMEI with a 0
prefix.  There is similar code for MEID and ESN doing comparisons for
a '0' prefix,  not sure if they are legit or not,

Cheers,
Davidm

Signed-off-by: David McCullough <david.mccullough at accelecon.com>


diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index 4d234c6..c294234 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -1223,7 +1223,7 @@ dms_get_ids_ready (QmiClientDms *client,
      */
 
     if (qmi_message_dms_get_ids_output_get_imei (output, &str, NULL) &&
-        str[0] != '\0' && str[0] != '0') {
+        str[0] != '\0') {
         g_free (ctx->self->priv->imei);
         ctx->self->priv->imei = g_strdup (str);
     }

-- 
David McCullough,  david.mccullough at accelecon.com,   Ph: 0410 560 763


More information about the ModemManager-devel mailing list