Skip to content

Commit

Permalink
sample: lwm2m_client: Rd client start and disconnect fix
Browse files Browse the repository at this point in the history
Replased Client state machine to use a proper function which
release proper lock and trig a new state.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
  • Loading branch information
Juha Heiskanen authored and rlubos committed Aug 30, 2023
1 parent 462c8d8 commit fbd637d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samples/cellular/lwm2m_client/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static void rd_client_event(struct lwm2m_ctx *client, enum lwm2m_rd_client_event
case LWM2M_RD_CLIENT_EVENT_DISCONNECT:
LOG_DBG("Disconnected");
if (client_state != UPDATE_FIRMWARE) {
state_set_and_unlock(START);
state_trigger_and_unlock(START);
} else {
k_mutex_unlock(&lte_mutex);
}
Expand Down Expand Up @@ -686,9 +686,9 @@ int main(void)
ret = lwm2m_rd_client_start(&client, endpoint_name, bootstrap_flags,
rd_client_event, NULL);
if (ret) {
state_set_and_unlock(NETWORK_ERROR);
state_trigger_and_unlock(NETWORK_ERROR);
} else {
state_set_and_unlock(CONNECTING);
state_trigger_and_unlock(CONNECTING);
}
break;

Expand Down

0 comments on commit fbd637d

Please sign in to comment.