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

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...
 

Detailed Description

Parameters defining the advertising process.

Advertising parameters are a triplet of three value:

Definition at line 40 of file GapAdvertisingParams.h.

Member Typedef Documentation

Alias for GapAdvertisingParams::AdvertisingType_t.

Deprecated:
Future releases will drop this type alias.

Definition at line 113 of file GapAdvertisingParams.h.

Member Enumeration Documentation

Encapsulates the peripheral advertising modes.

It determine how the device appears to other scanner and peripheral devices in the scanning range.

Enumerator
ADV_CONNECTABLE_UNDIRECTED 

Device is connectable, scannable and doesn't expect connection from a specific peer.

See also
Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1.
ADV_CONNECTABLE_DIRECTED 

Device is connectable and expects connection from a specific peer.

See also
Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2.
ADV_SCANNABLE_UNDIRECTED 

Device is scannable but not connectable.

See also
Vol 6, Part B, Section 2.3.1.4.
ADV_NON_CONNECTABLE_UNDIRECTED 

Device is not connectable and not scannable.

See also
Vol 3, Part C, Section 9.3.2 and Vol 6, Part B, Section 2.3.1.3.

Definition at line 77 of file GapAdvertisingParams.h.

Constructor & Destructor Documentation

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.

Parameters
[in]advTypeType of advertising.
[in]intervalTime interval between two advertisement in units of 0.625ms.
[in]timeoutDuration in seconds of the advertising process. A value of 0 indicate that there is no timeout of the advertising process.
Note
If value in input are out of range, they will be normalized.

Definition at line 127 of file GapAdvertisingParams.h.

Member Function Documentation

static uint16_t ADVERTISEMENT_DURATION_UNITS_TO_MS ( uint16_t  gapUnits)
static

Convert units of 0.625ms to milliseconds.

Parameters
[in]gapUnitsThe number of units of 0.625ms to convert.
Returns
The value of gapUnits in milliseconds.

Definition at line 191 of file GapAdvertisingParams.h.

AdvertisingType_t getAdvertisingType ( void  ) const

Get the advertising type.

Returns
The advertising type.

Definition at line 201 of file GapAdvertisingParams.h.

uint16_t getInterval ( void  ) const

Get the advertising interval in milliseconds.

Returns
The advertisement 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.

Returns
The advertisement interval in advertisement duration units (0.625ms units).

Definition at line 222 of file GapAdvertisingParams.h.

uint16_t getTimeout ( void  ) const

Get the advertising timeout.

Returns
The advertising timeout (in seconds).

Definition at line 232 of file GapAdvertisingParams.h.

static uint16_t MSEC_TO_ADVERTISEMENT_DURATION_UNITS ( uint32_t  durationInMillis)
static

Convert milliseconds to units of 0.625ms.

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

Definition at line 179 of file GapAdvertisingParams.h.

void setAdvertisingType ( AdvertisingType_t  newAdvType)

Update the advertising type.

Parameters
[in]newAdvTypeThe new advertising type.

Definition at line 242 of file GapAdvertisingParams.h.

void setInterval ( uint16_t  newInterval)

Update the advertising interval in milliseconds.

Parameters
[in]newIntervalThe new advertising interval in milliseconds.

Definition at line 252 of file GapAdvertisingParams.h.

void setTimeout ( uint16_t  newTimeout)

Update the advertising timeout.

Parameters
[in]newTimeoutThe new advertising timeout (in seconds).
Note
0 is a special value meaning the advertising process never ends.

Definition at line 264 of file GapAdvertisingParams.h.

Field Documentation

const unsigned GAP_ADV_PARAMS_INTERVAL_MAX = 0x4000
static

Maximum Advertising interval in 625us units.

Note
Equal to 10.24s.

Definition at line 64 of file GapAdvertisingParams.h.

const unsigned GAP_ADV_PARAMS_INTERVAL_MIN = 0x0020
static

Minimum Advertising interval for connectable undirected and connectable directed events in 625us units.

Note
Equal to 20 ms.

Definition at line 49 of file GapAdvertisingParams.h.

const unsigned GAP_ADV_PARAMS_INTERVAL_MIN_NONCON = 0x00A0
static

Minimum Advertising interval for scannable and nonconnectable undirected events in 625us units.

Note
Equal to 100ms.

Definition at line 57 of file GapAdvertisingParams.h.

const unsigned GAP_ADV_PARAMS_TIMEOUT_MAX = 0x3FFF
static

Maximum advertising timeout allowed; in seconds.

Definition at line 69 of file GapAdvertisingParams.h.

const uint16_t UNIT_0_625_MS = 625
static

Number of microseconds in 0.625 milliseconds.

Definition at line 170 of file GapAdvertisingParams.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.