Skip to content

Commit 774e607

Browse files
SeppoTakalorlubos
authored andcommitted
samples: nrf9160: lwm2m_client: Don't load all settings on main.c
Separate submodules should register their own handler and load settings once they are ready to do so. Don't expect application to call settings_load(). Signed-off-by: Seppo Takalo <[email protected]>
1 parent 19a0cbf commit 774e607

File tree

2 files changed

+6
-3
lines changed
  • samples/nrf9160/lwm2m_client/src
  • subsys/net/lib/lwm2m_client_utils/fota

2 files changed

+6
-3
lines changed

samples/nrf9160/lwm2m_client/src/main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,6 @@ void main(void)
322322
ret = fota_settings_init();
323323
if (ret < 0) {
324324
LOG_WRN("Unable to init settings (%d)", ret);
325-
} else {
326-
/* Load *all* persistent settings */
327-
settings_load();
328325
}
329326
/* Modem FW update needs to be verified before modem is used. */
330327
lwm2m_verify_modem_fw_update();

subsys/net/lib/lwm2m_client_utils/fota/settings.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,11 @@ int fota_settings_init(void)
7979
return err;
8080
}
8181

82+
err = settings_load_subtree(fota_settings.name);
83+
if (err) {
84+
LOG_ERR("settings_load_subtree() failed, %d", err);
85+
return err;
86+
}
87+
8288
return 0;
8389
}

0 commit comments

Comments
 (0)