Bluetooth: mesh: Check Heartbeat Pub count prior scheduling delayed work

This check is needed to not schedule the delayed work if current
message to be sent is the last heartbeat message.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
Mariusz Skamra 2018-01-19 11:55:06 +01:00 committed by Johan Hedberg
commit 0572fe99ec

View file

@ -3062,7 +3062,7 @@ static void hb_publish(struct k_work *work)
}
period_ms = hb_pwr2(cfg->hb_pub.period, 1) * 1000;
if (period_ms) {
if (period_ms && cfg->hb_pub.count > 1) {
k_delayed_work_submit(&cfg->hb_pub.timer, period_ms);
}