Skip to content

Commit

Permalink
Bluetooth: Mesh: Reset solicitation settings before calling reset cb
Browse files Browse the repository at this point in the history
Trigger erasing solicitation settings before calling
`bt_mesh_settings_store_pending` and `bt_mesh_prov.reset` callback.
The `bt_mesh_settings_store_pending` flushes every settings that is
pending to be erased. The `bt_mesh_prov.reset` callback must be called
as the last step because a user is free to do anything from this
callback including rebooting or reprovisioning the device.

Signed-off-by: Pavel Vasilyev <[email protected]>
  • Loading branch information
PavelVPV authored and fabiobaltieri committed Feb 7, 2024
1 parent ffa49a8 commit e495876
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions subsys/bluetooth/mesh/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,17 +401,17 @@ void bt_mesh_reset(void)

bt_mesh_comp_unprovision();

if (IS_ENABLED(CONFIG_BT_MESH_PROXY_SOLICITATION)) {
bt_mesh_sol_reset();
}

if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
bt_mesh_settings_store_pending();
}

if (IS_ENABLED(CONFIG_BT_MESH_PROV)) {
bt_mesh_prov_reset();
}

if (IS_ENABLED(CONFIG_BT_MESH_PROXY_SOLICITATION)) {
bt_mesh_sol_reset();
}
}

bool bt_mesh_is_provisioned(void)
Expand Down

0 comments on commit e495876

Please sign in to comment.