Skip to content

Commit a07804c

Browse files
HaavardReinordicjm
authored andcommitted
Bluetooth: Mesh: Fix recall in light_ctrl_srv
Previously, the scene recall was not working as expected in the following case: If a single scene is stored when the light is on, and then the light is dimmed/turned off by the controller, the current scene would not be invalidated and recalling the scene would do nothing. This commit fixes the issue by invalidating the current scene when the light controller is re-enabled as a result of the resume timeout. Signed-off-by: Håvard Reierstad <[email protected]>
1 parent 4acd63a commit a07804c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

subsys/bluetooth/mesh/light_ctrl_srv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,12 @@ static void timeout(struct k_work *work)
562562
if (!is_enabled(srv)) {
563563
if (srv->resume && atomic_test_and_clear_bit(&srv->flags, FLAG_RESUME_TIMER)) {
564564
LOG_DBG("Resuming LC server");
565+
if (IS_ENABLED(CONFIG_BT_MESH_SCENE_SRV)) {
566+
/* Resuming the LC server invalidates the current scene as it takes
567+
* control over states that are stored with the scene.
568+
*/
569+
bt_mesh_scene_invalidate(srv->model);
570+
}
565571
ctrl_enable(srv);
566572
store(srv, FLAG_STORE_STATE);
567573
}

0 commit comments

Comments
 (0)