CID Clarification

Aleksander Morgado aleksander at aleksander.es
Wed Sep 6 17:03:40 UTC 2017


Hey

>
> I've done some skimming of the list archives and was hoping to get
> some clarification on the use of client ID (CID). My general
> understanding is that a CID refers to an instance of qmicli and it's
> particularly important to use the "--client-cid=[CID]" and
> "--client-no-release-cid" arguments when dealing with NAS and WDS
> commands so the same application instance that is maintaining the
> network connection descriptors is called.
>
> I'm sure I don't understand the concept entirely, could someone
> perhaps provide more general information? Additionally, I'm interested
> in identifying the use cases where it is required to use the above
> arguments.
>

CID stands for "Client ID". Before using any of the QMI services
(except for the internal CTL service) you need to acquire a CID. E.g.
you want to run "DMS Get Operating Mode" command; before doing so you
must have a valid DMS CID allocated.

Allocation and release of CIDs is done internally by libqmi via the
CTL service. When you run a qmicli command, these operations will be
done internally and you won't see them, you will just see the output
of the qmicli command you requested. For each qmicli command, a pair
of CID allocation/release operations will be done before/after the
command.

You can instruct qmicli and libqmi to avoid acquiring a CID before a
command or avoid releasing it after the command. In qmicli you do this
with the --client-cid=[CID] and --client-no-release-cid options. You
would do that if you want to acquire a CID once and reuse it over
multiple operations. This is what non-qmicli based programs like
ModemManager do; a single CID allocation per service and reused for
all operations on the service.

For qmicli, there is only ONE place where it's mandatory to keep the
CID "allocated and not relelased", which is when using the WDS service
to connect the modem. If you release the WDS CID after doing a "WDS
Start Network" operation to connect the device, it would be
automatically disconnected. So you do want to use
--client-no-release-cid explicitly in that case.

Hope this clarifies a bit how it works.

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list