GapAdvertisingParams: rename type to AdvertisingType_t

This commit is contained in:
Rohit Grover 2015-06-17 14:16:43 +01:00
parent 0e9fdf09a7
commit 93ef520e62

View file

@ -39,30 +39,22 @@ public:
static const unsigned GAP_ADV_PARAMS_INTERVAL_MAX = 0x4000;
static const unsigned GAP_ADV_PARAMS_TIMEOUT_MAX = 0x3FFF;
/**************************************************************************/
/*!
\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 {
* Encapsulates the peripheral advertising modes, which determine how
* the device appears to other central devices in hearing range
*/
enum AdvertisingType_t {
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 advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED,
uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON,
uint16_t timeout = 0) : _advType(advType), _interval(interval), _timeout(timeout) {
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) {
/* Interval checks */
if (_advType == ADV_CONNECTABLE_DIRECTED) {
/* Interval must be 0 in directed connectable mode */
@ -94,18 +86,18 @@ public:
}
}
AdvertisingType getAdvertisingType(void) const {return _advType; }
uint16_t getInterval(void) const {return _interval;}
uint16_t getTimeout(void) const {return _timeout; }
AdvertisingType_t getAdvertisingType(void) const {return _advType; }
uint16_t getInterval(void) const {return _interval;}
uint16_t getTimeout(void) const {return _timeout; }
void setAdvertisingType(AdvertisingType newAdvType) {_advType = newAdvType; }
void setInterval(uint16_t newInterval) {_interval = newInterval;}
void setTimeout(uint16_t newTimeout) {_timeout = newTimeout; }
void setAdvertisingType(AdvertisingType_t newAdvType) {_advType = newAdvType; }
void setInterval(uint16_t newInterval) {_interval = newInterval;}
void setTimeout(uint16_t newTimeout) {_timeout = newTimeout; }
private:
AdvertisingType _advType;
uint16_t _interval;
uint16_t _timeout;
AdvertisingType_t _advType;
uint16_t _interval;
uint16_t _timeout;
};
#endif // ifndef __GAP_ADVERTISING_PARAMS_H__