Bizan Nishimura / BLE_API

Dependents:   MiniSteer_BLE

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Wed Dec 18 19:39:19 2013 +0000
Revision:
18:86fe1e247a54
Parent:
14:6ea5d1012a64
Child:
21:5442f7c70e71
Doxygen Cleanup

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 18:86fe1e247a54 11 /**************************************************************************/
ktownsend 18:86fe1e247a54 12 /*!
ktownsend 18:86fe1e247a54 13 \brief
ktownsend 18:86fe1e247a54 14 This class provides a wrapper for the core advertising parameters,
ktownsend 18:86fe1e247a54 15 including the advertising type (Connectable Undirected,
ktownsend 18:86fe1e247a54 16 Non Connectable Undirected, etc.), as well as the advertising and
ktownsend 18:86fe1e247a54 17 timeout intervals.
ktownsend 18:86fe1e247a54 18
ktownsend 18:86fe1e247a54 19 \par
ktownsend 18:86fe1e247a54 20 See the following for more information on advertising types:
ktownsend 18:86fe1e247a54 21
ktownsend 18:86fe1e247a54 22 \li \c Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1
ktownsend 18:86fe1e247a54 23 \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3
ktownsend 18:86fe1e247a54 24
ktownsend 18:86fe1e247a54 25 \par EXAMPLE
ktownsend 18:86fe1e247a54 26
ktownsend 18:86fe1e247a54 27 \code
ktownsend 18:86fe1e247a54 28
ktownsend 18:86fe1e247a54 29 // ToDo
ktownsend 18:86fe1e247a54 30
ktownsend 18:86fe1e247a54 31 \endcode
ktownsend 18:86fe1e247a54 32 */
ktownsend 18:86fe1e247a54 33 /**************************************************************************/
ktownsend 2:ffc5216bd2cc 34 class GapAdvertisingParams
ktownsend 2:ffc5216bd2cc 35 {
ktownsend 4:50a31ff5f974 36 public:
ktownsend 6:425638944835 37 /* See Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1 */
ktownsend 4:50a31ff5f974 38 /* See Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3 */
ktownsend 6:425638944835 39 enum AdvertisingType
ktownsend 4:50a31ff5f974 40 {
ktownsend 6:425638944835 41 ADV_CONNECTABLE_UNDIRECTED, /**< Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1 */
ktownsend 6:425638944835 42 ADV_CONNECTABLE_DIRECTED, /**< Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2 */
ktownsend 8:780bfa26d0ee 43 ADV_SCANNABLE_UNDIRECTED, /**< Include support for Scan Response payloads, see Vol 6, Part B, Section 2.3.1.4 */
ktownsend 8:780bfa26d0ee 44 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 45 };
ktownsend 4:50a31ff5f974 46
ktownsend 6:425638944835 47 GapAdvertisingParams(AdvertisingType advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED,
ktownsend 14:6ea5d1012a64 48 uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON,
ktownsend 4:50a31ff5f974 49 uint16_t timeout = 0);
ktownsend 2:ffc5216bd2cc 50 virtual ~GapAdvertisingParams(void);
ktownsend 7:5e1f0d7f7c7d 51
ktownsend 7:5e1f0d7f7c7d 52 virtual AdvertisingType getAdvertisingType(void);
ktownsend 9:124ae067ae27 53 virtual uint16_t getInterval(void);
ktownsend 9:124ae067ae27 54 virtual uint16_t getTimeout(void);
ktownsend 2:ffc5216bd2cc 55
ktownsend 4:50a31ff5f974 56 private:
ktownsend 6:425638944835 57 AdvertisingType _advType;
ktownsend 2:ffc5216bd2cc 58 uint16_t _interval;
ktownsend 2:ffc5216bd2cc 59 uint16_t _timeout;
ktownsend 2:ffc5216bd2cc 60 };
ktownsend 2:ffc5216bd2cc 61
ktownsend 2:ffc5216bd2cc 62 #endif