Skip to content

Commit dcdb7a5

Browse files
author
Teppo Järvelin
committed
Fixed state machine to accept roaming as valid registration.
1 parent c82fd31 commit dcdb7a5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

features/cellular/easy_cellular/CellularConnectionFSM.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,12 @@ void CellularConnectionFSM::network_callback(nsapi_event_t ev, intptr_t ptr)
570570
{
571571

572572
tr_info("FSM: network_callback called with event: %d, intptr: %d", ev, ptr);
573-
if ((cellular_connection_status_t)ev == CellularRegistrationStatusChanged && ptr == CellularNetwork::RegisteredHomeNetwork && _state == STATE_REGISTERING_NETWORK) {
574-
_queue.cancel(_eventID);
575-
continue_from_state(STATE_ATTACHING_NETWORK);
573+
if ((cellular_connection_status_t)ev == CellularRegistrationStatusChanged && _state == STATE_REGISTERING_NETWORK) {
574+
// expect packet data so only these states are valid
575+
if (ptr == CellularNetwork::RegisteredHomeNetwork && CellularNetwork::RegisteredRoaming) {
576+
_queue.cancel(_eventID);
577+
continue_from_state(STATE_ATTACHING_NETWORK);
578+
}
576579
}
577580

578581
if (_event_status_cb) {

0 commit comments

Comments
 (0)