Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5df480b5 authored by Andre Guedes's avatar Andre Guedes Committed by Gustavo Padovan
Browse files

Bluetooth: Add LE scan type macros



This patch adds macros for active and passive LE scan type values.
The LE_SCAN_PASSIVE was also defined since it will be used in future
by LE connection routine and GAP Observer Role support.

Signed-off-by: default avatarAndre Guedes <andre.guedes@openbossa.org>
Acked-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent b6c7515a
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -984,6 +984,9 @@ struct hci_cp_le_set_adv_data {


#define HCI_OP_LE_SET_ADV_ENABLE	0x200a
#define HCI_OP_LE_SET_ADV_ENABLE	0x200a


#define LE_SCAN_PASSIVE			0x00
#define LE_SCAN_ACTIVE			0x01

#define HCI_OP_LE_SET_SCAN_PARAM	0x200b
#define HCI_OP_LE_SET_SCAN_PARAM	0x200b
struct hci_cp_le_set_scan_param {
struct hci_cp_le_set_scan_param {
	__u8    type;
	__u8    type;
+3 −4
Original line number Original line Diff line number Diff line
@@ -106,7 +106,6 @@ static const u16 mgmt_events[] = {
 * These LE scan and inquiry parameters were chosen according to LE General
 * These LE scan and inquiry parameters were chosen according to LE General
 * Discovery Procedure specification.
 * Discovery Procedure specification.
 */
 */
#define LE_SCAN_TYPE			0x01
#define LE_SCAN_WIN			0x12
#define LE_SCAN_WIN			0x12
#define LE_SCAN_INT			0x12
#define LE_SCAN_INT			0x12
#define LE_SCAN_TIMEOUT_LE_ONLY		msecs_to_jiffies(10240)
#define LE_SCAN_TIMEOUT_LE_ONLY		msecs_to_jiffies(10240)
@@ -2703,7 +2702,7 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,
			goto failed;
			goto failed;
		}
		}


		err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT,
		err = hci_le_scan(hdev, LE_SCAN_ACTIVE, LE_SCAN_INT,
				  LE_SCAN_WIN, LE_SCAN_TIMEOUT_LE_ONLY);
				  LE_SCAN_WIN, LE_SCAN_TIMEOUT_LE_ONLY);
		break;
		break;


@@ -2715,8 +2714,8 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,
			goto failed;
			goto failed;
		}
		}


		err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT, LE_SCAN_WIN,
		err = hci_le_scan(hdev, LE_SCAN_ACTIVE, LE_SCAN_INT,
				  LE_SCAN_TIMEOUT_BREDR_LE);
				  LE_SCAN_WIN, LE_SCAN_TIMEOUT_BREDR_LE);
		break;
		break;


	default:
	default: