Skip to content

Commit 2c86d82

Browse files
Johan HedbergAnas Nashif
authored andcommitted
Bluetooth: Mesh: Fix zeroing heartbeat state
The values all need to be zeroed when heartbeat subscription is disabled. This makes it possible to pass MESH/NODE/CFG/HBS/BV-01-C. Signed-off-by: Johan Hedberg <[email protected]>
1 parent 84286b6 commit 2c86d82

File tree

1 file changed

+4
-2
lines changed
  • subsys/bluetooth/host/mesh

1 file changed

+4
-2
lines changed

subsys/bluetooth/host/mesh/cfg.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,18 +2820,20 @@ static void heartbeat_sub_set(struct bt_mesh_model *model,
28202820
sub_period == 0x00) {
28212821
cfg->hb_sub.src = BT_MESH_ADDR_UNASSIGNED;
28222822
cfg->hb_sub.dst = BT_MESH_ADDR_UNASSIGNED;
2823+
cfg->hb_sub.min_hops = 0;
2824+
cfg->hb_sub.max_hops = 0;
28232825
period_ms = 0;
28242826
} else {
28252827
cfg->hb_sub.src = sub_src;
28262828
cfg->hb_sub.dst = sub_dst;
2829+
cfg->hb_sub.min_hops = 0x7f;
2830+
cfg->hb_sub.max_hops = 0;
28272831
period_ms = hb_pwr2(sub_period, 1) * 1000;
28282832
}
28292833

28302834
BT_DBG("period_ms %u", period_ms);
28312835

28322836
cfg->hb_sub.count = 0;
2833-
cfg->hb_sub.min_hops = 0x7f;
2834-
cfg->hb_sub.max_hops = 0;
28352837

28362838
if (period_ms) {
28372839
cfg->hb_sub.expiry = k_uptime_get() + period_ms;

0 commit comments

Comments
 (0)