Bluetooth: mesh: Reset Heartbeat Pub timer before sending message
The timer should be reset before sending to ensure correct publication period. This patch allows to pass MESH/NODE/CFG/HBP/BV-02-C. This patch is ported from mynewt: Commit: d4b84638df47e7ea21629e6919f547f5dcd47285 Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
parent
812e2eaad2
commit
37122d7205
1 changed files with 6 additions and 6 deletions
|
@ -3057,20 +3057,20 @@ static void hb_publish(struct k_work *work)
|
|||
return;
|
||||
}
|
||||
|
||||
hb_send(model);
|
||||
|
||||
if (cfg->hb_pub.count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cfg->hb_pub.count != 0xffff) {
|
||||
cfg->hb_pub.count--;
|
||||
}
|
||||
|
||||
period_ms = hb_pwr2(cfg->hb_pub.period, 1) * 1000;
|
||||
if (period_ms) {
|
||||
k_delayed_work_submit(&cfg->hb_pub.timer, period_ms);
|
||||
}
|
||||
|
||||
hb_send(model);
|
||||
|
||||
if (cfg->hb_pub.count != 0xffff) {
|
||||
cfg->hb_pub.count--;
|
||||
}
|
||||
}
|
||||
|
||||
static bool conf_is_valid(struct bt_mesh_cfg_srv *cfg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue