Skip to content

Commit 8c2f5d3

Browse files
Juha Heiskanencarlescufi
authored andcommitted
net: lwm2m: RD Client bootstrap trigger update
Accept now from bootstrap trigger from any state expect ongoing bootstrap process. Free also possible on going RD client message. There was a chance that update message response change state and bootstrap proces not started. Signed-off-by: Juha Heiskanen <[email protected]>
1 parent 7cee4cf commit 8c2f5d3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

subsys/net/lib/lwm2m/lwm2m_rd_client.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,18 +411,20 @@ int engine_trigger_bootstrap(void)
411411
{
412412
#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
413413
k_mutex_lock(&client.mutex, K_FOREVER);
414-
if (!sm_is_registered()) {
414+
415+
if (client.use_bootstrap) {
415416
/* Bootstrap is not possible to trig */
416-
LOG_WRN("Cannot trigger bootstrap from state %u", client.engine_state);
417+
LOG_WRN("Bootstrap process ongoing");
417418
k_mutex_unlock(&client.mutex);
418419
return -EPERM;
419420
}
420-
421421
LOG_INF("Server Initiated Bootstrap");
422+
/* Free ongoing possible message */
423+
rd_client_message_free();
422424
client.use_bootstrap = true;
425+
client.trigger_update = false;
423426
client.engine_state = ENGINE_INIT;
424427
k_mutex_unlock(&client.mutex);
425-
426428
return 0;
427429
#else
428430
return -EPERM;

0 commit comments

Comments
 (0)