Mbed OS Reference
|
Parameters defining the scan process. More...
#include <ScanParameters.h>
Data Structures | |
struct | phy_configuration_t |
Scan configuration of a physical channel. More... | |
Public Member Functions | |
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. More... | |
ScanParameters & | setOwnAddressType (own_address_type_t address) |
Set the address type used for scan requests. More... | |
own_address_type_t | getOwnAddressType () const |
Get the address type used during scan requests. More... | |
ScanParameters & | setFilter (scanning_filter_policy_t filter_policy) |
Set the filter to apply during scanning. More... | |
scanning_filter_policy_t | getFilter () const |
Get the filter to use during scanning. More... | |
ScanParameters & | setPhys (bool enable_1m, bool enable_coded) |
Enable or disable PHYs that should be used during scanning. More... | |
phy_set_t | getPhys () const |
Get the PHYs to use during scanning. More... | |
ScanParameters & | set1mPhyConfiguration (scan_interval_t interval, scan_window_t window, bool active_scanning) |
Set the 1M scan configuration. More... | |
phy_configuration_t | get1mPhyConfiguration () const |
Get the 1M scan configuration. More... | |
ScanParameters & | setCodedPhyConfiguration (scan_interval_t interval, scan_window_t window, bool active_scanning) |
Set the coded PHY scan configuration. More... | |
phy_configuration_t | getCodedPhyConfiguration () const |
Get the coded PHY scan configuration. More... | |
Parameters defining the scan process.
The scan process is defined by two main parameters:
To scan continuously, the scan window and the scan interval should have the same value.
To get extra data from the advertising device, the scanner can send scan requests to the advertiser; the advertiser may respond with scan responses. It is possible to select what type of address is used to issue the scan request.
With Bluetooth 5, devices can advertise on more physical channels, and by extension, they can scan on more physical channels. It is possible to define independent scan parameters for every scannable physical channel.
Definition at line 54 of file ScanParameters.h.
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.
phy | The phy to configure. |
scan_interval | The scan interval. |
scan_window | The scan window. |
active_scanning | active scanning flag. |
own_address_type | Address type used in scan requests. |
scanning_filter_policy | Filter applied. |
Definition at line 122 of file ScanParameters.h.
ScanParameters & setOwnAddressType | ( | own_address_type_t | address | ) |
Set the address type used for scan requests.
address | The type of address to use during scan requests. |
Definition at line 152 of file ScanParameters.h.
own_address_type_t getOwnAddressType | ( | ) | const |
Get the address type used during scan requests.
Definition at line 161 of file ScanParameters.h.
ScanParameters & setFilter | ( | scanning_filter_policy_t | filter_policy | ) |
Set the filter to apply during scanning.
filter_policy | The filter to apply during scanning. |
Definition at line 171 of file ScanParameters.h.
scanning_filter_policy_t getFilter | ( | ) | const |
Get the filter to use during scanning.
Definition at line 180 of file ScanParameters.h.
ScanParameters & setPhys | ( | bool | enable_1m, |
bool | enable_coded | ||
) |
Enable or disable PHYs that should be used during scanning.
enable_1m | True to enable the 1M phy and false to disable it. |
enable_coded | True to enable the coded phy and false to disable it. |
Definition at line 195 of file ScanParameters.h.
phy_set_t getPhys | ( | ) | const |
Get the PHYs to use during scanning.
Definition at line 207 of file ScanParameters.h.
ScanParameters & set1mPhyConfiguration | ( | scan_interval_t | interval, |
scan_window_t | window, | ||
bool | active_scanning | ||
) |
Set the 1M scan configuration.
interval | The scan interval to use. |
window | The scan window to use. |
active_scanning | The active scanning flag. |
Definition at line 219 of file ScanParameters.h.
phy_configuration_t get1mPhyConfiguration | ( | ) | const |
Get the 1M scan configuration.
Definition at line 235 of file ScanParameters.h.
ScanParameters & setCodedPhyConfiguration | ( | scan_interval_t | interval, |
scan_window_t | window, | ||
bool | active_scanning | ||
) |
Set the coded PHY scan configuration.
interval | The scan interval to use. |
window | The scan window to use. |
active_scanning | The active scanning flag. |
Definition at line 247 of file ScanParameters.h.
phy_configuration_t getCodedPhyConfiguration | ( | ) | const |
Get the coded PHY scan configuration.
Definition at line 265 of file ScanParameters.h.