Skip to contentSkip to conversation

Bluetooth: Introduce flag for limited discoverable mode

PATCH In review Marcel Holtmann 1 participant 1 message Oct 15, 2013

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 3/7 Bluetooth: Introduce flag for limited discoverable mode

Add a new flag that can be set when in limited discoverable mode. This flag will cause the limited discoverable bit in the class of device value to bet set.

---
 include/net/bluetooth/hci.h | 1 +
 net/bluetooth/mgmt.c        | 3 +++
 2 files changed, 4 insertions(+)
include/net/bluetooth/hci.h +1 -0
index b096f5f..f4650a8 100644
@@ -125,6 +125,7 @@ enum {
 	HCI_ADVERTISING,
 	HCI_CONNECTABLE,
 	HCI_DISCOVERABLE,
+	HCI_LIMITED_DISCOVERABLE,
 	HCI_LINK_SECURITY,
 	HCI_PERIODIC_INQ,
 	HCI_FAST_CONNECTABLE,
net/bluetooth/mgmt.c +3 -0
index 285d571..d5eaa28 100644
@@ -724,6 +724,9 @@ static void update_class(struct hci_request *req)
 	cod[1] = hdev->major_class;
 	cod[2] = get_service_classes(hdev);
 
+	if (test_bit(HCI_LIMITED_DISCOVERABLE, &hdev->dev_flags))
+		cod[1] |= 0x20;
+
 	if (memcmp(cod, hdev->dev_class, 3) == 0)
 		return;
 
Signature · 1 line
1.8.3.1