Thread (5 messages) 5 messages, 1 author, 2016-09-19

[PATCH 3/5] Bluetooth: Add appearance to Read Ext Controller Info command

flat view
STALE3687d

From: Szymon Janc <hidden>
Date: 2016-09-19 18:04:26
Subsystem: bluetooth subsystem, the rest · Maintainers: Marcel Holtmann, Luiz Augusto von Dentz, Linus Torvalds

If LE is enabled appearance is added to EIR data.

Signed-off-by: Michał Narajowski <redacted>
Signed-off-by: Szymon Janc <redacted>
---
 net/bluetooth/mgmt.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 2b6fe10..2c77c63 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -887,6 +887,13 @@ static u16 append_eir_data_to_buf(struct hci_dev *hdev, u8 *eir)
 		eir_len = eir_append_data(eir, eir_len, EIR_CLASS_OF_DEV,
 					  hdev->dev_class, 3);
 
+	if (hci_dev_test_flag(hdev, HCI_LE_ENABLED)) {
+		u16 appearance = cpu_to_le16(hdev->appearance);
+
+		eir_len = eir_append_data(eir, eir_len, EIR_APPEARANCE,
+					  (u8 *)&appearance, 2);
+	}
+
 	name_len = strlen(hdev->dev_name);
 	eir_len = eir_append_data(eir, eir_len, EIR_NAME_COMPLETE,
 				  hdev->dev_name, name_len);
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help