19#ifndef MBED_GAP_SCAN_PARAMETERS_H__
20#define MBED_GAP_SCAN_PARAMETERS_H__
24#include "ble/common/blecommon.h"
25#include "ble/common/BLETypes.h"
69 scan_interval_t scan_interval = scan_interval_t::min(),
70 scan_window_t scan_window = scan_window_t::min(),
71 bool active_scanning =
false
73 interval(scan_interval),
75 active_scanning(active_scanning)
77 if (window.value() > interval.value()) {
103 return active_scanning;
107 scan_interval_t interval;
108 scan_window_t window;
109 bool active_scanning;
124 scan_interval_t scan_interval = scan_interval_t::min(),
125 scan_window_t scan_window = scan_window_t::min(),
126 bool active_scanning =
false,
127 own_address_type_t own_address_type = own_address_type_t::RANDOM,
128 scanning_filter_policy_t scanning_filter_policy = scanning_filter_policy_t::NO_FILTER
130 own_address_type(own_address_type),
131 scanning_filter_policy(scanning_filter_policy),
133 phy_1m_configuration(),
134 phy_coded_configuration()
138 phy_1m_configuration = conf;
140#if BLE_FEATURE_PHY_MANAGEMENT
142 phy_coded_configuration = conf;
154 own_address_type = address;
163 return own_address_type;
173 scanning_filter_policy = filter_policy;
182#if BLE_FEATURE_WHITELIST
183 return scanning_filter_policy;
185 return scanning_filter_policy_t::NO_FILTER;
197#if BLE_FEATURE_PHY_MANAGEMENT
220 scan_interval_t interval,
221 scan_window_t window,
227 interval, window, active_scanning
237 return phy_1m_configuration;
248 scan_interval_t interval,
249 scan_window_t window,
253#if BLE_FEATURE_PHY_MANAGEMENT
256 interval, window, active_scanning
267 return phy_1m_configuration;
271 own_address_type_t own_address_type;
272 scanning_filter_policy_t scanning_filter_policy;
276 phy_configuration_t phy_1m_configuration;
277 phy_configuration_t phy_coded_configuration;
Parameters defining the scan process.
phy_set_t getPhys() const
Get the PHYs to use during scanning.
ScanParameters & setOwnAddressType(own_address_type_t address)
Set the address type used for scan requests.
scanning_filter_policy_t getFilter() const
Get the filter to use during scanning.
ScanParameters & set1mPhyConfiguration(scan_interval_t interval, scan_window_t window, bool active_scanning)
Set the 1M scan configuration.
phy_configuration_t get1mPhyConfiguration() const
Get the 1M scan configuration.
own_address_type_t getOwnAddressType() const
Get the address type used during scan requests.
phy_configuration_t getCodedPhyConfiguration() const
Get the coded PHY scan configuration.
ScanParameters & setCodedPhyConfiguration(scan_interval_t interval, scan_window_t window, bool active_scanning)
Set the coded PHY scan configuration.
ScanParameters & setFilter(scanning_filter_policy_t filter_policy)
Set the filter to apply during scanning.
ScanParameters(phy_t phy=phy_t::LE_1M, scan_interval_t scan_interval=scan_interval_t::min(), scan_window_t scan_window=scan_window_t::min(), bool active_scanning=false, own_address_type_t own_address_type=own_address_type_t::RANDOM, scanning_filter_policy_t scanning_filter_policy=scanning_filter_policy_t::NO_FILTER)
Construct a ScanParameters object that operates on a selected PHY.
ScanParameters & setPhys(bool enable_1m, bool enable_coded)
Enable or disable PHYs that should be used during scanning.
Type that describe a set of PHY(sical) transports.
void set_coded(bool enabled=true)
Prefer coded PHY.
void set_1m(bool enabled=true)
Prefer 1M PHY.
Entry namespace for all BLE API definitions.
Scan configuration of a physical channel.
bool isActiveScanningSet() const
Return if active scanning is set.
const scan_interval_t & getInterval() const
Get the scan interval.
phy_configuration_t(scan_interval_t scan_interval=scan_interval_t::min(), scan_window_t scan_window=scan_window_t::min(), bool active_scanning=false)
Construct a phy_configuration_t.
const scan_window_t & getWindow() const
Get the scan window.
Type that describes a bluetooth PHY(sical) transport.