diff options
author | Sven Gothel <[email protected]> | 2020-08-23 09:42:32 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-08-23 09:42:32 +0200 |
commit | 5cb8c348f36359ea8e81fc6789337a582bbd516b (patch) | |
tree | c77fc7341399a023a560bf7980e36c0875769b33 /api | |
parent | 0cf343f7db6276b257a4664ad2f0048bb690c989 (diff) |
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.
Diffstat (limited to 'api')
-rw-r--r-- | api/direct_bt/HCIHandler.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
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 @@ -222,6 +222,26 @@ namespace direct_bt { HCIStatusCode reset(); /** + * Sets LE scanning parameters. + * <p> + * BT Core Spec v5.2: Vol 4, Part E HCI: 7.8.10 LE Set Scan Parameters command + * </p> + * 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. + * <p> + * BT Core Spec v5.2: Vol 4, Part E HCI: 7.8.11 LE Set Scan Enable command + * </p> + */ + HCIStatusCode le_enable_scan(const bool enable, const bool filter_dup=false); + + /** * Establish a connection to the given LE peer. * <p> * BT Core Spec v5.2: Vol 4, Part E HCI: 7.8.12 LE Create Connection command |