Skip to content

Commit

Permalink
net: nrf_provisioning: Add kconfig to save the command id
Browse files Browse the repository at this point in the history
Add new kconfig NRF_PROVISIONING_SAVE_CMD_ID. When enabled
the latest command id is saved to storage after successful
Finished command.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
  • Loading branch information
juhaylinen authored and rlubos committed Jul 7, 2023
1 parent 3c20df6 commit 7b19292
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions subsys/net/lib/nrf_provisioning/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ config NRF_PROVISIONING_WITH_CERT
help
Includes the root certificate used by the server side and provisions it if needed.

config NRF_PROVISIONING_SAVE_CMD_ID
bool "Save the latest command id to storage"
help
Saves the latest command id to storage after successful Finished command.

rsource "Kconfig.nrf_provisioning_http"

rsource "Kconfig.nrf_provisioning_at"
Expand Down
5 changes: 4 additions & 1 deletion subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,10 @@ int nrf_provisioning_req(void)
LOG_ERR("Provisioning failed, error: %d", ret);
} else if (ret > 0) {
/* Provisioning finished */
commit_latest_cmd_id();
if (IS_ENABLED(CONFIG_NRF_PROVISIONING_SAVE_CMD_ID)) {
LOG_DBG("Saving the latest command id");
commit_latest_cmd_id();
}
dm.cb(dm.user_data);
}

Expand Down

0 comments on commit 7b19292

Please sign in to comment.