High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Diff: GapAdvertisingParams.h
- Revision:
- 4:50a31ff5f974
- Parent:
- 2:ffc5216bd2cc
- Child:
- 6:425638944835
--- a/GapAdvertisingParams.h Wed Dec 11 22:15:59 2013 +0000 +++ b/GapAdvertisingParams.h Thu Dec 12 02:20:54 2013 +0000 @@ -3,14 +3,28 @@ #include "blecommon.h" +#define GAP_ADV_PARAMS_INTERVAL_MIN (0x0020) +#define GAP_ADV_PARAMS_INTERVAL_MAX (0x4000) +#define GAP_ADV_PARAMS_TIMEOUT_MAX (0x3FFF) + class GapAdvertisingParams { -public: - GapAdvertisingParams(uint8_t advType, uint16_t interval, uint16_t timeout); + public: + /* See Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3 */ + enum ConnectionMode + { + NON_CONNECTABLE, /**< Section 9.3.2 */ + DIRECTED_CONNECTABLE, /**< Section 9.3.3 */ + UNDIRECTED_CONNECTABLE /**< Section 9.3.4 */ + }; + + GapAdvertisingParams(ConnectionMode connectionMode = GapAdvertisingParams::UNDIRECTED_CONNECTABLE, + uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN, + uint16_t timeout = 0); virtual ~GapAdvertisingParams(void); -private: - uint8_t _advType; + private: + ConnectionMode _connectionMode; uint16_t _interval; uint16_t _timeout; };