Skip to content
Closed
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: 3 additions & 1 deletion app/src/modules/cloud/cloud.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,10 @@ static void handle_priv_cloud_message(struct cloud_state_object const *state_obj
{
enum priv_cloud_msg msg = *(const enum priv_cloud_msg *)state_object->msg_buf;

if (msg == CLOUD_SEND_REQUEST_FAILED) {
if ((msg == CLOUD_SEND_REQUEST_FAILED) && (state_object->network_connected)) {
smf_set_state(SMF_CTX(state_object), &states[STATE_CONNECTING]);
} else if ((msg == CLOUD_SEND_REQUEST_FAILED) && (!state_object->network_connected)) {
smf_set_state(SMF_CTX(state_object), &states[STATE_DISCONNECTED]);
}
}

Expand Down
3 changes: 2 additions & 1 deletion tests/state_machines/source_of_truth/cloud.puml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ state STATE_RUNNING {
[*] --> STATE_CONNECTED_READY

STATE_CONNECTED_READY --> STATE_CONNECTED_PAUSED : NETWORK_DISCONNECTED
STATE_CONNECTED_READY --> STATE_CONNECTING : CLOUD_SEND_REQUEST_FAILED
STATE_CONNECTED_READY --> STATE_CONNECTING : CLOUD_SEND_REQUEST_FAILED && network_connected
STATE_CONNECTED_READY --> STATE_DISCONNECTED : CLOUD_SEND_REQUEST_FAILED && !network_connected
STATE_CONNECTED_READY --> STATE_PROVISIONING : CLOUD_PROVISIONING_REQUEST
STATE_CONNECTED_PAUSED --> STATE_CONNECTED_READY : NETWORK_CONNECTED
}
Expand Down
Loading