Cellular: fixed defect where SIM interface was closed too early causing crash with certain configurations.

pull/7275/head
Teppo Järvelin 2018-06-20 14:15:22 +03:00
parent e8005f6d72
commit 1a60422b74
2 changed files with 5 additions and 5 deletions

View File

@ -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();

View File

@ -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();