Compatible with Keewi v1
Fork of BLE_API by
GapAdvertisingData.h@68:dcadab8a56dd, 2014-06-05 (annotated)
- Committer:
- Rohit Grover
- Date:
- Thu Jun 05 08:52:20 2014 +0100
- Revision:
- 68:dcadab8a56dd
- Parent:
- 47:33f605e109a2
- Child:
- 96:6f4c8e545d38
white space diffs
Who changed what in which revision?
User | Revision | Line number | New 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 | */ |
Rohit Grover |
34:da2ea8cd6216 | 16 | |
ktownsend | 2:ffc5216bd2cc | 17 | #ifndef __GAP_ADVERTISING_DATA_H__ |
ktownsend | 2:ffc5216bd2cc | 18 | #define __GAP_ADVERTISING_DATA_H__ |
ktownsend | 2:ffc5216bd2cc | 19 | |
ktownsend | 2:ffc5216bd2cc | 20 | #include "blecommon.h" |
ktownsend | 2:ffc5216bd2cc | 21 | |
ktownsend | 3:46de446e82ed | 22 | #define GAP_ADVERTISING_DATA_MAX_PAYLOAD (31) |
ktownsend | 3:46de446e82ed | 23 | |
ktownsend | 3:46de446e82ed | 24 | /**************************************************************************/ |
ktownsend | 3:46de446e82ed | 25 | /*! |
ktownsend | 18:86fe1e247a54 | 26 | \brief |
ktownsend | 3:46de446e82ed | 27 | This class provides several helper functions to generate properly |
ktownsend | 3:46de446e82ed | 28 | formatted GAP Advertising and Scan Response data payloads |
ktownsend | 4:50a31ff5f974 | 29 | |
Rohit Grover |
34:da2ea8cd6216 | 30 | \note |
ktownsend | 18:86fe1e247a54 | 31 | See Bluetooth Specification 4.0 (Vol. 3), Part C, Section 11 and 18 |
ktownsend | 4:50a31ff5f974 | 32 | for further information on Advertising and Scan Response data. |
Rohit Grover |
34:da2ea8cd6216 | 33 | |
ktownsend | 18:86fe1e247a54 | 34 | \par Advertising and Scan Response Payloads |
ktownsend | 3:46de446e82ed | 35 | Advertising data and Scan Response data are organized around a set of |
ktownsend | 4:50a31ff5f974 | 36 | data types called 'AD types' in Bluetooth 4.0 (see the Bluetooth Core |
ktownsend | 4:50a31ff5f974 | 37 | Specification v4.0, Vol. 3, Part C, Sections 11 and 18). |
ktownsend | 4:50a31ff5f974 | 38 | |
ktownsend | 18:86fe1e247a54 | 39 | \par |
ktownsend | 3:46de446e82ed | 40 | Each AD type has it's own standardized 'assigned number', as defined |
ktownsend | 3:46de446e82ed | 41 | by the Bluetooth SIG: |
ktownsend | 3:46de446e82ed | 42 | https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile |
Rohit Grover |
34:da2ea8cd6216 | 43 | |
ktownsend | 18:86fe1e247a54 | 44 | \par |
ktownsend | 3:46de446e82ed | 45 | For convenience sake, all appropriate AD types have been encapsulated |
ktownsend | 18:86fe1e247a54 | 46 | into GapAdvertisingData::DataType. |
Rohit Grover |
34:da2ea8cd6216 | 47 | |
ktownsend | 18:86fe1e247a54 | 48 | \par |
ktownsend | 4:50a31ff5f974 | 49 | Before the AD Types and their payload (if any) can be inserted into |
ktownsend | 4:50a31ff5f974 | 50 | the Advertising or Scan Response frames, they need to be formatted as |
ktownsend | 4:50a31ff5f974 | 51 | follows: |
Rohit Grover |
34:da2ea8cd6216 | 52 | |
ktownsend | 18:86fe1e247a54 | 53 | \li \c Record length (1 byte) |
ktownsend | 18:86fe1e247a54 | 54 | \li \c AD Type (1 byte) |
ktownsend | 18:86fe1e247a54 | 55 | \li \c AD payload (optional, only present if record length > 1) |
Rohit Grover |
34:da2ea8cd6216 | 56 | |
ktownsend | 18:86fe1e247a54 | 57 | \par |
ktownsend | 5:7635f81a8e09 | 58 | This class takes care of properly formatting the payload, performs |
ktownsend | 5:7635f81a8e09 | 59 | some basic checks on the payload length, and tries to avoid common |
ktownsend | 5:7635f81a8e09 | 60 | errors like adding an exclusive AD field twice in the Advertising |
ktownsend | 5:7635f81a8e09 | 61 | or Scan Response payload. |
Rohit Grover |
34:da2ea8cd6216 | 62 | |
ktownsend | 18:86fe1e247a54 | 63 | \par EXAMPLE |
Rohit Grover |
34:da2ea8cd6216 | 64 | |
ktownsend | 18:86fe1e247a54 | 65 | \code |
Rohit Grover |
34:da2ea8cd6216 | 66 | |
ktownsend | 5:7635f81a8e09 | 67 | // ToDo |
Rohit Grover |
34:da2ea8cd6216 | 68 | |
ktownsend | 18:86fe1e247a54 | 69 | \endcode |
ktownsend | 3:46de446e82ed | 70 | */ |
ktownsend | 3:46de446e82ed | 71 | /**************************************************************************/ |
ktownsend | 2:ffc5216bd2cc | 72 | class GapAdvertisingData |
ktownsend | 2:ffc5216bd2cc | 73 | { |
Rohit Grover |
34:da2ea8cd6216 | 74 | public: |
ktownsend | 19:a6f33421746c | 75 | /**********************************************************************/ |
ktownsend | 19:a6f33421746c | 76 | /*! |
ktownsend | 19:a6f33421746c | 77 | \brief |
ktownsend | 19:a6f33421746c | 78 | A list of Advertising Data types commonly used by peripherals. |
ktownsend | 19:a6f33421746c | 79 | These AD types are used to describe the capabilities of the |
ktownsend | 19:a6f33421746c | 80 | peripheral, and get inserted inside the advertising or scan |
ktownsend | 19:a6f33421746c | 81 | response payloads. |
Rohit Grover |
34:da2ea8cd6216 | 82 | |
ktownsend | 19:a6f33421746c | 83 | \par Source |
ktownsend | 19:a6f33421746c | 84 | \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 11, 18 |
ktownsend | 19:a6f33421746c | 85 | \li \c https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile |
ktownsend | 19:a6f33421746c | 86 | */ |
ktownsend | 19:a6f33421746c | 87 | /**********************************************************************/ |
ktownsend | 4:50a31ff5f974 | 88 | enum DataType |
ktownsend | 4:50a31ff5f974 | 89 | { |
Rohit Grover |
34:da2ea8cd6216 | 90 | FLAGS = 0x01, /**< \ref |
Rohit Grover |
34:da2ea8cd6216 | 91 | *Flags */ |
Rohit Grover |
34:da2ea8cd6216 | 92 | INCOMPLETE_LIST_16BIT_SERVICE_IDS = 0x02, /**< |
Rohit Grover |
34:da2ea8cd6216 | 93 | *Incomplete |
Rohit Grover |
34:da2ea8cd6216 | 94 | *list of |
Rohit Grover |
34:da2ea8cd6216 | 95 | *16-bit |
Rohit Grover |
34:da2ea8cd6216 | 96 | *Service IDs |
Rohit Grover |
34:da2ea8cd6216 | 97 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 98 | COMPLETE_LIST_16BIT_SERVICE_IDS = 0x03, /**< Complete |
Rohit Grover |
34:da2ea8cd6216 | 99 | *list of |
Rohit Grover |
34:da2ea8cd6216 | 100 | *16-bit |
Rohit Grover |
34:da2ea8cd6216 | 101 | *Service IDs |
Rohit Grover |
34:da2ea8cd6216 | 102 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 103 | INCOMPLETE_LIST_32BIT_SERVICE_IDS = 0x04, /**< |
Rohit Grover |
34:da2ea8cd6216 | 104 | *Incomplete |
Rohit Grover |
34:da2ea8cd6216 | 105 | *list of |
Rohit Grover |
34:da2ea8cd6216 | 106 | *32-bit |
Rohit Grover |
34:da2ea8cd6216 | 107 | *Service IDs |
Rohit Grover |
34:da2ea8cd6216 | 108 | *(not |
Rohit Grover |
34:da2ea8cd6216 | 109 | *relevant for |
Rohit Grover |
34:da2ea8cd6216 | 110 | *Bluetooth |
Rohit Grover |
34:da2ea8cd6216 | 111 | *4.0) */ |
Rohit Grover |
34:da2ea8cd6216 | 112 | COMPLETE_LIST_32BIT_SERVICE_IDS = 0x05, /**< Complete |
Rohit Grover |
34:da2ea8cd6216 | 113 | *list of |
Rohit Grover |
34:da2ea8cd6216 | 114 | *32-bit |
Rohit Grover |
34:da2ea8cd6216 | 115 | *Service IDs |
Rohit Grover |
34:da2ea8cd6216 | 116 | *(not |
Rohit Grover |
34:da2ea8cd6216 | 117 | *relevant for |
Rohit Grover |
34:da2ea8cd6216 | 118 | *Bluetooth |
Rohit Grover |
34:da2ea8cd6216 | 119 | *4.0) */ |
Rohit Grover |
34:da2ea8cd6216 | 120 | INCOMPLETE_LIST_128BIT_SERVICE_IDS = 0x06, /**< |
Rohit Grover |
34:da2ea8cd6216 | 121 | *Incomplete |
Rohit Grover |
34:da2ea8cd6216 | 122 | *list of |
Rohit Grover |
34:da2ea8cd6216 | 123 | *128-bit |
Rohit Grover |
34:da2ea8cd6216 | 124 | *Service IDs |
Rohit Grover |
34:da2ea8cd6216 | 125 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 126 | COMPLETE_LIST_128BIT_SERVICE_IDS = 0x07, /**< Complete |
Rohit Grover |
34:da2ea8cd6216 | 127 | *list of |
Rohit Grover |
34:da2ea8cd6216 | 128 | *128-bit |
Rohit Grover |
34:da2ea8cd6216 | 129 | *Service IDs |
Rohit Grover |
34:da2ea8cd6216 | 130 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 131 | SHORTENED_LOCAL_NAME = 0x08, /**< Shortened |
Rohit Grover |
34:da2ea8cd6216 | 132 | *Local Name |
Rohit Grover |
34:da2ea8cd6216 | 133 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 134 | COMPLETE_LOCAL_NAME = 0x09, /**< Complete |
Rohit Grover |
34:da2ea8cd6216 | 135 | *Local Name |
Rohit Grover |
34:da2ea8cd6216 | 136 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 137 | TX_POWER_LEVEL = 0x0A, /**< TX Power |
Rohit Grover |
34:da2ea8cd6216 | 138 | *Level (in |
Rohit Grover |
34:da2ea8cd6216 | 139 | *dBm) */ |
Rohit Grover |
34:da2ea8cd6216 | 140 | DEVICE_ID = 0x10, /**< Device ID |
Rohit Grover |
34:da2ea8cd6216 | 141 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 142 | SLAVE_CONNECTION_INTERVAL_RANGE = 0x12, /**< Slave |
Rohit Grover |
34:da2ea8cd6216 | 143 | *Connection |
Rohit Grover |
34:da2ea8cd6216 | 144 | *Interval |
Rohit Grover |
34:da2ea8cd6216 | 145 | *Range */ |
Rohit Grover |
34:da2ea8cd6216 | 146 | SERVICE_DATA = 0x16, /**< Service |
Rohit Grover |
34:da2ea8cd6216 | 147 | *Data */ |
Rohit Grover |
34:da2ea8cd6216 | 148 | APPEARANCE = 0x19, /**< \ref |
Rohit Grover |
34:da2ea8cd6216 | 149 | *Appearance |
Rohit Grover |
34:da2ea8cd6216 | 150 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 151 | ADVERTISING_INTERVAL = 0x1A, /**< |
Rohit Grover |
34:da2ea8cd6216 | 152 | *Advertising |
Rohit Grover |
34:da2ea8cd6216 | 153 | *Interval */ |
Rohit Grover |
34:da2ea8cd6216 | 154 | MANUFACTURER_SPECIFIC_DATA = 0xFF /**< |
Rohit Grover |
34:da2ea8cd6216 | 155 | *Manufacturer |
Rohit Grover |
34:da2ea8cd6216 | 156 | *Specific |
Rohit Grover |
34:da2ea8cd6216 | 157 | *Data */ |
ktownsend | 4:50a31ff5f974 | 158 | }; |
Rohit Grover |
34:da2ea8cd6216 | 159 | |
ktownsend | 19:a6f33421746c | 160 | /**********************************************************************/ |
ktownsend | 19:a6f33421746c | 161 | /*! |
ktownsend | 19:a6f33421746c | 162 | \brief |
ktownsend | 19:a6f33421746c | 163 | A list of values for the FLAGS AD Type |
Rohit Grover |
34:da2ea8cd6216 | 164 | |
ktownsend | 19:a6f33421746c | 165 | \note |
ktownsend | 19:a6f33421746c | 166 | You can use more than one value in the FLAGS AD Type (ex. |
ktownsend | 19:a6f33421746c | 167 | LE_GENERAL_DISCOVERABLE and BREDR_NOT_SUPPORTED). |
Rohit Grover |
34:da2ea8cd6216 | 168 | |
ktownsend | 19:a6f33421746c | 169 | \par Source |
ktownsend | 19:a6f33421746c | 170 | \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 18.1 |
ktownsend | 19:a6f33421746c | 171 | */ |
ktownsend | 19:a6f33421746c | 172 | /**********************************************************************/ |
ktownsend | 4:50a31ff5f974 | 173 | enum Flags |
ktownsend | 4:50a31ff5f974 | 174 | { |
Rohit Grover |
34:da2ea8cd6216 | 175 | LE_LIMITED_DISCOVERABLE = 0x01, /**< |
Rohit Grover |
34:da2ea8cd6216 | 176 | *Peripheral |
Rohit Grover |
34:da2ea8cd6216 | 177 | *device is |
Rohit Grover |
34:da2ea8cd6216 | 178 | *discoverable |
Rohit Grover |
34:da2ea8cd6216 | 179 | *for a |
Rohit Grover |
34:da2ea8cd6216 | 180 | *limited |
Rohit Grover |
34:da2ea8cd6216 | 181 | *period of |
Rohit Grover |
34:da2ea8cd6216 | 182 | *time */ |
Rohit Grover |
34:da2ea8cd6216 | 183 | LE_GENERAL_DISCOVERABLE = 0x02, /**< |
Rohit Grover |
34:da2ea8cd6216 | 184 | *Peripheral |
Rohit Grover |
34:da2ea8cd6216 | 185 | *device is |
Rohit Grover |
34:da2ea8cd6216 | 186 | *discoverable |
Rohit Grover |
34:da2ea8cd6216 | 187 | *at any |
Rohit Grover |
34:da2ea8cd6216 | 188 | *moment */ |
Rohit Grover |
34:da2ea8cd6216 | 189 | BREDR_NOT_SUPPORTED = 0x04, /**< |
Rohit Grover |
34:da2ea8cd6216 | 190 | *Peripheral |
Rohit Grover |
34:da2ea8cd6216 | 191 | *device is LE |
Rohit Grover |
34:da2ea8cd6216 | 192 | *only */ |
Rohit Grover |
34:da2ea8cd6216 | 193 | SIMULTANEOUS_LE_BREDR_C = 0x08, /**< Not |
Rohit Grover |
34:da2ea8cd6216 | 194 | *relevant - |
Rohit Grover |
34:da2ea8cd6216 | 195 | *central mode |
Rohit Grover |
34:da2ea8cd6216 | 196 | *only */ |
Rohit Grover |
34:da2ea8cd6216 | 197 | SIMULTANEOUS_LE_BREDR_H = 0x10 /**< Not |
Rohit Grover |
34:da2ea8cd6216 | 198 | *relevant - |
Rohit Grover |
34:da2ea8cd6216 | 199 | *central mode |
Rohit Grover |
34:da2ea8cd6216 | 200 | *only */ |
ktownsend | 4:50a31ff5f974 | 201 | }; |
ktownsend | 4:50a31ff5f974 | 202 | |
ktownsend | 19:a6f33421746c | 203 | /**********************************************************************/ |
ktownsend | 19:a6f33421746c | 204 | /*! |
ktownsend | 19:a6f33421746c | 205 | \brief |
ktownsend | 19:a6f33421746c | 206 | A list of values for the APPEARANCE AD Type, which describes the |
ktownsend | 19:a6f33421746c | 207 | physical shape or appearance of the device |
Rohit Grover |
34:da2ea8cd6216 | 208 | |
ktownsend | 19:a6f33421746c | 209 | \par Source |
ktownsend | 19:a6f33421746c | 210 | \li \c Bluetooth Core Specification Supplement, Part A, Section 1.12 |
ktownsend | 19:a6f33421746c | 211 | \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 12.2 |
ktownsend | 19:a6f33421746c | 212 | \li \c https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml |
ktownsend | 19:a6f33421746c | 213 | */ |
ktownsend | 19:a6f33421746c | 214 | /**********************************************************************/ |
ktownsend | 4:50a31ff5f974 | 215 | enum Appearance |
ktownsend | 4:50a31ff5f974 | 216 | { |
Rohit Grover |
34:da2ea8cd6216 | 217 | UNKNOWN = 0, /**< Unknown |
Rohit Grover |
34:da2ea8cd6216 | 218 | *of |
Rohit Grover |
34:da2ea8cd6216 | 219 | *unspecified |
Rohit Grover |
34:da2ea8cd6216 | 220 | *appearance |
Rohit Grover |
34:da2ea8cd6216 | 221 | *type */ |
Rohit Grover |
34:da2ea8cd6216 | 222 | GENERIC_PHONE = 64, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 223 | *Phone */ |
Rohit Grover |
34:da2ea8cd6216 | 224 | GENERIC_COMPUTER = 128, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 225 | *Computer */ |
Rohit Grover |
34:da2ea8cd6216 | 226 | GENERIC_WATCH = 192, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 227 | *Watch */ |
Rohit Grover |
34:da2ea8cd6216 | 228 | WATCH_SPORTS_WATCH = 193, /**< Sports |
Rohit Grover |
34:da2ea8cd6216 | 229 | *Watch */ |
Rohit Grover |
34:da2ea8cd6216 | 230 | GENERIC_CLOCK = 256, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 231 | *Clock */ |
Rohit Grover |
34:da2ea8cd6216 | 232 | GENERIC_DISPLAY = 320, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 233 | *Display */ |
Rohit Grover |
34:da2ea8cd6216 | 234 | GENERIC_REMOTE_CONTROL = 384, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 235 | *Remote |
Rohit Grover |
34:da2ea8cd6216 | 236 | *Control */ |
Rohit Grover |
34:da2ea8cd6216 | 237 | GENERIC_EYE_GLASSES = 448, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 238 | *Eye Glasses |
Rohit Grover |
34:da2ea8cd6216 | 239 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 240 | GENERIC_TAG = 512, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 241 | *Tag */ |
Rohit Grover |
34:da2ea8cd6216 | 242 | GENERIC_KEYRING = 576, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 243 | *Keyring */ |
Rohit Grover |
34:da2ea8cd6216 | 244 | GENERIC_MEDIA_PLAYER = 640, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 245 | *Media Player |
Rohit Grover |
34:da2ea8cd6216 | 246 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 247 | GENERIC_BARCODE_SCANNER = 704, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 248 | *Barcode |
Rohit Grover |
34:da2ea8cd6216 | 249 | *Scanner */ |
Rohit Grover |
34:da2ea8cd6216 | 250 | GENERIC_THERMOMETER = 768, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 251 | *Thermometer |
Rohit Grover |
34:da2ea8cd6216 | 252 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 253 | THERMOMETER_EAR = 769, /**< Ear |
Rohit Grover |
34:da2ea8cd6216 | 254 | *Thermometer |
Rohit Grover |
34:da2ea8cd6216 | 255 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 256 | GENERIC_HEART_RATE_SENSOR = 832, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 257 | *Heart Rate |
Rohit Grover |
34:da2ea8cd6216 | 258 | *Sensor */ |
Rohit Grover |
34:da2ea8cd6216 | 259 | HEART_RATE_SENSOR_HEART_RATE_BELT = 833, /**< Belt |
Rohit Grover |
34:da2ea8cd6216 | 260 | *Heart Rate |
Rohit Grover |
34:da2ea8cd6216 | 261 | *Sensor */ |
Rohit Grover |
34:da2ea8cd6216 | 262 | GENERIC_BLOOD_PRESSURE = 896, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 263 | *Blood |
Rohit Grover |
34:da2ea8cd6216 | 264 | *Pressure */ |
Rohit Grover |
34:da2ea8cd6216 | 265 | BLOOD_PRESSURE_ARM = 897, /**< Arm Blood |
Rohit Grover |
34:da2ea8cd6216 | 266 | *Pressure */ |
Rohit Grover |
34:da2ea8cd6216 | 267 | BLOOD_PRESSURE_WRIST = 898, /**< Wrist |
Rohit Grover |
34:da2ea8cd6216 | 268 | *Blood |
Rohit Grover |
34:da2ea8cd6216 | 269 | *Pressure */ |
Rohit Grover |
34:da2ea8cd6216 | 270 | HUMAN_INTERFACE_DEVICE_HID = 960, /**< Human |
Rohit Grover |
34:da2ea8cd6216 | 271 | *Interface |
Rohit Grover |
34:da2ea8cd6216 | 272 | *Device (HID) |
Rohit Grover |
34:da2ea8cd6216 | 273 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 274 | KEYBOARD = 961, /**< Keyboard |
Rohit Grover |
34:da2ea8cd6216 | 275 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 276 | MOUSE = 962, /**< Mouse */ |
Rohit Grover |
34:da2ea8cd6216 | 277 | JOYSTICK = 963, /**< Joystick |
Rohit Grover |
34:da2ea8cd6216 | 278 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 279 | GAMEPAD = 964, /**< Gamepad |
Rohit Grover |
34:da2ea8cd6216 | 280 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 281 | DIGITIZER_TABLET = 965, /**< Digitizer |
Rohit Grover |
34:da2ea8cd6216 | 282 | *Tablet */ |
Rohit Grover |
34:da2ea8cd6216 | 283 | CARD_READER = 966, /**< Card Read |
Rohit Grover |
34:da2ea8cd6216 | 284 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 285 | DIGITAL_PEN = 967, /**< Digital |
Rohit Grover |
34:da2ea8cd6216 | 286 | *Pen */ |
Rohit Grover |
34:da2ea8cd6216 | 287 | BARCODE_SCANNER = 968, /**< Barcode |
Rohit Grover |
34:da2ea8cd6216 | 288 | *Scanner */ |
Rohit Grover |
34:da2ea8cd6216 | 289 | GENERIC_GLUCOSE_METER = 1024, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 290 | *Glucose |
Rohit Grover |
34:da2ea8cd6216 | 291 | *Meter */ |
Rohit Grover |
34:da2ea8cd6216 | 292 | GENERIC_RUNNING_WALKING_SENSOR = 1088, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 293 | *Running/Walking |
Rohit Grover |
34:da2ea8cd6216 | 294 | *Sensor */ |
Rohit Grover |
34:da2ea8cd6216 | 295 | RUNNING_WALKING_SENSOR_IN_SHOE = 1089, /**< In Shoe |
Rohit Grover |
34:da2ea8cd6216 | 296 | *Running/Walking |
Rohit Grover |
34:da2ea8cd6216 | 297 | *Sensor */ |
Rohit Grover |
34:da2ea8cd6216 | 298 | RUNNING_WALKING_SENSOR_ON_SHOE = 1090, /**< On Shoe |
Rohit Grover |
34:da2ea8cd6216 | 299 | *Running/Walking |
Rohit Grover |
34:da2ea8cd6216 | 300 | *Sensor */ |
Rohit Grover |
34:da2ea8cd6216 | 301 | RUNNING_WALKING_SENSOR_ON_HIP = 1091, /**< On Hip |
Rohit Grover |
34:da2ea8cd6216 | 302 | *Running/Walking |
Rohit Grover |
34:da2ea8cd6216 | 303 | *Sensor */ |
Rohit Grover |
34:da2ea8cd6216 | 304 | GENERIC_CYCLING = 1152, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 305 | *Cycling */ |
Rohit Grover |
34:da2ea8cd6216 | 306 | CYCLING_CYCLING_COMPUTER = 1153, /**< Cycling |
Rohit Grover |
34:da2ea8cd6216 | 307 | *Computer */ |
Rohit Grover |
34:da2ea8cd6216 | 308 | CYCLING_SPEED_SENSOR = 1154, /**< Cycling |
Rohit Grover |
34:da2ea8cd6216 | 309 | *Speed Senspr |
Rohit Grover |
34:da2ea8cd6216 | 310 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 311 | CYCLING_CADENCE_SENSOR = 1155, /**< Cycling |
Rohit Grover |
34:da2ea8cd6216 | 312 | *Cadence |
Rohit Grover |
34:da2ea8cd6216 | 313 | *Sensor */ |
Rohit Grover |
34:da2ea8cd6216 | 314 | CYCLING_POWER_SENSOR = 1156, /**< Cycling |
Rohit Grover |
34:da2ea8cd6216 | 315 | *Power Sensor |
Rohit Grover |
34:da2ea8cd6216 | 316 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 317 | CYCLING_SPEED_AND_CADENCE_SENSOR = 1157, /**< Cycling |
Rohit Grover |
34:da2ea8cd6216 | 318 | *Speed and |
Rohit Grover |
34:da2ea8cd6216 | 319 | *Cadence |
Rohit Grover |
34:da2ea8cd6216 | 320 | *Sensor */ |
Rohit Grover |
34:da2ea8cd6216 | 321 | PULSE_OXIMETER_GENERIC = 3136, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 322 | *Pulse |
Rohit Grover |
34:da2ea8cd6216 | 323 | *Oximeter */ |
Rohit Grover |
34:da2ea8cd6216 | 324 | PULSE_OXIMETER_FINGERTIP = 3137, /**< Fingertip |
Rohit Grover |
34:da2ea8cd6216 | 325 | *Pulse |
Rohit Grover |
34:da2ea8cd6216 | 326 | *Oximeter */ |
Rohit Grover |
34:da2ea8cd6216 | 327 | PULSE_OXIMETER_WRIST_WORN = 3138, /**< Wrist |
Rohit Grover |
34:da2ea8cd6216 | 328 | *Worn Pulse |
Rohit Grover |
34:da2ea8cd6216 | 329 | *Oximeter */ |
Rohit Grover |
34:da2ea8cd6216 | 330 | OUTDOOR_GENERIC = 5184, /**< Generic |
Rohit Grover |
34:da2ea8cd6216 | 331 | *Outdoor */ |
Rohit Grover |
34:da2ea8cd6216 | 332 | OUTDOOR_LOCATION_DISPLAY_DEVICE = 5185, /**< Outdoor |
Rohit Grover |
34:da2ea8cd6216 | 333 | *Location |
Rohit Grover |
34:da2ea8cd6216 | 334 | *Display |
Rohit Grover |
34:da2ea8cd6216 | 335 | *Device */ |
Rohit Grover |
34:da2ea8cd6216 | 336 | OUTDOOR_LOCATION_AND_NAVIGATION_DISPLAY_DEVICE = 5186, /**< Outdoor |
Rohit Grover |
34:da2ea8cd6216 | 337 | *Location and |
Rohit Grover |
34:da2ea8cd6216 | 338 | *Navigation |
Rohit Grover |
34:da2ea8cd6216 | 339 | *Display |
Rohit Grover |
34:da2ea8cd6216 | 340 | *Device */ |
Rohit Grover |
34:da2ea8cd6216 | 341 | OUTDOOR_LOCATION_POD = 5187, /**< Outdoor |
Rohit Grover |
34:da2ea8cd6216 | 342 | *Location Pod |
Rohit Grover |
34:da2ea8cd6216 | 343 | **/ |
Rohit Grover |
34:da2ea8cd6216 | 344 | OUTDOOR_LOCATION_AND_NAVIGATION_POD = 5188 /**< Outdoor |
Rohit Grover |
34:da2ea8cd6216 | 345 | *Location and |
Rohit Grover |
34:da2ea8cd6216 | 346 | *Navigation |
Rohit Grover |
34:da2ea8cd6216 | 347 | *Pod */ |
ktownsend | 4:50a31ff5f974 | 348 | }; |
ktownsend | 4:50a31ff5f974 | 349 | |
ktownsend | 2:ffc5216bd2cc | 350 | GapAdvertisingData(void); |
ktownsend | 2:ffc5216bd2cc | 351 | virtual ~GapAdvertisingData(void); |
ktownsend | 3:46de446e82ed | 352 | |
Rohit Grover |
47:33f605e109a2 | 353 | ble_error_t addData(DataType, const uint8_t *, uint8_t); |
bogdanm | 31:2c94f0501807 | 354 | ble_error_t addAppearance(Appearance appearance = GENERIC_TAG); |
ktownsend | 4:50a31ff5f974 | 355 | ble_error_t addFlags(Flags flag = LE_GENERAL_DISCOVERABLE); |
ktownsend | 4:50a31ff5f974 | 356 | ble_error_t addTxPower(int8_t txPower); |
ktownsend | 4:50a31ff5f974 | 357 | void clear(void); |
Rohit Grover |
40:d405c9b1419d | 358 | const uint8_t *getPayload(void) const; |
Rohit Grover |
40:d405c9b1419d | 359 | uint8_t getPayloadLen(void) const; |
Rohit Grover |
40:d405c9b1419d | 360 | uint16_t getAppearance(void) const; |
ktownsend | 4:50a31ff5f974 | 361 | |
Rohit Grover |
34:da2ea8cd6216 | 362 | private: |
bogdanm | 31:2c94f0501807 | 363 | uint8_t _payload[GAP_ADVERTISING_DATA_MAX_PAYLOAD]; |
bogdanm | 31:2c94f0501807 | 364 | uint8_t _payloadLen; |
bogdanm | 31:2c94f0501807 | 365 | uint16_t _appearance; |
ktownsend | 2:ffc5216bd2cc | 366 | }; |
ktownsend | 2:ffc5216bd2cc | 367 | |
Rohit Grover |
34:da2ea8cd6216 | 368 | #endif // ifndef __GAP_ADVERTISING_DATA_H__ |