Skip to content

Commit 5941abc

Browse files
committed
main: fix state handling in main
Persist state if the device connects/disconnects when FOTA fails before the download is marked as failed. This will ensure that main returns to the correct state after a reconnect. Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
1 parent 1e8d76e commit 5941abc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

app/src/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,10 @@ static enum smf_state_result fota_run(void *o)
15151515
case STATE_BUFFER_DISCONNECTED:
15161516
state_object->running_history = STATE_BUFFER_CONNECTED;
15171517

1518+
break;
1519+
case STATE_PASSTHROUGH_DISCONNECTED:
1520+
state_object->running_history = STATE_PASSTHROUGH_CONNECTED_SAMPLING;
1521+
15181522
break;
15191523
case STATE_PASSTHROUGH_CONNECTED_SAMPLING:
15201524
__fallthrough;

0 commit comments

Comments
 (0)