Reg bringing up libqmi

Aleksander Morgado aleksander at lanedo.com
Thu Feb 21 01:56:53 PST 2013


Hey Marcel!

>> > I am trying to bring up libqmi in a embedded residential gateway product.
>> > 
>> > Please let me know if there is any light weight libqmi source, since i will not be able to install the required packages, glib in my product.
> inside oFono (drivers/qmimodem/qmi.c) we have a lightweight QMI library.
> It still uses GLib, but only its core library for the mainloop and basic
> data structures. So no GObject or JSON.

JSON in libqmi is just required during compilation, to generate the
source code.

GObject-based sources were a nice addon to easily handle the
communication with the QMI device (e.g. signals for indications), and it
integrates well with ModemManager and others (e.g. via introspection).

The guys at OpenWRT are working on a C-only based library which would
help to create/parse the QMI messages, using a modified code generator
and our JSON database, and targeted to be included directly within the
applications (i.e. no API stability or anything). That really makes a
lot of sense to me, for e.g. embedded applications not wanting to use
glib and friends.

> 
> If you really want to use QMI properly, then only an integration into a
> real telephony stack makes sense. I never considered a standalone QMI
> library a good idea. Same as nobody really has a standalone library for
> just handling AT commands. 

A standalone QMI library itself, and actually every library, is stupid,
of course, unless a connection manager or other application uses it :)
libqmi is used by both qmicli/qmi-network and ModemManager (and possibly
Python-based connection managers soon through GObject introspection).

Also, libqmi is not only about reusing code, it's about making it easier
to use the protocol by hiding all the logic to handle
request/responses/indications. The libmbim I'm writing these days for
MBIM goes even further and handles transparently all message
fragmentation requirements, which is nice. Why does everyone have to
write its own QMI handling code within the telephony stack in order to
"use QMI properly"?

Also, I very much prefer a code generator giving me all needed sources
to parse and create really complex messages with TLVs including arrays
of structs with other arrays inside for example, than writing a custom
parsing for each new such TLV I find... e.g.

http://cgit.freedesktop.org/libqmi/tree/data/qmi-service-dms.json#n971

Of course you still need to then integrate the logic in your own
connection manager, but at least I don't need to write the parsing code
for that message.

> So for oFono its all fully integrated and
> that helps a lot when you reach the point of having to deal with the SIM
> filesystem, SIM Toolkit or SMS.

I understand that if you're targeting custom embedded systems you don't
want a generic implementation and you may want your own, e.g. only
implementing the messages you really need. That's fine, and wise. Now, I
don't know how exactly that helps in dealing with e.g. SMS. How does a
fully integrated custom implementation help with that? Just wondering.

Cheers!

-- 
Aleksander


More information about the libqmi-devel mailing list