Skip to content

Cellular: fixed defect where SIM interface was closed too early #7275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions features/cellular/easy_cellular/CellularConnectionFSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions features/cellular/easy_cellular/CellularConnectionFSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ class CellularConnectionFSM
*/
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 returns NULL, and any instances fetched using this method are invalid.
* SIM interface can be created again using CellularDevice, which you can get with the method get_device().
* @return sim interface, NULL on failure
*/
CellularSIM *get_sim();
Expand Down