Update SIM related data according to an event

Carlo Lobrano c.lobrano at gmail.com
Sun Mar 13 09:25:53 UTC 2016


That looks like a lot of work :D, better design all the changes before
starting.
Brief recap
1. Put the modem in failed state
2. Keep a port open when in failed state but with handlers still assigned
to unsolicited
3. start a full reprobe

Another problem I saw is that when the SIM is not inserted from the start,
the modem is not initialized at all, so I cannot even set an handler to
watch for unsolicited events. Do you think that is something that can be
changed?

Carlo

On Sat, 12 Mar 2016 at 21:17 Aleksander Morgado <aleksander at aleksander.es>
wrote:

> On Fri, Mar 11, 2016 at 5:21 PM, Carlo Lobrano <c.lobrano at gmail.com>
> wrote:
> > I'm trying to update some modem data according to an unsolicited event.
> >
> > Telit modems have an unsolicited indication #QSS (Query SIM Status)
> which is
> > emitted when the SIM status changes (e.g. SIM removed/inserted).
> >
> > My intention is to register an handler to this notification and somehow
> > trigger an update of the SIM related data when a #QSS event occurs, the
> > problem is how to update those data?
> >
> > I tried a bit with some "update" functions like
> > `mm_iface_modem_update_lock_info`, but since the SIM is not there anymore
> > those command fail and the data (e.g. sim locked status, unlocked
> retries,
> > etc.) do not change. Moreover, I tried with a modified version of
> > modem_load_unlock_retries that unset the value of the retries
> > (mm_unlock_retries_unset), but that doesn't seem to change the cached
> values
> > (mmcli -m 0 still reports the old valued of unlock retries).
> >
> > I think I am missing somenthing and/or that I need a more systematic
> > approach, like repeating the steps done when a modem is first
> initialized.
> > Is this possible?
>
> The current logic doesn't support SIM hot-swapping right away. What
> should be happening is that whenever a modem loses the SIM card, it
> should get disabled and then to moved to Failed state (i.e. still
> exposed with the same modem ID, all values reset in the ifaces and
> Failed state). Then, if the modem detects the SIM card again (MM
> should keep that unsolicited message watch), it should trigger a full
> re-probe from scratch. One key thing here is that MM doesn't keep a
> port open if the modem is disabled/failed; in your case you would need
> to do that to watch for #QSS. Another key thing is that if you trigger
> the full re-probe the modem would change the modem ID, but that
> shouldn't be an issue. All of this logic is not done, you'd need to
> change a lot of things in the core logic, but that's fine :) I do have
> a couple of modems which support hot swapping, so I could even test
> myself some of your changes if needed.
>
>
> --
> Aleksander
> https://aleksander.es
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20160313/dc44cf7f/attachment.html>


More information about the ModemManager-devel mailing list