diff --git a/subsys/bluetooth/mesh/cfg_srv.c b/subsys/bluetooth/mesh/cfg_srv.c index 3d66db784ce..347c8bac770 100644 --- a/subsys/bluetooth/mesh/cfg_srv.c +++ b/subsys/bluetooth/mesh/cfg_srv.c @@ -1262,6 +1262,9 @@ static size_t mod_sub_list_clear(struct bt_mesh_model *mod) /* Unref stored labels related to this model */ for (i = 0, clear_count = 0; i < ARRAY_SIZE(mod->groups); i++) { if (mod->groups[i] != BT_MESH_ADDR_UNASSIGNED) { + if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER)) { + bt_mesh_lpn_group_del(&mod->groups[i], 1); + } mod->groups[i] = BT_MESH_ADDR_UNASSIGNED; clear_count++; } diff --git a/subsys/bluetooth/mesh/settings.c b/subsys/bluetooth/mesh/settings.c index 35ab1a7ee86..d91f615224c 100644 --- a/subsys/bluetooth/mesh/settings.c +++ b/subsys/bluetooth/mesh/settings.c @@ -32,6 +32,7 @@ #include "foundation.h" #include "proxy.h" #include "settings.h" +#include "lpn.h" /* Tracking of what storage changes are pending for App and Net Keys. We * track this in a separate array here instead of within the respective @@ -1097,6 +1098,16 @@ static void commit_mod(struct bt_mesh_model *mod, struct bt_mesh_elem *elem, k_delayed_work_submit(&mod->pub->timer, ms); } } + + if (!IS_ENABLED(CONFIG_BT_MESH_LOW_POWER)) { + return; + } + + for (int i = 0; i < ARRAY_SIZE(mod->groups); i++) { + if (mod->groups[i] != BT_MESH_ADDR_UNASSIGNED) { + bt_mesh_lpn_group_add(mod->groups[i]); + } + } } static int mesh_commit(void)