Detecting SIM REFRESH events
Teijo Kinnunen
teijo.kinnunen at uros.com
Wed Aug 5 11:04:16 UTC 2020
Hi,
Earlier this year, I contributed a feature to detect (e)SIM profile
switches on Quectel modems (commit d98597e43).
In our use case, we'd like to extend profile switch detection to a
larger selection of modems. In practice, this means detecting when a
REFRESH proactive command is invoked by the SIM card (as specified in
SGP.22). As far as I know, there's no generic way to do this (things
like ICCID polling would probably be too intrusive). But QMI should have
the required functionality, so at least this could be extended to
support QMI based modems that implement the required messages.
QMI has QMI_UIM_REFRESH_REGISTER/QMI_UIM_REFRESH_REGISTER_ALL messages
that can be used for subscribing events whenever a file on SIM needs
to be refreshed, after which the subscriber receives QMI_UIM_REFRESH_IND
when a file is changed. If this is applied e.g. to the EF containing
ICCID, profile switches should be reliably detectable.
So, basically, I suppose the following changes in MM/libqmi would be
needed to support this:
- libqmi: Support for the needed QMI_UIM messages.
- MM: On QMI based modems, attempt to register refresh events on init.
- MM: When a refresh event is received, trigger the SIM hot-swap logic
to cause complete refresh of the SIM state in MM.
I haven't yet tested this in practice (even at PoC level), but before
starting to work on this feature, I'd like to hear comments: does this
sound feasible and if things work well in practice, would the feature be
welcome to be merged to MM?
The underlying motivation here is that eSIM cards are increasingly being
used in IoT applications and as Linux is an important IoT SW platform,
we'd like them to work as smoothly as possible there. There remains
other work to be done, but getting profile switches to work as fluently
as possible would be a good starting point.
BR,
- Teijo
More information about the ModemManager-devel
mailing list