diff options
author | Alexander Yashin <yashin.alexander.42@gmail.com> | 2021-11-29 16:36:37 +0300 |
---|---|---|
committer | Alexander Yashin <alexandr.yashin@emlid.com> | 2021-12-13 13:20:39 +0300 |
commit | 2de0e8958985f40eac1c9ad84f75ae2d75f25e17 (patch) | |
tree | 08c1907ea6fdc9bb2f3e99cfe934dd5374d794b9 | |
parent | 029ea68ce4924dc235d7f3e91f48ec744dd78c1f (diff) |
plugins: ublox: bearer: SIM absence should not break disconnect
If we have a modem with an established connection, and then the
SIM is getting removed from that modem, this forces modem reprobing
sequence.
It looks like that:
```
mm-base-modem:mm_base_modem_process_sim_event
-> mm-base-modem:mm_base_modem_disable
-> mm-base-modem:disable
-> mm-broadband-modem:common_disable
-> mm-broadband-modem:disabling_step,
-> ctx->step=DISABLING_STEP_FIRST
-> ctx->step=DISABLING_STEP_WAIT_FOR_FINAL_STATE
-> ctx->step=DISABLING_STEP_DISCONNECT_BEARERS
```
At this stage, there is no actual connection existing already, but
bearer objects still exist and are still marked as connected.
So, if there were any active bearers - they will be disconnected.
In order to disconnect, ublox bearer sends +CGACT=0,%u, modem then
will return CME ERROR: 10(SIM not inserted):
```
[modem0/ttyACM0/at] --> 'AT+CGACT=0,1<CR>'
[modem0/ttyACM0/at] <-- '<CR><LF>+CME ERROR: 10<CR><LF>'
[modem0/ttyACM0/at] operation failure: 10 (SIM not inserted)
[modem0/bearer0] couldn't disconnect: SIM not inserted
```
this error will break disabling and reprobing. To fix that, it's
require to add 'SIM not inserted' state as a valid condition to
continue bearer disconnection.
-rw-r--r-- | plugins/ublox/mm-broadband-bearer-ublox.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/ublox/mm-broadband-bearer-ublox.c b/plugins/ublox/mm-broadband-bearer-ublox.c index daabdb2e..27db9b11 100644 --- a/plugins/ublox/mm-broadband-bearer-ublox.c +++ b/plugins/ublox/mm-broadband-bearer-ublox.c @@ -689,7 +689,8 @@ cgact_deactivate_ready (MMBaseModem *modem, */ if (!g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN) && !g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_LAST_PDN_DISCONNECTION_NOT_ALLOWED) && - !g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_LAST_PDN_DISCONNECTION_NOT_ALLOWED_LEGACY)) { + !g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_LAST_PDN_DISCONNECTION_NOT_ALLOWED_LEGACY) && + !g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED)) { g_task_return_error (task, error); g_object_unref (task); return; |