Skip to contentSkip to conversation

Bluetooth: Read LE remote features during connection establishment

PATCH Superseded Marcel Holtmann 1 participant 1 message Apr 8, 2015

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH v2 1/1 Bluetooth: Read LE remote features during connection establishment

When establishing a Bluetooth LE connection, read the remote used features mask to determine which features are supported. This was not really needed with Bluetooth 4.0, but since Bluetooth 4.1 and also 4.2 have introduced new optional features, this becomes more important.

This works the same as with BR/EDR where the connection enters the BT_CONFIG stage and hci_connect_cfm call is delayed until the remote features have been retrieved. Only after successfully receiving the remote features, the connection enters the BT_CONNECTED state.

---
 include/net/bluetooth/hci.h | 12 +++++++
 net/bluetooth/hci_event.c   | 87 +++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 97 insertions(+), 2 deletions(-)
include/net/bluetooth/hci.h +12 -0
index 2f8c830e600c..cb568ecc43a5 100644
@@ -1376,6 +1376,11 @@ struct hci_cp_le_conn_update {
 	__le16   max_ce_len;
 } __packed;
 
+#define HCI_OP_LE_READ_REMOTE_FEATURES	0x2016
+struct hci_cp_le_read_remote_features {
+	__le16	 handle;
+} __packed;
+
 #define HCI_OP_LE_START_ENC		0x2019
 struct hci_cp_le_start_enc {
 	__le16	handle;
@@ -1868,6 +1873,13 @@ struct hci_ev_le_conn_update_complete {
 	__le16   supervision_timeout;
 } __packed;
 
+#define HCI_EV_LE_REMOTE_FEAT_COMPLETE	0x04
+struct hci_ev_le_remote_feat_complete {
+	__u8     status;
+	__le16   handle;
+	__u8     features[8];
+} __packed;
+
 #define HCI_EV_LE_LTK_REQ		0x05
 struct hci_ev_le_ltk_req {
 	__le16	handle;
net/bluetooth/hci_event.c +85 -2

123 lines not on this page · raw message

Signature · 1 line
2.1.0