Bizan Nishimura / BLE_API

Dependents:   MiniSteer_BLE

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Thu Jan 09 11:03:10 2014 +0000
Revision:
27:4a83843f04b0
Parent:
21:5442f7c70e71
Child:
34:da2ea8cd6216
Matching file names and apache headers

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 27:4a83843f04b0 1 /* mbed Microcontroller Library
ktownsend 27:4a83843f04b0 2 * Copyright (c) 2006-2013 ARM Limited
ktownsend 27:4a83843f04b0 3 *
ktownsend 27:4a83843f04b0 4 * Licensed under the Apache License, Version 2.0 (the "License");
ktownsend 27:4a83843f04b0 5 * you may not use this file except in compliance with the License.
ktownsend 27:4a83843f04b0 6 * You may obtain a copy of the License at
ktownsend 27:4a83843f04b0 7 *
ktownsend 27:4a83843f04b0 8 * http://www.apache.org/licenses/LICENSE-2.0
ktownsend 27:4a83843f04b0 9 *
ktownsend 27:4a83843f04b0 10 * Unless required by applicable law or agreed to in writing, software
ktownsend 27:4a83843f04b0 11 * distributed under the License is distributed on an "AS IS" BASIS,
ktownsend 27:4a83843f04b0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ktownsend 27:4a83843f04b0 13 * See the License for the specific language governing permissions and
ktownsend 27:4a83843f04b0 14 * limitations under the License.
ktownsend 27:4a83843f04b0 15 */
ktownsend 27:4a83843f04b0 16
ktownsend 2:ffc5216bd2cc 17 #ifndef __GAP_ADVERTISING_PARAMS_H__
ktownsend 2:ffc5216bd2cc 18 #define __GAP_ADVERTISING_PARAMS_H__
ktownsend 2:ffc5216bd2cc 19
ktownsend 2:ffc5216bd2cc 20 #include "blecommon.h"
ktownsend 2:ffc5216bd2cc 21
ktownsend 14:6ea5d1012a64 22 #define GAP_ADV_PARAMS_INTERVAL_MIN (0x0020)
ktownsend 14:6ea5d1012a64 23 #define GAP_ADV_PARAMS_INTERVAL_MIN_NONCON (0x00A0)
ktownsend 14:6ea5d1012a64 24 #define GAP_ADV_PARAMS_INTERVAL_MAX (0x1000)
ktownsend 14:6ea5d1012a64 25 #define GAP_ADV_PARAMS_TIMEOUT_MAX (0x3FFF)
ktownsend 4:50a31ff5f974 26
ktownsend 18:86fe1e247a54 27 /**************************************************************************/
ktownsend 18:86fe1e247a54 28 /*!
ktownsend 18:86fe1e247a54 29 \brief
ktownsend 18:86fe1e247a54 30 This class provides a wrapper for the core advertising parameters,
ktownsend 18:86fe1e247a54 31 including the advertising type (Connectable Undirected,
ktownsend 18:86fe1e247a54 32 Non Connectable Undirected, etc.), as well as the advertising and
ktownsend 18:86fe1e247a54 33 timeout intervals.
ktownsend 18:86fe1e247a54 34
ktownsend 18:86fe1e247a54 35 \par
ktownsend 18:86fe1e247a54 36 See the following for more information on advertising types:
ktownsend 18:86fe1e247a54 37
ktownsend 18:86fe1e247a54 38 \li \c Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1
ktownsend 18:86fe1e247a54 39 \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3
ktownsend 18:86fe1e247a54 40
ktownsend 18:86fe1e247a54 41 \par EXAMPLE
ktownsend 18:86fe1e247a54 42
ktownsend 18:86fe1e247a54 43 \code
ktownsend 18:86fe1e247a54 44
ktownsend 18:86fe1e247a54 45 // ToDo
ktownsend 18:86fe1e247a54 46
ktownsend 18:86fe1e247a54 47 \endcode
ktownsend 18:86fe1e247a54 48 */
ktownsend 18:86fe1e247a54 49 /**************************************************************************/
ktownsend 2:ffc5216bd2cc 50 class GapAdvertisingParams
ktownsend 2:ffc5216bd2cc 51 {
ktownsend 4:50a31ff5f974 52 public:
ktownsend 21:5442f7c70e71 53 /**************************************************************************/
ktownsend 21:5442f7c70e71 54 /*!
ktownsend 21:5442f7c70e71 55 \brief
ktownsend 21:5442f7c70e71 56 Encapsulates the peripheral advertising modes, which determine how
ktownsend 21:5442f7c70e71 57 the device appears to other central devices in hearing range
ktownsend 21:5442f7c70e71 58
ktownsend 21:5442f7c70e71 59 \par
ktownsend 21:5442f7c70e71 60 See the following for more information on advertising types:
ktownsend 21:5442f7c70e71 61
ktownsend 21:5442f7c70e71 62 \li \c Bluetooth Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1
ktownsend 21:5442f7c70e71 63 \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3
ktownsend 21:5442f7c70e71 64 */
ktownsend 21:5442f7c70e71 65 /**************************************************************************/
ktownsend 6:425638944835 66 enum AdvertisingType
ktownsend 4:50a31ff5f974 67 {
ktownsend 6:425638944835 68 ADV_CONNECTABLE_UNDIRECTED, /**< Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1 */
ktownsend 6:425638944835 69 ADV_CONNECTABLE_DIRECTED, /**< Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2 */
ktownsend 8:780bfa26d0ee 70 ADV_SCANNABLE_UNDIRECTED, /**< Include support for Scan Response payloads, see Vol 6, Part B, Section 2.3.1.4 */
ktownsend 8:780bfa26d0ee 71 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 72 };
ktownsend 4:50a31ff5f974 73
ktownsend 6:425638944835 74 GapAdvertisingParams(AdvertisingType advType = GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED,
ktownsend 14:6ea5d1012a64 75 uint16_t interval = GAP_ADV_PARAMS_INTERVAL_MIN_NONCON,
ktownsend 4:50a31ff5f974 76 uint16_t timeout = 0);
ktownsend 2:ffc5216bd2cc 77 virtual ~GapAdvertisingParams(void);
ktownsend 7:5e1f0d7f7c7d 78
ktownsend 7:5e1f0d7f7c7d 79 virtual AdvertisingType getAdvertisingType(void);
ktownsend 9:124ae067ae27 80 virtual uint16_t getInterval(void);
ktownsend 9:124ae067ae27 81 virtual uint16_t getTimeout(void);
ktownsend 2:ffc5216bd2cc 82
ktownsend 4:50a31ff5f974 83 private:
ktownsend 6:425638944835 84 AdvertisingType _advType;
ktownsend 2:ffc5216bd2cc 85 uint16_t _interval;
ktownsend 2:ffc5216bd2cc 86 uint16_t _timeout;
ktownsend 2:ffc5216bd2cc 87 };
ktownsend 2:ffc5216bd2cc 88
ktownsend 2:ffc5216bd2cc 89 #endif