Parameters defining the advertising process. More...
#include <GapAdvertisingParams.h>
Public Types | |
| typedef enum AdvertisingType_t | AdvertisingType |
| Alias for GapAdvertisingParams::AdvertisingType_t. More... | |
Public Member Functions | |
| GapAdvertisingParams (AdvertisingType_t advType=ADV_CONNECTABLE_UNDIRECTED, uint16_t interval=GAP_ADV_PARAMS_INTERVAL_MIN_NONCON, uint16_t timeout=0) | |
| Construct an instance of GapAdvertisingParams. More... | |
| AdvertisingType_t | getAdvertisingType (void) const |
| Get the advertising type. More... | |
| uint16_t | getInterval (void) const |
| Get the advertising interval in milliseconds. More... | |
| uint16_t | getIntervalInADVUnits (void) const |
| Get the advertisement interval in units of 0.625ms. More... | |
| uint16_t | getTimeout (void) const |
| Get the advertising timeout. More... | |
| void | setAdvertisingType (AdvertisingType_t newAdvType) |
| Update the advertising type. More... | |
| void | setInterval (uint16_t newInterval) |
| Update the advertising interval in milliseconds. More... | |
| void | setTimeout (uint16_t newTimeout) |
| Update the advertising timeout. More... | |
Static Public Member Functions | |
| static uint16_t | MSEC_TO_ADVERTISEMENT_DURATION_UNITS (uint32_t durationInMillis) |
| Convert milliseconds to units of 0.625ms. More... | |
| static uint16_t | ADVERTISEMENT_DURATION_UNITS_TO_MS (uint16_t gapUnits) |
| Convert units of 0.625ms to milliseconds. More... | |
Static Public Attributes | |
| static const unsigned | GAP_ADV_PARAMS_INTERVAL_MIN = 0x0020 |
| Minimum Advertising interval for connectable undirected and connectable directed events in 625us units. More... | |
| static const unsigned | GAP_ADV_PARAMS_INTERVAL_MIN_NONCON = 0x00A0 |
| Minimum Advertising interval for scannable and nonconnectable undirected events in 625us units. More... | |
| static const unsigned | GAP_ADV_PARAMS_INTERVAL_MAX = 0x4000 |
| Maximum Advertising interval in 625us units. More... | |
| static const unsigned | GAP_ADV_PARAMS_TIMEOUT_MAX = 0x3FFF |
| Maximum advertising timeout allowed; in seconds. More... | |
| static const uint16_t | UNIT_0_625_MS = 625 |
| Number of microseconds in 0.625 milliseconds. More... | |
Parameters defining the advertising process.
Advertising parameters are a triplet of three value:
Definition at line 40 of file GapAdvertisingParams.h.
| typedef enum AdvertisingType_t AdvertisingType |
Alias for GapAdvertisingParams::AdvertisingType_t.
Definition at line 113 of file GapAdvertisingParams.h.
| enum AdvertisingType_t |
Encapsulates the peripheral advertising modes.
It determine how the device appears to other scanner and peripheral devices in the scanning range.
Definition at line 77 of file GapAdvertisingParams.h.
| GapAdvertisingParams | ( | AdvertisingType_t | advType = ADV_CONNECTABLE_UNDIRECTED, |
| uint16_t | interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON, |
||
| uint16_t | timeout = 0 |
||
| ) |
Construct an instance of GapAdvertisingParams.
| [in] | advType | Type of advertising. |
| [in] | interval | Time interval between two advertisement in units of 0.625ms. |
| [in] | timeout | Duration in seconds of the advertising process. A value of 0 indicate that there is no timeout of the advertising process. |
Definition at line 127 of file GapAdvertisingParams.h.
|
static |
Convert units of 0.625ms to milliseconds.
| [in] | gapUnits | The number of units of 0.625ms to convert. |
gapUnits in milliseconds. Definition at line 191 of file GapAdvertisingParams.h.
| AdvertisingType_t getAdvertisingType | ( | void | ) | const |
Get the advertising type.
Definition at line 201 of file GapAdvertisingParams.h.
| uint16_t getInterval | ( | void | ) | const |
Get the advertising interval in milliseconds.
Definition at line 211 of file GapAdvertisingParams.h.
| uint16_t getIntervalInADVUnits | ( | void | ) | const |
Get the advertisement interval in units of 0.625ms.
Definition at line 222 of file GapAdvertisingParams.h.
| uint16_t getTimeout | ( | void | ) | const |
Get the advertising timeout.
Definition at line 232 of file GapAdvertisingParams.h.
|
static |
Convert milliseconds to units of 0.625ms.
| [in] | durationInMillis | Number of milliseconds to convert. |
durationInMillis in units of 0.625ms. Definition at line 179 of file GapAdvertisingParams.h.
| void setAdvertisingType | ( | AdvertisingType_t | newAdvType | ) |
Update the advertising type.
| [in] | newAdvType | The new advertising type. |
Definition at line 242 of file GapAdvertisingParams.h.
| void setInterval | ( | uint16_t | newInterval | ) |
Update the advertising interval in milliseconds.
| [in] | newInterval | The new advertising interval in milliseconds. |
Definition at line 252 of file GapAdvertisingParams.h.
| void setTimeout | ( | uint16_t | newTimeout | ) |
Update the advertising timeout.
| [in] | newTimeout | The new advertising timeout (in seconds). |
Definition at line 264 of file GapAdvertisingParams.h.
|
static |
Maximum Advertising interval in 625us units.
Definition at line 64 of file GapAdvertisingParams.h.
|
static |
Minimum Advertising interval for connectable undirected and connectable directed events in 625us units.
Definition at line 49 of file GapAdvertisingParams.h.
|
static |
Minimum Advertising interval for scannable and nonconnectable undirected events in 625us units.
Definition at line 57 of file GapAdvertisingParams.h.
|
static |
Maximum advertising timeout allowed; in seconds.
Definition at line 69 of file GapAdvertisingParams.h.
|
static |
Number of microseconds in 0.625 milliseconds.
Definition at line 170 of file GapAdvertisingParams.h.