Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_WallbotBLE_Challenge by
GapAdvertisingParams Class Reference
This class provides a wrapper for the core advertising parameters, including the advertising type (Connectable Undirected, Non Connectable Undirected, etc.), as well as the advertising and timeout intervals. More...
#include <GapAdvertisingParams.h>
Public Types | |
enum | AdvertisingType { ADV_CONNECTABLE_UNDIRECTED, ADV_CONNECTABLE_DIRECTED, ADV_SCANNABLE_UNDIRECTED, ADV_NON_CONNECTABLE_UNDIRECTED } |
Encapsulates the peripheral advertising modes, which determine how the device appears to other central devices in hearing range. More... | |
Public Member Functions | |
GapAdvertisingParams (AdvertisingType advType=GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED, uint16_t interval=GAP_ADV_PARAMS_INTERVAL_MIN_NONCON, uint16_t timeout=0) | |
Instantiates a new GapAdvertisingParams instance. | |
virtual | ~GapAdvertisingParams (void) |
virtual AdvertisingType | getAdvertisingType (void) const |
returns the current Advertising Type value | |
virtual uint16_t | getInterval (void) const |
returns the current Advertising Delay (in units of 0.625ms) | |
virtual uint16_t | getTimeout (void) const |
returns the current Advertising Timeout (in seconds) |
Detailed Description
This class provides a wrapper for the core advertising parameters, including the advertising type (Connectable Undirected, Non Connectable Undirected, etc.), as well as the advertising and timeout intervals.
- See the following for more information on advertising types:
Bluetooth
Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1Bluetooth
Core Specification 4.0 (Vol. 3), Part C, Section 9.3
- EXAMPLE
// ToDo
Definition at line 50 of file GapAdvertisingParams.h.
Member Enumeration Documentation
enum AdvertisingType |
Encapsulates the peripheral advertising modes, which determine how the device appears to other central devices in hearing range.
- See the following for more information on advertising types:
Bluetooth
Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1Bluetooth
Core Specification 4.0 (Vol. 3), Part C, Section 9.3
- Enumerator:
Definition at line 66 of file GapAdvertisingParams.h.
Constructor & Destructor Documentation
GapAdvertisingParams | ( | AdvertisingType | advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED , |
uint16_t | interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON , |
||
uint16_t | timeout = 0 |
||
) |
Instantiates a new GapAdvertisingParams instance.
- Parameters:
-
[in] advType The GAP advertising mode to use for this device. Valid values are defined in AdvertisingType:
- ADV_NON_CONNECTABLE_UNDIRECTED
- All connections to the peripheral device will be refused.
- ADV_CONNECTABLE_DIRECTED
- Only connections from a pre-defined central device will be accepted.
- ADV_CONNECTABLE_UNDIRECTED
- Any central device can connect to this peripheral.
- ADV_SCANNABLE_UNDIRECTED
- Any central device can connect to this peripheral, and the secondary Scan Response payload will be included or available to central devices.
- See Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3 and Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1 for further information on GAP connection modes
- Parameters:
-
[in] interval Advertising interval between 0x0020 and 0x4000 in 0.625ms units (20ms to 10.24s). If using non-connectable mode (ADV_NON_CONNECTABLE_UNDIRECTED) this min value is 0x00A0 (100ms). To reduce the likelihood of collisions, the link layer perturbs this interval by a pseudo-random delay with a range of 0 ms to 10 ms for each advertising event.
- Decreasing this value will allow central devices to detect your peripheral faster at the expense of more power being used by the radio due to the higher data transmit rate.
- This field must be set to 0 if connectionMode is equal to ADV_CONNECTABLE_DIRECTED
- See Bluetooth Core Specification, Vol 3., Part C, Appendix A for suggested advertising intervals.
- Parameters:
-
[in] timeout Advertising timeout between 0x1 and 0x3FFF (1 and 16383) in seconds. Enter 0 to disable the advertising timeout.
- EXAMPLE
Definition at line 85 of file GapAdvertisingParams.cpp.
~GapAdvertisingParams | ( | void | ) | [virtual] |
Destructor
Definition at line 127 of file GapAdvertisingParams.cpp.
Member Function Documentation
GapAdvertisingParams::AdvertisingType getAdvertisingType | ( | void | ) | const [virtual] |
returns the current Advertising Type value
Definition at line 114 of file GapAdvertisingParams.h.
uint16_t getInterval | ( | void | ) | const [virtual] |
returns the current Advertising Delay (in units of 0.625ms)
Definition at line 125 of file GapAdvertisingParams.h.
uint16_t getTimeout | ( | void | ) | const [virtual] |
returns the current Advertising Timeout (in seconds)
Definition at line 136 of file GapAdvertisingParams.h.
Generated on Tue Jul 12 2022 13:52:34 by
