17 #ifndef MBED_GAP_ADVERTISING_PARAMS_H__ 18 #define MBED_GAP_ADVERTISING_PARAMS_H__ 129 uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON,
142 if (_interval < GAP_ADV_PARAMS_INTERVAL_MIN_NONCON) {
145 if (_interval > GAP_ADV_PARAMS_INTERVAL_MAX) {
150 if (_interval < GAP_ADV_PARAMS_INTERVAL_MIN) {
153 if (_interval > GAP_ADV_PARAMS_INTERVAL_MAX) {
161 if (_timeout > GAP_ADV_PARAMS_TIMEOUT_MAX) {
193 return (gapUnits * UNIT_0_625_MS) / 1000;
244 _advType = newAdvType;
266 _timeout = newTimeout;
Device is connectable and expects connection from a specific peer.
static uint16_t MSEC_TO_ADVERTISEMENT_DURATION_UNITS(uint32_t durationInMillis)
Convert milliseconds to units of 0.625ms.
void setAdvertisingType(AdvertisingType_t newAdvType)
Update the advertising type.
Parameters defining the advertising process.
AdvertisingType_t getAdvertisingType(void) const
Get the advertising type.
void setTimeout(uint16_t newTimeout)
Update the advertising timeout.
Device is scannable but not connectable.
void setInterval(uint16_t newInterval)
Update the advertising interval in milliseconds.
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.
uint16_t getIntervalInADVUnits(void) const
Get the advertisement interval in units of 0.625ms.
static const unsigned GAP_ADV_PARAMS_INTERVAL_MIN
Minimum Advertising interval for connectable undirected and connectable directed events in 625us unit...
static const unsigned GAP_ADV_PARAMS_INTERVAL_MIN_NONCON
Minimum Advertising interval for scannable and nonconnectable undirected events in 625us units...
static const unsigned GAP_ADV_PARAMS_TIMEOUT_MAX
Maximum advertising timeout allowed; in seconds.
Device is not connectable and not scannable.
AdvertisingType_t
Encapsulates the peripheral advertising modes.
uint16_t getTimeout(void) const
Get the advertising timeout.
uint16_t getInterval(void) const
Get the advertising interval in milliseconds.
static const unsigned GAP_ADV_PARAMS_INTERVAL_MAX
Maximum Advertising interval in 625us units.
static uint16_t ADVERTISEMENT_DURATION_UNITS_TO_MS(uint16_t gapUnits)
Convert units of 0.625ms to milliseconds.
Device is connectable, scannable and doesn't expect connection from a specific peer.
static const uint16_t UNIT_0_625_MS
Number of microseconds in 0.625 milliseconds.
enum AdvertisingType_t AdvertisingType
Alias for GapAdvertisingParams::AdvertisingType_t.