Bizan Nishimura / BLE_API

Dependents:   MiniSteer_BLE

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Wed Dec 18 11:52:37 2013 +0000
Revision:
14:6ea5d1012a64
Parent:
9:124ae067ae27
Child:
18:86fe1e247a54
Fixed advertising interval checks

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 14:6ea5d1012a64 6 #define GAP_ADV_PARAMS_INTERVAL_MIN (0x0020)
ktownsend 14:6ea5d1012a64 7 #define GAP_ADV_PARAMS_INTERVAL_MIN_NONCON (0x00A0)
ktownsend 14:6ea5d1012a64 8 #define GAP_ADV_PARAMS_INTERVAL_MAX (0x1000)
ktownsend 14:6ea5d1012a64 9 #define GAP_ADV_PARAMS_TIMEOUT_MAX (0x3FFF)
ktownsend 4:50a31ff5f974 10
ktownsend 2:ffc5216bd2cc 11 class GapAdvertisingParams
ktownsend 2:ffc5216bd2cc 12 {
ktownsend 4:50a31ff5f974 13 public:
ktownsend 6:425638944835 14 /* See Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1 */
ktownsend 4:50a31ff5f974 15 /* See Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3 */
ktownsend 6:425638944835 16 enum AdvertisingType
ktownsend 4:50a31ff5f974 17 {
ktownsend 6:425638944835 18 ADV_CONNECTABLE_UNDIRECTED, /**< Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1 */
ktownsend 6:425638944835 19 ADV_CONNECTABLE_DIRECTED, /**< Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2 */
ktownsend 8:780bfa26d0ee 20 ADV_SCANNABLE_UNDIRECTED, /**< Include support for Scan Response payloads, see Vol 6, Part B, Section 2.3.1.4 */
ktownsend 8:780bfa26d0ee 21 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 22 };
ktownsend 4:50a31ff5f974 23
ktownsend 6:425638944835 24 GapAdvertisingParams(AdvertisingType advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED,
ktownsend 14:6ea5d1012a64 25 uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON,
ktownsend 4:50a31ff5f974 26 uint16_t timeout = 0);
ktownsend 2:ffc5216bd2cc 27 virtual ~GapAdvertisingParams(void);
ktownsend 7:5e1f0d7f7c7d 28
ktownsend 7:5e1f0d7f7c7d 29 virtual AdvertisingType getAdvertisingType(void);
ktownsend 9:124ae067ae27 30 virtual uint16_t getInterval(void);
ktownsend 9:124ae067ae27 31 virtual uint16_t getTimeout(void);
ktownsend 2:ffc5216bd2cc 32
ktownsend 4:50a31ff5f974 33 private:
ktownsend 6:425638944835 34 AdvertisingType _advType;
ktownsend 2:ffc5216bd2cc 35 uint16_t _interval;
ktownsend 2:ffc5216bd2cc 36 uint16_t _timeout;
ktownsend 2:ffc5216bd2cc 37 };
ktownsend 2:ffc5216bd2cc 38
ktownsend 2:ffc5216bd2cc 39 #endif