Merge pull request #13610 from boraozgen/bugfix/deactivate-context

Fix #13490 Cellular disconnect does not deactivate context
pull/13768/head
Martin Kojtal 2020-10-13 11:22:33 +01:00 committed by GitHub
commit 05489818e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -544,6 +544,7 @@ nsapi_error_t AT_CellularContext::find_and_activate_context()
delete_current_context(); delete_current_context();
} else if (err == NSAPI_ERROR_OK) { } else if (err == NSAPI_ERROR_OK) {
_is_context_active = true; _is_context_active = true;
_is_context_activated = true;
} }
_at.unlock(); _at.unlock();
@ -755,8 +756,9 @@ void AT_CellularContext::check_and_deactivate_context()
rat = reg_params._act; rat = reg_params._act;
// 3GPP TS 27.007: // 3GPP TS 27.007:
// For EPS, if an attempt is made to disconnect the last PDN connection, then the MT responds with ERROR // For EPS, if an attempt is made to disconnect the last PDN connection, then the MT responds with ERROR
if (_is_context_active && (rat < CellularNetwork::RAT_E_UTRAN || active_contexts_count > 1)) { if (_is_context_active && (rat < CellularNetwork::RAT_E_UTRAN || rat == CellularNetwork::RAT_NB1 || active_contexts_count > 1)) {
_at.clear_error(); _at.clear_error();
deactivate_context(); deactivate_context();
} }