Bizan Nishimura / BLE_API

Dependents:   MiniSteer_BLE

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Fri Dec 13 00:41:11 2013 +0000
Revision:
6:425638944835
Parent:
4:50a31ff5f974
Child:
7:5e1f0d7f7c7d
More GAP tweeks, still need to integrate Scan Response since it's more important than I thought

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 6:425638944835 19 ADV_NON_CONNECTABLE_UNDIRECTED, /**< Vol 3, Part C, Section 9.3.2 and Vol 6, Part B, Section 2.3.1.3 */
ktownsend 6:425638944835 20 ADV_SCANNABLE_UNDIRECTED /**< Include support for Scan Response payloads, see Vol 6, Part B, Section 2.3.1.4 */
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 2:ffc5216bd2cc 27
ktownsend 4:50a31ff5f974 28 private:
ktownsend 6:425638944835 29 AdvertisingType _advType;
ktownsend 2:ffc5216bd2cc 30 uint16_t _interval;
ktownsend 2:ffc5216bd2cc 31 uint16_t _timeout;
ktownsend 2:ffc5216bd2cc 32 };
ktownsend 2:ffc5216bd2cc 33
ktownsend 2:ffc5216bd2cc 34 #endif