Microbug / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Mon Dec 16 18:16:01 2013 +0000
Revision:
8:780bfa26d0ee
Parent:
7:5e1f0d7f7c7d
Child:
9:124ae067ae27
Fixed AdvertisingType enum values

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 2:ffc5216bd2cc 1 #ifndef __GAP_ADVERTISING_PARAMS_H__
ktownsend 2:ffc5216bd2cc 2 #define __GAP_ADVERTISING_PARAMS_H__
ktownsend 2:ffc5216bd2cc 3
ktownsend 2:ffc5216bd2cc 4 #include "blecommon.h"
ktownsend 2:ffc5216bd2cc 5
ktownsend 4:50a31ff5f974 6 #define GAP_ADV_PARAMS_INTERVAL_MIN (0x0020)
ktownsend 4:50a31ff5f974 7 #define GAP_ADV_PARAMS_INTERVAL_MAX (0x4000)
ktownsend 4:50a31ff5f974 8 #define GAP_ADV_PARAMS_TIMEOUT_MAX (0x3FFF)
ktownsend 4:50a31ff5f974 9
ktownsend 2:ffc5216bd2cc 10 class GapAdvertisingParams
ktownsend 2:ffc5216bd2cc 11 {
ktownsend 4:50a31ff5f974 12 public:
ktownsend 6:425638944835 13 /* See Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1 */
ktownsend 4:50a31ff5f974 14 /* See Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3 */
ktownsend 6:425638944835 15 enum AdvertisingType
ktownsend 4:50a31ff5f974 16 {
ktownsend 6:425638944835 17 ADV_CONNECTABLE_UNDIRECTED, /**< Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1 */
ktownsend 6:425638944835 18 ADV_CONNECTABLE_DIRECTED, /**< Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2 */
ktownsend 8:780bfa26d0ee 19 ADV_SCANNABLE_UNDIRECTED, /**< Include support for Scan Response payloads, see Vol 6, Part B, Section 2.3.1.4 */
ktownsend 8:780bfa26d0ee 20 ADV_NON_CONNECTABLE_UNDIRECTED /**< Vol 3, Part C, Section 9.3.2 and Vol 6, Part B, Section 2.3.1.3 */
ktownsend 4:50a31ff5f974 21 };
ktownsend 4:50a31ff5f974 22
ktownsend 6:425638944835 23 GapAdvertisingParams(AdvertisingType advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED,
ktownsend 6:425638944835 24 uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN,
ktownsend 4:50a31ff5f974 25 uint16_t timeout = 0);
ktownsend 2:ffc5216bd2cc 26 virtual ~GapAdvertisingParams(void);
ktownsend 7:5e1f0d7f7c7d 27
ktownsend 7:5e1f0d7f7c7d 28 virtual AdvertisingType getAdvertisingType(void);
ktownsend 2:ffc5216bd2cc 29
ktownsend 4:50a31ff5f974 30 private:
ktownsend 6:425638944835 31 AdvertisingType _advType;
ktownsend 2:ffc5216bd2cc 32 uint16_t _interval;
ktownsend 2:ffc5216bd2cc 33 uint16_t _timeout;
ktownsend 2:ffc5216bd2cc 34 };
ktownsend 2:ffc5216bd2cc 35
ktownsend 2:ffc5216bd2cc 36 #endif