Bluetooth: mesh: Change cfg_cli buffer length check

Changed buffer length check in bt_mesh_comp_p1_elem_pull.
The previous threshold would result in the
method not detecting the final element when it consisted of just one
model.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
This commit is contained in:
Håvard Reierstad 2023-10-09 08:28:26 +02:00 committed by Johan Hedberg
commit ea753eb52a

View file

@ -2320,7 +2320,7 @@ struct bt_mesh_mod_id_vnd bt_mesh_comp_p0_elem_mod_vnd(struct bt_mesh_comp_p0_el
struct bt_mesh_comp_p1_elem *bt_mesh_comp_p1_elem_pull(struct net_buf_simple *buf, struct bt_mesh_comp_p1_elem *bt_mesh_comp_p1_elem_pull(struct net_buf_simple *buf,
struct bt_mesh_comp_p1_elem *elem) struct bt_mesh_comp_p1_elem *elem)
{ {
if (buf->len < 6) { if (buf->len < 4) {
LOG_DBG("No more elements to pull or missing data"); LOG_DBG("No more elements to pull or missing data");
return NULL; return NULL;
} }