Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
ScanParameters Class Reference
[Gap]
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_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. | |
ScanParameters & | setOwnAddressType (own_address_type_t address) |
Set the address type used for scan requests. | |
own_address_type_t | getOwnAddressType () const |
Get the address type used during scan requests. | |
ScanParameters & | setFilter (scanning_filter_policy_t filter_policy) |
Set the filter to apply during scanning. | |
scanning_filter_policy_t | getFilter () const |
Get the filter to use during scanning. | |
ScanParameters & | setPhys (bool enable_1m, bool enable_coded) |
Enable or disable PHYs that should be used during scanning. | |
phy_set_t | getPhys () const |
Get the PHYs 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. | |
ScanParameters & | setCodedPhyConfiguration (scan_interval_t interval, scan_window_t window, bool active_scanning) |
Set the coded PHY scan configuration. | |
phy_configuration_t | getCodedPhyConfiguration () const |
Get the coded PHY scan configuration. |
Detailed Description
Parameters defining the scan process.
The scan process is defined by two main parameters:
- The scan window that defines how long the device should scan.
- The scan window that defines how frequently the device should scan.
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 51 of file ScanParameters.h.
Constructor & Destructor Documentation
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.
- Parameters:
-
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 119 of file ScanParameters.h.
Member Function Documentation
phy_configuration_t get1mPhyConfiguration | ( | ) | const |
Get the 1M scan configuration.
Definition at line 232 of file ScanParameters.h.
phy_configuration_t getCodedPhyConfiguration | ( | ) | const |
Get the coded PHY scan configuration.
Definition at line 262 of file ScanParameters.h.
scanning_filter_policy_t getFilter | ( | ) | const |
Get the filter to use during scanning.
Definition at line 177 of file ScanParameters.h.
own_address_type_t getOwnAddressType | ( | ) | const |
Get the address type used during scan requests.
Definition at line 158 of file ScanParameters.h.
phy_set_t getPhys | ( | ) | const |
Get the PHYs to use during scanning.
Definition at line 204 of file ScanParameters.h.
ScanParameters& set1mPhyConfiguration | ( | scan_interval_t | interval, |
scan_window_t | window, | ||
bool | active_scanning | ||
) |
Set the 1M scan configuration.
- Parameters:
-
interval The scan interval to use. window The scan window to use. active_scanning The active scanning flag.
- Returns:
- A reference to this object.
Definition at line 216 of file ScanParameters.h.
ScanParameters& setCodedPhyConfiguration | ( | scan_interval_t | interval, |
scan_window_t | window, | ||
bool | active_scanning | ||
) |
Set the coded PHY scan configuration.
- Parameters:
-
interval The scan interval to use. window The scan window to use. active_scanning The active scanning flag.
- Returns:
- A reference to this object.
Definition at line 244 of file ScanParameters.h.
ScanParameters& setFilter | ( | scanning_filter_policy_t | filter_policy ) |
Set the filter to apply during scanning.
- Parameters:
-
filter_policy The filter to apply during scanning.
- Returns:
- A reference to this object.
Definition at line 168 of file ScanParameters.h.
ScanParameters& setOwnAddressType | ( | own_address_type_t | address ) |
Set the address type used for scan requests.
- Parameters:
-
address The type of address to use during scan requests.
- Returns:
- A reference to this object.
Definition at line 149 of file ScanParameters.h.
ScanParameters& setPhys | ( | bool | enable_1m, |
bool | enable_coded | ||
) |
Enable or disable PHYs that should be used during scanning.
- Parameters:
-
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.
- Returns:
- A reference to this object.
Definition at line 192 of file ScanParameters.h.
Generated on Tue Jul 12 2022 13:55:40 by
