libqmi-glib
Aleksander Morgado
aleksander at lanedo.com
Mon Apr 23 07:06:03 PDT 2012
Hey Bjørn,
>>
>> I've recently been playing quite some time with QMI devices, and
>> analyzing Chromium's libqmi. I also started libqmi-glib, what I
>> thought would be just a small layer on top of Chromium's libqmi's
>> generic implementation, providing a GLib/GIO like interface. This
>> small layer ended up being quite a rewrite of Chromium's libqmi,
>> fixing some things and taking some other approaches sometimes.
> [..]
>> Comments, thoughts?
>
> The code looks like a good start to me, but I'm a bit worried about the
> amount of duplicated work here. Maybe I shouldn't as a long as I'm not
> doing any of it, but it still feels wrong...
>
Believe me when I tell you that I'm the first one not wanting to
duplicate code here :-); I just don't think that providing a GLib/GIO
like API is duplicating code, it's only a better glue between libqmi and
other GLib-based apps. And anyway, given that chromium's libqmi already
uses GLib internally, why not just use also the main loop and async
methods? I'm probably a bit biased anyway, as I only expect to use
libqmi within GLib-based applications.
> Anyway. One initial comment regarding the QMI_DMS_MESSAGE_GET_IDS
> parsing (I believe this has been brought up before): The parsing
> currently fails on all (European) MDM9200 based devices I've got:
>
I just pushed a fix which will only force to fail the parsing if none of
the expected outputs is found. Let's see if that works.
>
> bjorn at nemi:/usr/local/src/git/libqmi-glib$ cli/qmicli --device=/dev/cdc-wdm0 --verbose --dms-get-ids
> [23 Apr 2012, 14:00:46] [Debug] Checking version info...
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] QMI Device supports 14 services:
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] ctl (1.5)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] wds (1.12)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] dms (1.6)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] nas (1.8)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] qos (1.3)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] wms (1.3)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] pds (1.10)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] auth (1.1)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] voice (2.1)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] cat2 (2.0)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] uim (1.4)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] pbm (1.4)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] sar (1.0)
> [23 Apr 2012, 14:00:46] [Debug] [/dev/cdc-wdm0] rms (1.0)
> [23 Apr 2012, 14:00:46] [Debug] Asynchronously getting IDs...
> error: couldn't get IDs: Getting IDs reply parsing failed: TLV not found
> bjorn at nemi:/usr/local/src/git/libqmi-glib$ cli/qmicli --device=/dev/cdc-wdm2 --verbose --dms-get-ids
> [23 Apr 2012, 14:00:51] [Debug] Checking version info...
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] QMI Device supports 13 services:
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] ctl (1.5)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] wds (1.12)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] dms (1.6)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] nas (1.8)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] qos (1.3)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] wms (1.3)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] pds (1.10)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] auth (1.1)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] voice (2.1)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] cat2 (2.0)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] uim (1.4)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] pbm (1.4)
> [23 Apr 2012, 14:00:51] [Debug] [/dev/cdc-wdm2] cat (0.0)
> [23 Apr 2012, 14:00:51] [Debug] Asynchronously getting IDs...
> error: couldn't get IDs: Getting IDs reply parsing failed: TLV not found
>
>
> Both of these return TLV 0x10 == '0' and TLV 0x11 == IMEI. Slightly
> obfuscated output:
>
> Sierra Wireless MC7710 in QMI mode:
>
> [Mon Apr 23 14:01:50 2012] read 42 bytes from /dev/cdc-wdm0
> 01 29 00 80 02 07 02 07 00 25 00 1d 00 02 04 00 00 00 00 00 10 01 00 30 11 0f 00 33 35 38 31 37 38 30 34 30 30 31 32 33 34 35
> <= QMUX Header:
> <= len: 0x0029
> <= sender: 0x80
> <= svc: 0x02
> <= cid: 0x07
>
> <= QMI Header:
> <= Flags: 0x02
> <= TXN: 0x0007
> <= Cmd: 0x0025
> <= Size: 0x001d
> <= [0x02] ( 4) 00 00 00 00 SUCCESS - QMI_ERR_NONE
> <= [0x10] ( 1) 30 0
> <= [0x11] (15) 33 35 38 31 37 38 30 34 30 30 31 32 33 34 35 358178040012345
>
>
> Huawei E392:
>
> [Mon Apr 23 13:56:36 2012] read 42 bytes from /dev/cdc-wdm2
> 01 29 00 80 02 08 02 07 00 25 00 1d 00 02 04 00 00 00 00 00 10 01 00 30 11 0f 00 38 36 30 39 39 39 30 30 30 30 31 32 33 34 35
> <= QMUX Header:
> <= len: 0x0029
> <= sender: 0x80
> <= svc: 0x02
> <= cid: 0x08
>
> <= QMI Header:
> <= Flags: 0x02
> <= TXN: 0x0007
> <= Cmd: 0x0025
> <= Size: 0x001d
> <= [0x02] ( 4) 00 00 00 00 SUCCESS - QMI_ERR_NONE
> <= [0x10] ( 1) 30 0
> <= [0x11] (15) 38 36 30 39 39 39 30 30 30 30 31 32 33 34 35 860999000012345
>
>
> So the parsing fails because there is no MEID TLV. The ESN also looks
> quite useless, but at least it's present so parsing should work.
>
>
> Bjørn
> _______________________________________________
> libqmi-devel mailing list
> libqmi-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libqmi-devel
--
Aleksander
More information about the libqmi-devel
mailing list