Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

ScanParameters Class Reference

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.
ScanParameterssetOwnAddressType (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.
ScanParameterssetFilter (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.
ScanParameterssetPhys (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.
ScanParametersset1mPhyConfiguration (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.
ScanParameterssetCodedPhyConfiguration (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:
phyThe phy to configure.
scan_intervalThe scan interval.
scan_windowThe scan window.
active_scanningactive scanning flag.
own_address_typeAddress type used in scan requests.
scanning_filter_policyFilter 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:
intervalThe scan interval to use.
windowThe scan window to use.
active_scanningThe 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:
intervalThe scan interval to use.
windowThe scan window to use.
active_scanningThe 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_policyThe 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:
addressThe 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_1mTrue to enable the 1M phy and false to disable it.
enable_codedTrue to enable the coded phy and false to disable it.
Returns:
A reference to this object.

Definition at line 192 of file ScanParameters.h.