Skip to content

Commit

Permalink
Bluetooth: Mesh: fix NO_ACTIONS scheduling
Browse files Browse the repository at this point in the history
If the Scheduler Setup Server receives a Scheduler Action Set message
setting the next scheduled task to NO_ACTIONS, it will schedule the
next task in line.

Previously, the "canceled" task would be executed if it was first in
line.

Signed-off-by: Håvard Reierstad <[email protected]>
  • Loading branch information
HaavardRei committed Jan 23, 2025
1 parent f36abd1 commit e5db06a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions subsys/bluetooth/mesh/scheduler_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,12 @@ static int action_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx
run_scheduler(srv);
}

/* If the next scheduled action is set to "NO_ACTIONS", cancel it. */
if ((srv->sch_reg[idx].action == BT_MESH_SCHEDULER_NO_ACTIONS) && (srv->idx == idx)) {
WRITE_BIT(srv->active_bitmap, idx, 0);
run_scheduler(srv);
}

if (srv->action_set_cb) {
srv->action_set_cb(srv, ctx, idx, &srv->sch_reg[idx]);
}
Expand Down

0 comments on commit e5db06a

Please sign in to comment.