Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/3] eir: Add support for parsing  DeviceID info
@ 2014-01-18 14:57 Szymon Janc
  2014-01-18 14:57 ` [PATCH 2/3] adapter: Add support for setting DID info from EIR Szymon Janc
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Szymon Janc @ 2014-01-18 14:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

---
 src/eir.c | 10 ++++++++++
 src/eir.h |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/src/eir.c b/src/eir.c
index 5f3f059..d85ac7e 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -223,6 +223,16 @@ void eir_parse(struct eir_data *eir, const uint8_t *eir_data, uint8_t eir_len)
 				break;
 			eir->randomizer = g_memdup(data, 16);
 			break;
+
+		case EIR_DEVICE_ID:
+			if (data_len < 8)
+				break;
+
+			eir->did_source = data[0] | (data[1] << 8);
+			eir->did_vendor = data[2] | (data[3] << 8);
+			eir->did_product = data[4] | (data[5] << 8);
+			eir->did_version = data[6] | (data[7] << 8);
+			break;
 		}
 
 		eir_data += field_len + 1;
diff --git a/src/eir.h b/src/eir.h
index 888f382..3fa1cb3 100644
--- a/src/eir.h
+++ b/src/eir.h
@@ -49,6 +49,10 @@ struct eir_data {
 	uint8_t *hash;
 	uint8_t *randomizer;
 	bdaddr_t addr;
+	uint16_t did_vendor;
+	uint16_t did_product;
+	uint16_t did_version;
+	uint16_t did_source;
 };
 
 void eir_data_free(struct eir_data *eir);
-- 
1.8.5.3


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

end of thread, other threads:[~2014-01-20  4:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-18 14:57 [PATCH 1/3] eir: Add support for parsing DeviceID info Szymon Janc
2014-01-18 14:57 ` [PATCH 2/3] adapter: Add support for setting DID info from EIR Szymon Janc
2014-01-18 14:57 ` [PATCH 3/3] input: Add DualShock 4 detection Szymon Janc
2014-01-18 15:05   ` David Herrmann
2014-01-18 15:13     ` Szymon Janc
2014-01-20  4:37       ` Frank Praznik
2014-01-18 19:09 ` [PATCH 1/3] eir: Add support for parsing DeviceID info Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox