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_window_t scan_interval = scan_interval_t::min(),
125 scan_interval_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;
144 #endif // BLE_FEATURE_PHY_MANAGEMENT 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;
186 #endif // BLE_FEATURE_WHITELIST 197 #if BLE_FEATURE_PHY_MANAGEMENT 198 phys.set_1m(enable_1m);
199 phys.set_coded(enable_coded);
200 #endif // 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 254 phys.set_coded(
true);
256 interval, window, active_scanning
258 #endif // BLE_FEATURE_PHY_MANAGEMENT 267 return phy_1m_configuration;
271 own_address_type_t own_address_type;
272 scanning_filter_policy_t scanning_filter_policy;
ScanParameters & setCodedPhyConfiguration(scan_interval_t interval, scan_window_t window, bool active_scanning)
Set the coded PHY 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.
Scan configuration of a physical channel.
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.
const scan_interval_t & getWindow() const
Get the scan window.
ScanParameters & setFilter(scanning_filter_policy_t filter_policy)
Set the filter to apply during scanning.
ScanParameters & setPhys(bool enable_1m, bool enable_coded)
Enable or disable PHYs that should be used during scanning.
Parameters defining the scan process.
const scan_window_t & getInterval() const
Get the scan interval.
Type that describes a bluetooth PHY(sical) transport.
ScanParameters & setOwnAddressType(own_address_type_t address)
Set the address type used for scan requests.
Type that describe a set of PHY(sical) transports.
ScanParameters(phy_t phy=phy_t::LE_1M, scan_window_t scan_interval=scan_interval_t::min(), scan_interval_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.
phy_set_t getPhys() const
Get the PHYs to use during scanning.
Entry namespace for all BLE API definitions.
bool isActiveScanningSet() const
Return if active scanning is set.
phy_configuration_t get1mPhyConfiguration() const
Get the 1M scan configuration.
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.