Skip to content

Commit fbd637d

Browse files
Juha Heiskanenrlubos
authored andcommitted
sample: lwm2m_client: Rd client start and disconnect fix
Replased Client state machine to use a proper function which release proper lock and trig a new state. Signed-off-by: Juha Heiskanen <[email protected]>
1 parent 462c8d8 commit fbd637d

File tree

1 file changed

+3
-3
lines changed
  • samples/cellular/lwm2m_client/src

1 file changed

+3
-3
lines changed

samples/cellular/lwm2m_client/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static void rd_client_event(struct lwm2m_ctx *client, enum lwm2m_rd_client_event
447447
case LWM2M_RD_CLIENT_EVENT_DISCONNECT:
448448
LOG_DBG("Disconnected");
449449
if (client_state != UPDATE_FIRMWARE) {
450-
state_set_and_unlock(START);
450+
state_trigger_and_unlock(START);
451451
} else {
452452
k_mutex_unlock(&lte_mutex);
453453
}
@@ -686,9 +686,9 @@ int main(void)
686686
ret = lwm2m_rd_client_start(&client, endpoint_name, bootstrap_flags,
687687
rd_client_event, NULL);
688688
if (ret) {
689-
state_set_and_unlock(NETWORK_ERROR);
689+
state_trigger_and_unlock(NETWORK_ERROR);
690690
} else {
691-
state_set_and_unlock(CONNECTING);
691+
state_trigger_and_unlock(CONNECTING);
692692
}
693693
break;
694694

0 commit comments

Comments
 (0)