Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions | Static Public Member Functions | Static Public Attributes
GapScanningParams Class Reference
Ble » Gap

Parameters defining the scan process. More...

#include <GapScanningParams.h>

Public Member Functions

 GapScanningParams (uint16_t interval=SCAN_INTERVAL_MAX, uint16_t window=SCAN_WINDOW_MAX, uint16_t timeout=0, bool activeScanning=false)
 Construct an instance of GapScanningParams. More...
 
ble_error_t setInterval (uint16_t newIntervalInMS)
 Update the scan interval. More...
 
ble_error_t setWindow (uint16_t newWindowInMS)
 Update the scan window. More...
 
ble_error_t setTimeout (uint16_t newTimeout)
 Update the scan timeout. More...
 
void setActiveScanning (bool activeScanning)
 Update the active scanning flag. More...
 
uint16_t getInterval (void) const
 Get the scan interval. More...
 
uint16_t getWindow (void) const
 Get the scan window. More...
 
uint16_t getTimeout (void) const
 Get the scan timeout. More...
 
bool getActiveScanning (void) const
 Check whether active scanning is set. More...
 

Static Public Member Functions

static uint16_t MSEC_TO_SCAN_DURATION_UNITS (uint32_t durationInMillis)
 Convert milliseconds to units of 0.625ms. More...
 

Static Public Attributes

static const unsigned SCAN_INTERVAL_MIN = 0x0004
 Minimum Scan interval in 625us units - 2.5ms. More...
 
static const unsigned SCAN_INTERVAL_MAX = 0x4000
 Maximum Scan interval in 625us units - 10.24s. More...
 
static const unsigned SCAN_WINDOW_MIN = 0x0004
 Minimum Scan window in 625us units - 2.5ms. More...
 
static const unsigned SCAN_WINDOW_MAX = 0x4000
 Maximum Scan window in 625us units - 10.24s. More...
 
static const unsigned SCAN_TIMEOUT_MIN = 0x0001
 Minimum Scan duration in seconds. More...
 
static const unsigned SCAN_TIMEOUT_MAX = 0xFFFF
 Maximum Scan duration in seconds. More...
 
static const uint16_t UNIT_0_625_MS = 625
 Number of microseconds in 0.625 milliseconds. More...
 

Detailed Description

Parameters defining the scan process.

Four distinct parameters define the scan procedure:

Note
If the scan window's duration is equal to the scan interval, then the device listens continuously during the scan procedure.

Definition at line 56 of file GapScanningParams.h.

Constructor & Destructor Documentation

GapScanningParams ( uint16_t  interval = SCAN_INTERVAL_MAX,
uint16_t  window = SCAN_WINDOW_MAX,
uint16_t  timeout = 0,
bool  activeScanning = false 
)

Construct an instance of GapScanningParams.

Parameters
[in]intervalMilliseconds interval between the start of two consecutive scan windows. The value passed is between the scan window value and 10.24 seconds.
[in]windowMilliseconds period during which the device listens to advertising channels. The value of the scan window is in the range of 2.5ms to 10.24s.
[in]timeoutDuration in seconds of the scan procedure. The special value 0 may be used when the scan procedure is not time bounded.
[in]activeScanningIf true, then the scanner sends scan requests to to scannable or connectable advertiser. Advertisers may respond to the scan request by a scan response containing the scan response payload. If false, the scanner does not send any request.
Note
If interval is equal to window

Member Function Documentation

bool getActiveScanning ( void  ) const

Check whether active scanning is set.

Returns
True if active scanning is set, false otherwise.

Definition at line 204 of file GapScanningParams.h.

uint16_t getInterval ( void  ) const

Get the scan interval.

Returns
the scan interval in units of 0.625ms.

Definition at line 174 of file GapScanningParams.h.

uint16_t getTimeout ( void  ) const

Get the scan timeout.

Returns
The scan timeout in seconds.

Definition at line 194 of file GapScanningParams.h.

uint16_t getWindow ( void  ) const

Get the scan window.

Returns
the scan window in units of 0.625ms.

Definition at line 184 of file GapScanningParams.h.

static uint16_t MSEC_TO_SCAN_DURATION_UNITS ( uint32_t  durationInMillis)
static

Convert milliseconds to units of 0.625ms.

Parameters
[in]durationInMillisMilliseconds to convert.
Returns
The value of durationInMillis in units of 0.625ms.

Definition at line 129 of file GapScanningParams.h.

void setActiveScanning ( bool  activeScanning)

Update the active scanning flag.

Parameters
[in]activeScanningNew boolean value of active scanning.
ble_error_t setInterval ( uint16_t  newIntervalInMS)

Update the scan interval.

Parameters
[in]newIntervalInMSNew scan interval in milliseconds.
Returns
BLE_ERROR_NONE if the new scan interval was set successfully.
ble_error_t setTimeout ( uint16_t  newTimeout)

Update the scan timeout.

Parameters
[in]newTimeoutNew scan timeout in seconds.
Returns
BLE_ERROR_NONE if the new scan window was set successfully.
ble_error_t setWindow ( uint16_t  newWindowInMS)

Update the scan window.

Parameters
[in]newWindowInMSNew scan window in milliseconds.
Returns
BLE_ERROR_NONE if the new scan window was set successfully.

Field Documentation

const unsigned SCAN_INTERVAL_MAX = 0x4000
static

Maximum Scan interval in 625us units - 10.24s.

Definition at line 66 of file GapScanningParams.h.

const unsigned SCAN_INTERVAL_MIN = 0x0004
static

Minimum Scan interval in 625us units - 2.5ms.

Definition at line 61 of file GapScanningParams.h.

const unsigned SCAN_TIMEOUT_MAX = 0xFFFF
static

Maximum Scan duration in seconds.

Definition at line 86 of file GapScanningParams.h.

const unsigned SCAN_TIMEOUT_MIN = 0x0001
static

Minimum Scan duration in seconds.

Definition at line 81 of file GapScanningParams.h.

const unsigned SCAN_WINDOW_MAX = 0x4000
static

Maximum Scan window in 625us units - 10.24s.

Definition at line 76 of file GapScanningParams.h.

const unsigned SCAN_WINDOW_MIN = 0x0004
static

Minimum Scan window in 625us units - 2.5ms.

Definition at line 71 of file GapScanningParams.h.

const uint16_t UNIT_0_625_MS = 625
static

Number of microseconds in 0.625 milliseconds.

Definition at line 120 of file GapScanningParams.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.