mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #10375 from AriParkkila/cell-context-cleanup
Cellular: Fix to delete PDP context on disconnectpull/10386/head
commit
b2b2fcea7b
|
@ -687,6 +687,10 @@ nsapi_error_t AT_CellularContext::disconnect()
|
||||||
{
|
{
|
||||||
tr_info("CellularContext disconnect()");
|
tr_info("CellularContext disconnect()");
|
||||||
if (!_nw || !_is_connected) {
|
if (!_nw || !_is_connected) {
|
||||||
|
if (_new_context_set) {
|
||||||
|
delete_current_context();
|
||||||
|
}
|
||||||
|
_cid = -1;
|
||||||
return NSAPI_ERROR_NO_CONNECTION;
|
return NSAPI_ERROR_NO_CONNECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,6 +720,11 @@ nsapi_error_t AT_CellularContext::disconnect()
|
||||||
// call device's callback, it will broadcast this to here (cellular_callback)
|
// call device's callback, it will broadcast this to here (cellular_callback)
|
||||||
_device->cellular_callback(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, NSAPI_STATUS_DISCONNECTED, this);
|
_device->cellular_callback(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, NSAPI_STATUS_DISCONNECTED, this);
|
||||||
|
|
||||||
|
if (_new_context_set) {
|
||||||
|
delete_current_context();
|
||||||
|
}
|
||||||
|
_cid = -1;
|
||||||
|
|
||||||
return _at.unlock_return_error();
|
return _at.unlock_return_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue