From 253e40ad0e80991ab5847ed63054bbff0ff01ef5 Mon Sep 17 00:00:00 2001 From: Mariusz Skamra Date: Thu, 4 Jan 2018 17:07:33 +0100 Subject: [PATCH] Bluetooth: mesh: Do not set RFU bits in Heartbeat Publication Features Features received in Config Heartbeat Publication Set message can have Feature bits set to RFU values. This patch fixes setting this RFU bits in Heartbeat Publication Features, so that those are not indicated in Config Heartbeat Publication Status message. Signed-off-by: Mariusz Skamra --- include/bluetooth/mesh/main.h | 4 ++++ subsys/bluetooth/host/mesh/cfg_srv.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/bluetooth/mesh/main.h b/include/bluetooth/mesh/main.h index 7ef0832ccbd..db1e68559fc 100644 --- a/include/bluetooth/mesh/main.h +++ b/include/bluetooth/mesh/main.h @@ -218,6 +218,10 @@ int bt_mesh_prov_disable(bt_mesh_prov_bearer_t bearers); #define BT_MESH_FEAT_PROXY BIT(1) #define BT_MESH_FEAT_FRIEND BIT(2) #define BT_MESH_FEAT_LOW_POWER BIT(3) +#define BT_MESH_FEAT_SUPPORTED (BT_MESH_FEAT_RELAY | \ + BT_MESH_FEAT_PROXY | \ + BT_MESH_FEAT_FRIEND | \ + BT_MESH_FEAT_LOW_POWER) /** @brief Initialize Mesh support * diff --git a/subsys/bluetooth/host/mesh/cfg_srv.c b/subsys/bluetooth/host/mesh/cfg_srv.c index 81edea7bb7c..31d2b9b0083 100644 --- a/subsys/bluetooth/host/mesh/cfg_srv.c +++ b/subsys/bluetooth/host/mesh/cfg_srv.c @@ -2797,7 +2797,7 @@ static void heartbeat_pub_set(struct bt_mesh_model *model, cfg->hb_pub.dst = dst; cfg->hb_pub.period = param->period_log; - cfg->hb_pub.feat = feat; + cfg->hb_pub.feat = feat & BT_MESH_FEAT_SUPPORTED; cfg->hb_pub.net_idx = idx; if (dst == BT_MESH_ADDR_UNASSIGNED) {