<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi all,<br><br>last week I was working to handle a behavior that most of the Telit modem have, that is, they emit <i>#QSS</i> unsolicited in consequence of <i>+CFUN</i> commands. Most of the times, the modems are already in <i>+CFUN=1</i> at the start so we did not notice it in a normal power up, but if we put the modem in power low state, the <i>+CFUN=4</i> triggers a <i>#QSS=0</i> that the ModemManager considers as a SIM swap. Note that this is receved as soon as the modem is enabled again, because currently we release SIM swap ports while disabling the modem, and, if we set power state on, **<b>together with the #QSS=1 due to +CFUN=1</b>** causing a crash.<br><br>Generally speaking this behavior isn't wrong per se (a part from the crash, that can be fixed), because the SIM is actually turned off, but in this configuration we cannot re-enable the modem, while sending a <i>+CFUN=1</i> the modem would be usable again.<br><br>So, I made a couple of patches, (1) avoid releasing SIM swap ports on modem disable, so we can still receive SIM notifications at the right moment, and (2) ignore QSS unsolicited when changing <i>+CFUN</i> state and only for a short amount of time.
The problem is that there isn't a specific timeout within which this unsolicited must arrive and according to my tests it is quite variable (about between 3 and 10 seconds).<br><br>One solution is then to ignore <i>#QSS</i> for like 10 seconds, while the other one is to keep ignoring them in the whole time between <i>+CFUN=4</i> and<i> +CFUN=1</i>. This last solution is more consistent, but it won't let us get SIM removal/insertion when the modem is in power-state-low.<br><br>I'd like to know your opinion about this.
Thank you!<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Carlo<br></div></div>