Bizan Nishimura / BLE_API

Dependents:   MiniSteer_BLE

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Tue Jan 07 10:50:31 2014 +0000
Revision:
21:5442f7c70e71
Parent:
18:86fe1e247a54
Child:
27:4a83843f04b0
Improved some doxygen comment

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 21:5442f7c70e71 37 /**************************************************************************/
ktownsend 21:5442f7c70e71 38 /*!
ktownsend 21:5442f7c70e71 39 \brief
ktownsend 21:5442f7c70e71 40 Encapsulates the peripheral advertising modes, which determine how
ktownsend 21:5442f7c70e71 41 the device appears to other central devices in hearing range
ktownsend 21:5442f7c70e71 42
ktownsend 21:5442f7c70e71 43 \par
ktownsend 21:5442f7c70e71 44 See the following for more information on advertising types:
ktownsend 21:5442f7c70e71 45
ktownsend 21:5442f7c70e71 46 \li \c Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1
ktownsend 21:5442f7c70e71 47 \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3
ktownsend 21:5442f7c70e71 48 */
ktownsend 21:5442f7c70e71 49 /**************************************************************************/
ktownsend 6:425638944835 50 enum AdvertisingType
ktownsend 4:50a31ff5f974 51 {
ktownsend 6:425638944835 52 ADV_CONNECTABLE_UNDIRECTED, /**< Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1 */
ktownsend 6:425638944835 53 ADV_CONNECTABLE_DIRECTED, /**< Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2 */
ktownsend 8:780bfa26d0ee 54 ADV_SCANNABLE_UNDIRECTED, /**< Include support for Scan Response payloads, see Vol 6, Part B, Section 2.3.1.4 */
ktownsend 8:780bfa26d0ee 55 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 56 };
ktownsend 4:50a31ff5f974 57
ktownsend 6:425638944835 58 GapAdvertisingParams(AdvertisingType advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED,
ktownsend 14:6ea5d1012a64 59 uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON,
ktownsend 4:50a31ff5f974 60 uint16_t timeout = 0);
ktownsend 2:ffc5216bd2cc 61 virtual ~GapAdvertisingParams(void);
ktownsend 7:5e1f0d7f7c7d 62
ktownsend 7:5e1f0d7f7c7d 63 virtual AdvertisingType getAdvertisingType(void);
ktownsend 9:124ae067ae27 64 virtual uint16_t getInterval(void);
ktownsend 9:124ae067ae27 65 virtual uint16_t getTimeout(void);
ktownsend 2:ffc5216bd2cc 66
ktownsend 4:50a31ff5f974 67 private:
ktownsend 6:425638944835 68 AdvertisingType _advType;
ktownsend 2:ffc5216bd2cc 69 uint16_t _interval;
ktownsend 2:ffc5216bd2cc 70 uint16_t _timeout;
ktownsend 2:ffc5216bd2cc 71 };
ktownsend 2:ffc5216bd2cc 72
ktownsend 2:ffc5216bd2cc 73 #endif