mesh: Fix Vendor Model Subscription Get procedure
Invalid argument was passed to bt_mesh_model_tree_walk. Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
This commit is contained in:
parent
addbdb0d00
commit
73e1cccdbb
1 changed files with 4 additions and 1 deletions
|
@ -1698,6 +1698,7 @@ static void mod_sub_get_vnd(struct bt_mesh_model *model,
|
||||||
struct net_buf_simple *buf)
|
struct net_buf_simple *buf)
|
||||||
{
|
{
|
||||||
NET_BUF_SIMPLE_DEFINE(msg, BT_MESH_TX_SDU_MAX);
|
NET_BUF_SIMPLE_DEFINE(msg, BT_MESH_TX_SDU_MAX);
|
||||||
|
struct mod_sub_list_ctx visit_ctx;
|
||||||
struct bt_mesh_model *mod;
|
struct bt_mesh_model *mod;
|
||||||
struct bt_mesh_elem *elem;
|
struct bt_mesh_elem *elem;
|
||||||
uint16_t company, addr, id;
|
uint16_t company, addr, id;
|
||||||
|
@ -1739,8 +1740,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, company);
|
||||||
net_buf_simple_add_le16(&msg, id);
|
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,
|
bt_mesh_model_tree_walk(bt_mesh_model_root(mod), mod_sub_list_visitor,
|
||||||
&msg);
|
&visit_ctx);
|
||||||
|
|
||||||
send_list:
|
send_list:
|
||||||
if (bt_mesh_model_send(model, ctx, &msg, NULL, NULL)) {
|
if (bt_mesh_model_send(model, ctx, &msg, NULL, NULL)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue