You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ry...@apache.org on 2020/09/15 06:41:47 UTC
[mynewt-nimble] 06/09: mesh/cfg_srv.c: Fix Vendor Model
Subscription Get procedure Invalid argument was passed to
bt_mesh_model_tree_walk.
This is an automated email from the ASF dual-hosted git repository.
rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 25dca96e0eb0a42c27d7e1bea83d45353b6bd880
Author: Krzysztof Kopyściński <kr...@codecoup.pl>
AuthorDate: Thu Sep 3 11:13:55 2020 +0200
mesh/cfg_srv.c: Fix Vendor Model Subscription Get procedure
Invalid argument was passed to bt_mesh_model_tree_walk.
---
nimble/host/mesh/src/cfg_srv.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/nimble/host/mesh/src/cfg_srv.c b/nimble/host/mesh/src/cfg_srv.c
index 57aac90..5cac1ad 100644
--- a/nimble/host/mesh/src/cfg_srv.c
+++ b/nimble/host/mesh/src/cfg_srv.c
@@ -1748,6 +1748,7 @@ static void mod_sub_get_vnd(struct bt_mesh_model *model,
struct os_mbuf *buf)
{
struct os_mbuf *msg = NET_BUF_SIMPLE(BT_MESH_TX_SDU_MAX);
+ struct mod_sub_list_ctx visit_ctx;
struct bt_mesh_model *mod;
struct bt_mesh_elem *elem;
u16_t company, addr, id;
@@ -1789,8 +1790,10 @@ static void mod_sub_get_vnd(struct bt_mesh_model *model,
net_buf_simple_add_le16(msg, company);
net_buf_simple_add_le16(msg, id);
+ visit_ctx.msg = msg;
+ visit_ctx.elem_idx = mod->elem_idx;
bt_mesh_model_tree_walk(bt_mesh_model_root(mod), mod_sub_list_visitor,
- msg);
+ &visit_ctx);
send_list:
if (bt_mesh_model_send(model, ctx, msg, NULL, NULL)) {