Skip to content

Commit

Permalink
Bluetooth: Mesh: Fix recall in light_ctrl_srv
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
HaavardRei authored and nordicjm committed Nov 1, 2024
1 parent 4acd63a commit a07804c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions subsys/bluetooth/mesh/light_ctrl_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,12 @@ static void timeout(struct k_work *work)
if (!is_enabled(srv)) {
if (srv->resume && atomic_test_and_clear_bit(&srv->flags, FLAG_RESUME_TIMER)) {
LOG_DBG("Resuming LC server");
if (IS_ENABLED(CONFIG_BT_MESH_SCENE_SRV)) {
/* Resuming the LC server invalidates the current scene as it takes
* control over states that are stored with the scene.
*/
bt_mesh_scene_invalidate(srv->model);
}
ctrl_enable(srv);
store(srv, FLAG_STORE_STATE);
}
Expand Down

0 comments on commit a07804c

Please sign in to comment.