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.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Marcel Holtmann 2013-10-15 06:33:53 -07:00 committed by Johan Hedberg
parent 441ad2d041
commit 6acd7db41d
2 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,7 @@ enum {
HCI_ADVERTISING,
HCI_CONNECTABLE,
HCI_DISCOVERABLE,
HCI_LIMITED_DISCOVERABLE,
HCI_LINK_SECURITY,
HCI_PERIODIC_INQ,
HCI_FAST_CONNECTABLE,

View File

@ -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;