huawei: improve after-sim-unlock step with ^SIMST indications
Submitted by Aleksander Morgado
Assigned to ModemManager bug user
Description
Originally reported at: https://bugzilla.gnome.org/show_bug.cgi?id=719917 Please refer to the original bug report if more details are needed.
The Huawei plugin has already a "after-sim-unlock" step subclassed, which just waits 3s after a SIM unlock before going on with the initialization sequence (e.g. loading own numbers).
Some modems, like the Huawei K3520, may require even more time, though:
ModemManager[23814]: <debug>
[1386259522.612855] [mm-at-serial-port.c:436]
debug_log(): (ttyUSB2): --> 'AT+CNUM<CR>
'
ModemManager[23814]: <debug>
[1386259522.622586] [mm-at-serial-port.c:436]
debug_log(): (ttyUSB2): <-- '<CR>``<LF>
+CME ERROR: 14<CR>``<LF>
'
ModemManager[23814]: <debug>
[1386259522.622665] [mm-serial-parsers.c:364]
mm_serial_parser_v1_parse(): Got failure code 14: SIM busy
The after-sim-unlock step should be improved to make sure the SIM is fully initialized before going on; either looking for SIM busy errors or checking for "^SIMST: 1" indications.