From 5cb8c348f36359ea8e81fc6789337a582bbd516b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 23 Aug 2020 09:42:32 +0200 Subject: HCIHandler: Add le_set_scan_param(..) and le_enable_scan(..) This replaces Linux Mgmt's discover start/stop with native HCI commands. Besides avoiding side-effects, we can utilize le_set_scan_param(..) similar to le_create_conn(..) for fine grained scanning performance. --- api/direct_bt/HCIHandler.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'api') diff --git a/api/direct_bt/HCIHandler.hpp b/api/direct_bt/HCIHandler.hpp index 1879accf..64c69f99 100644 --- a/api/direct_bt/HCIHandler.hpp +++ b/api/direct_bt/HCIHandler.hpp @@ -221,6 +221,26 @@ namespace direct_bt { */ HCIStatusCode reset(); + /** + * Sets LE scanning parameters. + *

+ * BT Core Spec v5.2: Vol 4, Part E HCI: 7.8.10 LE Set Scan Parameters command + *

+ * Should not be called while scanning is active. + */ + HCIStatusCode le_set_scan_param(const bool le_scan_active=false, + const HCILEOwnAddressType own_mac_type=HCILEOwnAddressType::PUBLIC, + const uint16_t le_scan_interval=48, const uint16_t le_scan_window=48, + const uint8_t filter_policy=0x00); + + /** + * Starts or stops LE scanning. + *

+ * BT Core Spec v5.2: Vol 4, Part E HCI: 7.8.11 LE Set Scan Enable command + *

+ */ + HCIStatusCode le_enable_scan(const bool enable, const bool filter_dup=false); + /** * Establish a connection to the given LE peer. *

-- cgit v1.2.3