Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/connectivity/bluetooth/api/mesh/shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ General configuration
``mesh reset-local``
--------------------

Reset the local mesh node to its initial unprovisioned state.
Reset the local mesh node to its initial unprovisioned state. This command will also clear the Configuration Database (CDB) if present.

Target
======
Expand Down
8 changes: 8 additions & 0 deletions subsys/bluetooth/mesh/shell/cfg_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ static int cmd_reset(const struct shell *sh, size_t argc, char *argv[])
return 0;
}

if (IS_ENABLED(CONFIG_BT_MESH_CDB)) {
struct bt_mesh_cdb_node *node = bt_mesh_cdb_node_get(bt_mesh_shell_target_ctx.dst);

if (node) {
bt_mesh_cdb_node_del(node, true);
}
}

shell_print(sh, "Remote node reset complete");

return 0;
Expand Down
3 changes: 3 additions & 0 deletions subsys/bluetooth/mesh/shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ static int cmd_init(const struct shell *sh, size_t argc, char *argv[])

static int cmd_reset(const struct shell *sh, size_t argc, char *argv[])
{
#if defined(CONFIG_BT_MESH_CDB)
bt_mesh_cdb_clear();
# endif
bt_mesh_reset();
shell_print(sh, "Local node reset complete");

Expand Down