diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-12-05 04:55:56 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-12-05 05:37:34 -0500 |
commit | bda157a40077447b25a1172a17b8ef81a2905cb7 (patch) | |
tree | 52fec5389acaeb15823ebf8bf17dfe9490246d1e /net/bluetooth/mgmt.c | |
parent | 37eab042be2196751ff108e6892951338b9a0969 (diff) |
Bluetooth: Filter device found events based on RSSI threshold
Using Start Service Discovery allows to provide a RSSI threshold. This
patch implements support for filtering out device found events based
on the provided value.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index b6a0f3e6b719..1715c91dfa28 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -6821,6 +6821,15 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
6821 | return; | 6821 | return; |
6822 | } | 6822 | } |
6823 | 6823 | ||
6824 | /* When using service discovery with a RSSI threshold, then check | ||
6825 | * if such a RSSI threshold is specified. If a RSSI threshold has | ||
6826 | * been specified, then all results with a RSSI smaller than the | ||
6827 | * RSSI threshold will be dropped. | ||
6828 | */ | ||
6829 | if (hdev->discovery.rssi != HCI_RSSI_INVALID && | ||
6830 | rssi < hdev->discovery.rssi) | ||
6831 | return; | ||
6832 | |||
6824 | /* Make sure that the buffer is big enough. The 5 extra bytes | 6833 | /* Make sure that the buffer is big enough. The 5 extra bytes |
6825 | * are for the potential CoD field. | 6834 | * are for the potential CoD field. |
6826 | */ | 6835 | */ |