disconnect
Aleksander Morgado
aleksander at aleksander.es
Sun Mar 15 09:22:46 UTC 2020
Hey,
> In qmicli, wds,
> is there a way to disconnect from any connection and close any client ?
> Just to avoid the painfull command:
> qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-stop-network=MYHANDLE --client-cid=MYCID
>
I was trying to think of different ways to do this (e.g. trying with
0xFFFFFFFF handle if you lost MYHANDLE), but if you just want to close
all connections that may have been opened, I guess you can just set
the modem in low-power mode as that will perform the disconnection of
all contexts, plus IMSI detach procedure from the network; e.g.:
$ qmicli -d /dev/cdc-wdm0 -p --dms-set-operating-mode=low-power
I understand this may not be what you're really looking for, though,
because you also talk about closing any client.
In libqmi there is no explicit way to close all clients, because
libqmi itself doesn't track which clients are open: once a client is
open, the ownership of the object associated to the client is
transferred to the user of the application. In qmicli this translates
into needing to keep track of the CID in all qmicli calls until the
last qmicli call to the service is done without using
"--client-no-release-cid". But, hey, if you are able to keep track of
the CIDs of all the QMI clients you have allocated, including the one
for the WDS service, closing the WDS Client CID will also explicitly
disconnect the connection that was started with that client. So, I'd
suggest you try that; keeping track of the CIDs you've opened should
be something you're already doing anyway.
qmicli also supports yet another way of attempting this, which may
also fit your needs better, which is with the "--device-open-sync"
option. If you run e.g. qmicli -d /dev/cdc-wdm0 -p --device-open-sync
--dms-noop, a message is sent to the modem to "reset" all allocated
clients. But this is overkill, because I'm not sure the qmi-proxy will
cleanly handle that operation yet. If you kill the proxy right after
doing that, you may "start clean" again.
> And after that, how can I close all the qmicli related processes ?
Once all the client CIDs have been released, the qmi-proxy should
detect it and kill itself after some time without being used (300s).
There are 2 ways to modify this behavior: with --no-exit (to disable
the timeout) or with --empty-timeout=[SECS] to modify the default
timeout. The qmi-proxy is the only "qmicli related process" that may
be around.
--
Aleksander
https://aleksander.es
More information about the libqmi-devel
mailing list