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 <johan.hedberg@intel.com>
This commit is contained in:
parent
ea397170d3
commit
f1638e0a2b
1 changed files with 4 additions and 2 deletions
|
@ -2820,18 +2820,20 @@ static void heartbeat_sub_set(struct bt_mesh_model *model,
|
||||||
sub_period == 0x00) {
|
sub_period == 0x00) {
|
||||||
cfg->hb_sub.src = BT_MESH_ADDR_UNASSIGNED;
|
cfg->hb_sub.src = BT_MESH_ADDR_UNASSIGNED;
|
||||||
cfg->hb_sub.dst = BT_MESH_ADDR_UNASSIGNED;
|
cfg->hb_sub.dst = BT_MESH_ADDR_UNASSIGNED;
|
||||||
|
cfg->hb_sub.min_hops = 0;
|
||||||
|
cfg->hb_sub.max_hops = 0;
|
||||||
period_ms = 0;
|
period_ms = 0;
|
||||||
} else {
|
} else {
|
||||||
cfg->hb_sub.src = sub_src;
|
cfg->hb_sub.src = sub_src;
|
||||||
cfg->hb_sub.dst = sub_dst;
|
cfg->hb_sub.dst = sub_dst;
|
||||||
|
cfg->hb_sub.min_hops = 0x7f;
|
||||||
|
cfg->hb_sub.max_hops = 0;
|
||||||
period_ms = hb_pwr2(sub_period, 1) * 1000;
|
period_ms = hb_pwr2(sub_period, 1) * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
BT_DBG("period_ms %u", period_ms);
|
BT_DBG("period_ms %u", period_ms);
|
||||||
|
|
||||||
cfg->hb_sub.count = 0;
|
cfg->hb_sub.count = 0;
|
||||||
cfg->hb_sub.min_hops = 0x7f;
|
|
||||||
cfg->hb_sub.max_hops = 0;
|
|
||||||
|
|
||||||
if (period_ms) {
|
if (period_ms) {
|
||||||
cfg->hb_sub.expiry = k_uptime_get() + period_ms;
|
cfg->hb_sub.expiry = k_uptime_get() + period_ms;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue