File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
features/cellular/framework/AT Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -687,6 +687,10 @@ nsapi_error_t AT_CellularContext::disconnect()
687
687
{
688
688
tr_info (" CellularContext disconnect()" );
689
689
if (!_nw || !_is_connected) {
690
+ if (_new_context_set) {
691
+ delete_current_context ();
692
+ }
693
+ _cid = -1 ;
690
694
return NSAPI_ERROR_NO_CONNECTION;
691
695
}
692
696
@@ -716,6 +720,11 @@ nsapi_error_t AT_CellularContext::disconnect()
716
720
// call device's callback, it will broadcast this to here (cellular_callback)
717
721
_device->cellular_callback (NSAPI_EVENT_CONNECTION_STATUS_CHANGE, NSAPI_STATUS_DISCONNECTED, this );
718
722
723
+ if (_new_context_set) {
724
+ delete_current_context ();
725
+ }
726
+ _cid = -1 ;
727
+
719
728
return _at.unlock_return_error ();
720
729
}
721
730
You can’t perform that action at this time.
0 commit comments