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... | |
Parameters defining the scan process.
Four distinct parameters define the scan procedure:
Definition at line 56 of file GapScanningParams.h.
| 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.
| [in] | interval | Milliseconds interval between the start of two consecutive scan windows. The value passed is between the scan window value and 10.24 seconds. |
| [in] | window | Milliseconds 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] | timeout | Duration in seconds of the scan procedure. The special value 0 may be used when the scan procedure is not time bounded. |
| [in] | activeScanning | If 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. |
| bool getActiveScanning | ( | void | ) | const |
Check whether active scanning is set.
Definition at line 204 of file GapScanningParams.h.
| uint16_t getInterval | ( | void | ) | const |
Get the scan interval.
Definition at line 174 of file GapScanningParams.h.
| uint16_t getTimeout | ( | void | ) | const |
Get the scan timeout.
Definition at line 194 of file GapScanningParams.h.
| uint16_t getWindow | ( | void | ) | const |
Get the scan window.
Definition at line 184 of file GapScanningParams.h.
|
static |
Convert milliseconds to units of 0.625ms.
| [in] | durationInMillis | Milliseconds to convert. |
durationInMillis in units of 0.625ms. Definition at line 129 of file GapScanningParams.h.
| void setActiveScanning | ( | bool | activeScanning | ) |
Update the active scanning flag.
| [in] | activeScanning | New boolean value of active scanning. |
| ble_error_t setInterval | ( | uint16_t | newIntervalInMS | ) |
Update the scan interval.
| [in] | newIntervalInMS | New scan interval in milliseconds. |
| ble_error_t setTimeout | ( | uint16_t | newTimeout | ) |
Update the scan timeout.
| [in] | newTimeout | New scan timeout in seconds. |
| ble_error_t setWindow | ( | uint16_t | newWindowInMS | ) |
Update the scan window.
| [in] | newWindowInMS | New scan window in milliseconds. |
|
static |
Maximum Scan interval in 625us units - 10.24s.
Definition at line 66 of file GapScanningParams.h.
|
static |
Minimum Scan interval in 625us units - 2.5ms.
Definition at line 61 of file GapScanningParams.h.
|
static |
Maximum Scan duration in seconds.
Definition at line 86 of file GapScanningParams.h.
|
static |
Minimum Scan duration in seconds.
Definition at line 81 of file GapScanningParams.h.
|
static |
Maximum Scan window in 625us units - 10.24s.
Definition at line 76 of file GapScanningParams.h.
|
static |
Minimum Scan window in 625us units - 2.5ms.
Definition at line 71 of file GapScanningParams.h.
|
static |
Number of microseconds in 0.625 milliseconds.
Definition at line 120 of file GapScanningParams.h.