Skip to content

Commit fe34ed0

Browse files
fahimalaviadbridge
authored andcommitted
Bux fix: Context can be cleared using CGDCONT after sim ready state
1 parent 59209d2 commit fe34ed0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

features/cellular/framework/device/CellularStateMachine.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ bool CellularStateMachine::open_sim()
165165
bool sim_ready = state == CellularDevice::SimStateReady;
166166

167167
if (sim_ready) {
168+
#ifdef MBED_CONF_CELLULAR_CLEAR_ON_CONNECT
169+
if (_cellularDevice.clear() != NSAPI_ERROR_OK) {
170+
tr_warning("CellularDevice clear failed");
171+
return false;
172+
}
173+
#endif
168174
_cb_data.error = _network.set_registration(_plmn);
169175
tr_debug("STM: set_registration: %d, plmn: %s", _cb_data.error, _plmn ? _plmn : "NULL");
170176
if (_cb_data.error) {
@@ -395,7 +401,6 @@ void CellularStateMachine::state_sim_pin()
395401
retry_state_or_fail();
396402
return;
397403
}
398-
399404
if (_network.is_active_context()) { // check if context was already activated
400405
tr_debug("Active context found.");
401406
_status |= ACTIVE_PDP_CONTEXT;

0 commit comments

Comments
 (0)