linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] Fix parsing composition data for custom models
@ 2017-11-30 20:47 Michal Hobot
  2017-11-30 21:19 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Hobot @ 2017-11-30 20:47 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org

Custom model ids consist of model id and vendor id. Instead, vendor id =
was used twice to build model id.
---
 mesh/node.c    | 2 +-
 mesh/prov-db.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesh/node.c b/mesh/node.c
index 3c206dc36..b906754ae 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -432,7 +432,7 @@ bool node_parse_composition(struct mesh_node *node, =
uint8_t *data, uint16_t len)
 			len -=3D 2;
 		}
 		while (len >=3D 4 && v--) {
-			mod_id =3D get_le16(data);
+			mod_id =3D get_le16(data + 2);
 			vendor_id =3D get_le16(data);
 			mod_id |=3D (vendor_id << 16);
 			if (!node_set_model(node, ele->index, mod_id))
diff --git a/mesh/prov-db.c b/mesh/prov-db.c
index a012ef865..9add3f7c3 100644
--- a/mesh/prov-db.c
+++ b/mesh/prov-db.c
@@ -676,7 +676,7 @@ bool prov_db_add_node_composition(struct mesh_node =
*node, uint8_t *data,
 		}
=20
 		while (len >=3D 4 && v--) {
-			mod_id =3D get_le16(data);
+			mod_id =3D get_le16(data + 2);
 			vendor_id =3D get_le16(data);
 			mod_id |=3D (vendor_id << 16);
 			data +=3D 4;
--=20
2.13.6 (Apple Git-96)



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ] Fix parsing composition data for custom models
  2017-11-30 20:47 [PATCH BlueZ] Fix parsing composition data for custom models Michal Hobot
@ 2017-11-30 21:19 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2017-11-30 21:19 UTC (permalink / raw)
  To: Michal Hobot; +Cc: linux-bluetooth@vger.kernel.org

Hi Michal,

On Thu, Nov 30, 2017, Michal Hobot wrote:
> Custom model ids consist of model id and vendor id. Instead, vendor id
> was used twice to build model id.
> ---
>  mesh/node.c    | 2 +-
>  mesh/prov-db.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-30 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-30 20:47 [PATCH BlueZ] Fix parsing composition data for custom models Michal Hobot
2017-11-30 21:19 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).