Skip to content

Commit

Permalink
Bluetooth: Fix setting correct flags in AD
Browse files Browse the repository at this point in the history
A recent change added MGMT_ADV_FLAG_DISCOV to the flags returned by
get_adv_instance_flags(), however failed to take into account limited
discoverable mode. This patch fixes the issue by setting the correct
discoverability flag in the AD data.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Johan Hedberg authored and Marcel Holtmann committed Mar 11, 2016
1 parent 9c176ce commit 6a19cc8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/bluetooth/hci_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,9 @@ static u32 get_adv_instance_flags(struct hci_dev *hdev, u8 instance)
if (hci_dev_test_flag(hdev, HCI_ADVERTISING_CONNECTABLE))
flags |= MGMT_ADV_FLAG_CONNECTABLE;

if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE))
if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE))
flags |= MGMT_ADV_FLAG_LIMITED_DISCOV;
else if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE))
flags |= MGMT_ADV_FLAG_DISCOV;

return flags;
Expand Down

0 comments on commit 6a19cc8

Please sign in to comment.