fork BLE_API to add update adv payload API
Fork of BLE_API by
Diff: public/GapAdvertisingParams.h
- Revision:
- 710:b2e1a2660ec2
- Parent:
- 678:783e390717b4
--- a/public/GapAdvertisingParams.h Fri Jun 19 15:53:06 2015 +0100 +++ b/public/GapAdvertisingParams.h Fri Jun 19 15:53:28 2015 +0100 @@ -39,22 +39,30 @@ static const unsigned GAP_ADV_PARAMS_INTERVAL_MAX = 0x4000; static const unsigned GAP_ADV_PARAMS_TIMEOUT_MAX = 0x3FFF; + /**************************************************************************/ /*! - * Encapsulates the peripheral advertising modes, which determine how - * the device appears to other central devices in hearing range - */ - enum AdvertisingType_t { + \brief + Encapsulates the peripheral advertising modes, which determine how + the device appears to other central devices in hearing range + + \par + See the following for more information on advertising types: + + \li \c Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1 + \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3 + */ + /**************************************************************************/ + enum AdvertisingType { ADV_CONNECTABLE_UNDIRECTED, /**< Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1 */ ADV_CONNECTABLE_DIRECTED, /**< Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2 */ ADV_SCANNABLE_UNDIRECTED, /**< Include support for Scan Response payloads, see Vol 6, Part B, Section 2.3.1.4 */ ADV_NON_CONNECTABLE_UNDIRECTED /**< Vol 3, Part C, Section 9.3.2 and Vol 6, Part B, Section 2.3.1.3 */ }; - typedef enum AdvertisingType_t AdvertisingType; /* deprecated type alias. */ public: - GapAdvertisingParams(AdvertisingType_t advType = ADV_CONNECTABLE_UNDIRECTED, - uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON, - uint16_t timeout = 0) : _advType(advType), _interval(interval), _timeout(timeout) { + GapAdvertisingParams(AdvertisingType advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED, + uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON, + uint16_t timeout = 0) : _advType(advType), _interval(interval), _timeout(timeout) { /* Interval checks */ if (_advType == ADV_CONNECTABLE_DIRECTED) { /* Interval must be 0 in directed connectable mode */ @@ -86,18 +94,18 @@ } } - AdvertisingType_t getAdvertisingType(void) const {return _advType; } - uint16_t getInterval(void) const {return _interval;} - uint16_t getTimeout(void) const {return _timeout; } + AdvertisingType getAdvertisingType(void) const {return _advType; } + uint16_t getInterval(void) const {return _interval;} + uint16_t getTimeout(void) const {return _timeout; } - void setAdvertisingType(AdvertisingType_t newAdvType) {_advType = newAdvType; } - void setInterval(uint16_t newInterval) {_interval = newInterval;} - void setTimeout(uint16_t newTimeout) {_timeout = newTimeout; } + void setAdvertisingType(AdvertisingType newAdvType) {_advType = newAdvType; } + void setInterval(uint16_t newInterval) {_interval = newInterval;} + void setTimeout(uint16_t newTimeout) {_timeout = newTimeout; } private: - AdvertisingType_t _advType; - uint16_t _interval; - uint16_t _timeout; + AdvertisingType _advType; + uint16_t _interval; + uint16_t _timeout; }; #endif // ifndef __GAP_ADVERTISING_PARAMS_H__ \ No newline at end of file