Update SIM related data according to an event
Aleksander Morgado
aleksander at aleksander.es
Sun Mar 13 10:57:09 UTC 2016
On Sun, Mar 13, 2016 at 10:25 AM, Carlo Lobrano <c.lobrano at gmail.com> wrote:
> That looks like a lot of work :D, better design all the changes before
> starting.
Well, maybe not much work, but probably a bit hard to get the logic right.
> Brief recap
> 1. Put the modem in failed state
You may want to check what happens if you run
mm_base_modem_set_valid(FALSE) whenever the SIM is lost. That method
should flag the modem as invalid and reprobe from scratch, and that
will itself end up going into failed state.
> 2. Keep a port open when in failed state but with handlers still assigned to
> unsolicited
Only with the handler that you expect; not with all unsolicited
message handlers.
> 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?
That is equivalent to your step #2 above. When a modem starts without
SIM, it goes to Failed state right away. In your case, your Failed
state will be special, so that it really ends up keeping a port open
to monitor for the unsolicited messages you need.
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list