<p dir="ltr">Thanks a lot! I'll have a look at that</p>
<p dir="ltr">Carlo</p>
<br><div class="gmail_quote"><div dir="ltr">Il dom 13 mar 2016 11:57 AM Aleksander Morgado <<a href="mailto:aleksander@aleksander.es">aleksander@aleksander.es</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Mar 13, 2016 at 10:25 AM, Carlo Lobrano <<a href="mailto:c.lobrano@gmail.com" target="_blank">c.lobrano@gmail.com</a>> wrote:<br>
> That looks like a lot of work :D, better design all the changes before<br>
> starting.<br>
<br>
Well, maybe not much work, but probably a bit hard to get the logic right.<br>
<br>
> Brief recap<br>
> 1. Put the modem in failed state<br>
<br>
You may want to check what happens if you run<br>
mm_base_modem_set_valid(FALSE) whenever the SIM is lost. That method<br>
should flag the modem as invalid and reprobe from scratch, and that<br>
will itself end up going into failed state.<br>
<br>
> 2. Keep a port open when in failed state but with handlers still assigned to<br>
> unsolicited<br>
<br>
Only with the handler that you expect; not with all unsolicited<br>
message handlers.<br>
<br>
> 3. start a full reprobe<br>
><br>
> Another problem I saw is that when the SIM is not inserted from the start,<br>
> the modem is not initialized at all, so I cannot even set an handler to<br>
> watch for unsolicited events. Do you think that is something that can be<br>
> changed?<br>
<br>
That is equivalent to your step #2 above. When a modem starts without<br>
SIM, it goes to Failed state right away. In your case, your Failed<br>
state will be special, so that it really ends up keeping a port open<br>
to monitor for the unsolicited messages you need.<br>
<br>
--<br>
Aleksander<br>
<a href="https://aleksander.es" rel="noreferrer" target="_blank">https://aleksander.es</a><br>
</blockquote></div>