From 19c304086f745161c59a98fdb8954e56c5d19340 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 28 Sep 2017 17:54:13 +0300 Subject: [PATCH] Bluetooth: Mesh: Fix resetting heartbeat subscription expiry properly Set the value clearly to 0 instead of letting the old expiry time stay around. Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/mesh/cfg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/host/mesh/cfg.c b/subsys/bluetooth/host/mesh/cfg.c index 36a694e1e14..02f573a966a 100644 --- a/subsys/bluetooth/host/mesh/cfg.c +++ b/subsys/bluetooth/host/mesh/cfg.c @@ -2837,6 +2837,8 @@ static void heartbeat_sub_set(struct bt_mesh_model *model, if (period_ms) { cfg->hb_sub.expiry = k_uptime_get() + period_ms; + } else { + cfg->hb_sub.expiry = 0; } hb_sub_send_status(model, ctx, STATUS_SUCCESS);