From 05774c5d76ef92a14f892d3e35a2ce7afcaf2493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Storr=C3=B8?= Date: Wed, 25 Oct 2023 11:08:21 +0200 Subject: [PATCH] Bluetooth: Mesh: Fix unpacking of hb_pub status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes incorrect unpacking of Heartbeat Publication status messages on the Configuration client. Reference to packing format: MshPRTv1.1 section 4.3.2.63 Signed-off-by: Anders Storrø --- subsys/bluetooth/mesh/cfg_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/cfg_cli.c b/subsys/bluetooth/mesh/cfg_cli.c index c9f4f98f39d..7ee3a590cd0 100644 --- a/subsys/bluetooth/mesh/cfg_cli.c +++ b/subsys/bluetooth/mesh/cfg_cli.c @@ -950,8 +950,8 @@ static int hb_pub_status(struct bt_mesh_model *model, pub.count = net_buf_simple_pull_u8(buf); pub.period = net_buf_simple_pull_u8(buf); pub.ttl = net_buf_simple_pull_u8(buf); - pub.feat = net_buf_simple_pull_u8(buf); - pub.net_idx = net_buf_simple_pull_u8(buf); + pub.feat = net_buf_simple_pull_le16(buf); + pub.net_idx = net_buf_simple_pull_le16(buf) & 0xfff; if (bt_mesh_msg_ack_ctx_match(&cli->ack_ctx, OP_HEARTBEAT_PUB_STATUS, ctx->addr, (void **)¶m)) {