mirror of https://github.com/ARMmbed/mbed-os.git
Cellular: fixed defect where SIM interface was closed too early causing crash with certain configurations.
parent
e8005f6d72
commit
1a60422b74
|
@ -436,8 +436,6 @@ void CellularConnectionFSM::state_sim_pin()
|
|||
retry_state_or_fail();
|
||||
return;
|
||||
}
|
||||
_cellularDevice->close_sim();
|
||||
_sim = NULL;
|
||||
if (_plmn) {
|
||||
enter_to_state(STATE_MANUAL_REGISTERING_NETWORK);
|
||||
} else {
|
||||
|
@ -485,6 +483,8 @@ void CellularConnectionFSM::state_attaching()
|
|||
{
|
||||
_cellularDevice->set_timeout(TIMEOUT_CONNECT);
|
||||
if (_network->set_attach() == NSAPI_ERROR_OK) {
|
||||
_cellularDevice->close_sim();
|
||||
_sim = NULL;
|
||||
enter_to_state(STATE_ACTIVATING_PDP_CONTEXT);
|
||||
} else {
|
||||
retry_state_or_fail();
|
||||
|
|
|
@ -117,9 +117,9 @@ public:
|
|||
*/
|
||||
CellularDevice *get_device();
|
||||
|
||||
/** Get cellular sim interface. SIM interface is released after SIM is open and ready for use (moving from STATE_SIM_PIN to next state).
|
||||
* After SIM interface is closed this method will return NULL. SIM interface can be created again via CellularDevice
|
||||
* which you can get with the method get_device().
|
||||
/** Get cellular sim interface. SIM interface is released when moving from STATE_ATTACHING_NETWORK to STATE_ACTIVATING_PDP_CONTEXT.
|
||||
* After SIM interface is closed this method will return NULL and any instances fetched via this method are invalid.
|
||||
* SIM interface can be created again via CellularDevice which you can get with the method get_device().
|
||||
* @return sim interface, NULL on failure
|
||||
*/
|
||||
CellularSIM *get_sim();
|
||||
|
|
Loading…
Reference in New Issue