[review] Support for printing message field contents in debug traces
Aleksander Morgado
aleksander at aleksander.es
Sun Oct 7 20:45:29 UTC 2018
Hey,
The following MR implements support for printing the message field
contents, in a similar way as done in libqmi.
https://gitlab.freedesktop.org/mobile-broadband/libmbim/merge_requests/1
There is a lot of room for improvement in the codegen code... the
logic is much simpler and uglier than the one in libqmi, but that is
also because the protocol is a bit simpler, and we don't have "arrays
of structs that have themselves other arrays of other structs..." as
in QMI. Being a simpler protocol, the only complication in MBIM is the
separate field-printers when out-of-struct and the field-printers when
in-struct.
Anyway, it works, and I find it extremely handy to debug issues when
e.g. ModemManager is used in debug mode.
A quick example when querying device caps, this is what we now would
see in the debug log:
[07 oct 2018, 22:43:39] [Debug] [/dev/cdc-wdm3] Received message (translated)...
>>>>>> Header:
>>>>>> length = 212
>>>>>> type = command-done (0x80000003)
>>>>>> transaction = 3
>>>>>> Fragment header:
>>>>>> total = 1
>>>>>> current = 0
>>>>>> Contents:
>>>>>> status error = 'None' (0x00000000)
>>>>>> service = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
>>>>>> cid = 'device-caps' (0x00000001)
>>>>>> Fields:
>>>>>> DeviceType = 'embedded'
>>>>>> CellularClass = 'gsm'
>>>>>> VoiceClass = 'no-voice'
>>>>>> SimClass = 'removable'
>>>>>> DataClass = 'umts, hsdpa, hsupa, lte, custom'
>>>>>> SmsCaps = 'pdu-receive, pdu-send'
>>>>>> ControlCaps = 'reg-manual'
>>>>>> MaxSessions = '8'
>>>>>> CustomDataClass = 'HSPA+'
>>>>>> DeviceId = '863212030078742'
>>>>>> FirmwareInfo = '18500.5001.00.01.20.72'
>>>>>> HardwareInfo = 'V1.0.4'
Comments?
--
Aleksander
https://aleksander.es
More information about the libmbim-devel
mailing list