disconnect

fdbsdfb dsfbsdfb irene_sx at hotmail.com
Sun Apr 5 23:59:26 UTC 2020


Thankyou, and sorry for the late answer.

I don't think this should be a workaround, can you make new command for that ? Or maybe that the QMI protocol doesnt allow that ?
 Maybe you could make a command to return the last used handler and one for the last used cid ? because (I think) 70% of the users will only need to connect and disconnect one connection.

So in short, you sayd:
- 0xFFFFFFFF , will close one connection (in hexadecimal?).
- qmicli -d /dev/cdc-wdm0 -p --dms-set-operating-mode=low-power , will close all connections
- qmicli -d /dev/cdc-wdm0 -p --device-open-sync --dms-noop , will close all the clients

I tryed the second and the third, it works but I can't reconnect then. Afterall I didn't --empty-timeout=5 cause it says invalid command... So i think i havent restarted the proxy i think...
Thanks.

--- Original messagge ---

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20200405/e7bc6aab/attachment.htm>


More information about the libqmi-devel mailing list