SIM Switching using mmcli

Jessy Exum jessy.diamondman at gmail.com
Wed Jan 6 06:02:38 UTC 2021


There are others here who can give better answers, but I have interest in
supporting sim switching in ModemManager, and I am awake, so I will try to
contribute.

I believe ModemManager uses libqmi in the same way that qmicli does, so I
suspect that if qmicli can do it, that ModemManager should be capable of
accessing those same functions. Since mmcli (and all other MM clients) can
do anything that ModemManager's API exposes, we need to add some functions
to the dbs API (at the very least) to make MM truly support it.

If we want to just list which sim slots are available, that would be easy.
I don't know if most modems with multiple SIM slots let you read the data
from non active SIMs, or if it only reports which slots have a card
inserted. If we can get all the card data on at least some modems, that
would be interesting, and we might be able to reuse the MMSim data
structure, but I do not know if there are any issues in exporting a dbus
through multiple properties on the same object (I assume it will be fine),
or if there are some other dbus/gobject limitations/conventions that would
make us make a new object to track extra SIM cards.

As for actually switching the active SIM, it should not be hard to just add
a few functions to set the current SIM slot, but there will probably be
debate about how to do it. Currently, a MMModem object has either zero or
one SIM cards EVER in its lifecycle. Changing the SIM on an existing
MMModem is not supported, and adding support to do this would cause a lot
of problems without a thorough rethinking of several assumptions, plus many
code changes. An alternate strategy would be to change the active SIM slot
and then trigger the SIM hot swap logic, which will destroy the current
MMModem, and create+initialize a new MMModem object for the same physical
modem. This does mean that the modem ID would change, so your application
code would need to be able to handle that. This is the plan I was expecting
to use when I start supporting multiple SIM cards on a product line I am
working with.

If you are in a hurry and it takes too long for people here to agree on an
idea, or to implement that more correct solution, I would suggest you make
a personal patch that implements/exports just the features you need. It
would likely not be merged into master, but that would get you going until
a better solution is implemented.

Jessy Diamond Exum


On Tue, Jan 5, 2021 at 9:01 PM Nick B <nickberry17 at icloud.com> wrote:

> Hey,
>
> I would like to add support for SIM switching to ModemManager.proto for
> OpenWrt, but the only way to achieve this currently (AFAIK) is by using
> qmicli --sim-switch-slot. I have it working by calling qmicli, but is it
> possible to do it without depending on qmicli?  If not, would there there
> be any plans to make it possible to select the SIM slot via mmcli?
>
> Best,
> Nick
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20210105/1070f5a3/attachment.htm>


More information about the ModemManager-devel mailing list