Fixed state machine to accept roaming as valid registration.

pull/6496/head
Teppo Järvelin 2018-03-28 10:25:11 +03:00
parent c82fd31735
commit dcdb7a5da2
1 changed files with 6 additions and 3 deletions

View File

@ -570,9 +570,12 @@ void CellularConnectionFSM::network_callback(nsapi_event_t ev, intptr_t ptr)
{ {
tr_info("FSM: network_callback called with event: %d, intptr: %d", ev, ptr); tr_info("FSM: network_callback called with event: %d, intptr: %d", ev, ptr);
if ((cellular_connection_status_t)ev == CellularRegistrationStatusChanged && ptr == CellularNetwork::RegisteredHomeNetwork && _state == STATE_REGISTERING_NETWORK) { if ((cellular_connection_status_t)ev == CellularRegistrationStatusChanged && _state == STATE_REGISTERING_NETWORK) {
_queue.cancel(_eventID); // expect packet data so only these states are valid
continue_from_state(STATE_ATTACHING_NETWORK); if (ptr == CellularNetwork::RegisteredHomeNetwork && CellularNetwork::RegisteredRoaming) {
_queue.cancel(_eventID);
continue_from_state(STATE_ATTACHING_NETWORK);
}
} }
if (_event_status_cb) { if (_event_status_cb) {