Initial commit
mbed-dev-master/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/cb_gatt.h@0:bb348c97df44, 2020-09-16 (annotated)
- Committer:
- lypinator
- Date:
- Wed Sep 16 01:11:49 2020 +0000
- Revision:
- 0:bb348c97df44
Added PWM
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lypinator | 0:bb348c97df44 | 1 | /* |
lypinator | 0:bb348c97df44 | 2 | *--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 3 | * Copyright (c) 2016, u-blox Malmö, All Rights Reserved |
lypinator | 0:bb348c97df44 | 4 | * SPDX-License-Identifier: LicenseRef-PBL |
lypinator | 0:bb348c97df44 | 5 | * |
lypinator | 0:bb348c97df44 | 6 | * This file and the related binary are licensed under the |
lypinator | 0:bb348c97df44 | 7 | * Permissive Binary License, Version 1.0 (the "License"); |
lypinator | 0:bb348c97df44 | 8 | * you may not use these files except in compliance with the License. |
lypinator | 0:bb348c97df44 | 9 | * |
lypinator | 0:bb348c97df44 | 10 | * You may obtain a copy of the License here: |
lypinator | 0:bb348c97df44 | 11 | * LICENSE-permissive-binary-license-1.0.txt and at |
lypinator | 0:bb348c97df44 | 12 | * https://www.mbed.com/licenses/PBL-1.0 |
lypinator | 0:bb348c97df44 | 13 | * |
lypinator | 0:bb348c97df44 | 14 | * See the License for the specific language governing permissions and |
lypinator | 0:bb348c97df44 | 15 | * limitations under the License. |
lypinator | 0:bb348c97df44 | 16 | * |
lypinator | 0:bb348c97df44 | 17 | * Component : GATT |
lypinator | 0:bb348c97df44 | 18 | * File : cb_gatt.h |
lypinator | 0:bb348c97df44 | 19 | * |
lypinator | 0:bb348c97df44 | 20 | * Description : Definitions and types for GATT(Generic Attribute Profile) |
lypinator | 0:bb348c97df44 | 21 | * that are in common for both client and server. |
lypinator | 0:bb348c97df44 | 22 | * |
lypinator | 0:bb348c97df44 | 23 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 24 | |
lypinator | 0:bb348c97df44 | 25 | /** |
lypinator | 0:bb348c97df44 | 26 | * @file cb_gatt.h |
lypinator | 0:bb348c97df44 | 27 | * |
lypinator | 0:bb348c97df44 | 28 | * @brief Definitions and types for GATT(Generic Attribute Profile) |
lypinator | 0:bb348c97df44 | 29 | * that are in common for both client and server. |
lypinator | 0:bb348c97df44 | 30 | */ |
lypinator | 0:bb348c97df44 | 31 | |
lypinator | 0:bb348c97df44 | 32 | #ifndef _CB_GATT_H_ |
lypinator | 0:bb348c97df44 | 33 | #define _CB_GATT_H_ |
lypinator | 0:bb348c97df44 | 34 | |
lypinator | 0:bb348c97df44 | 35 | #include "bt_types.h" |
lypinator | 0:bb348c97df44 | 36 | |
lypinator | 0:bb348c97df44 | 37 | /*=========================================================================== |
lypinator | 0:bb348c97df44 | 38 | * DEFINES |
lypinator | 0:bb348c97df44 | 39 | *=========================================================================*/ |
lypinator | 0:bb348c97df44 | 40 | |
lypinator | 0:bb348c97df44 | 41 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 42 | extern "C" { |
lypinator | 0:bb348c97df44 | 43 | #endif |
lypinator | 0:bb348c97df44 | 44 | |
lypinator | 0:bb348c97df44 | 45 | #define cbGATT_OK (0) |
lypinator | 0:bb348c97df44 | 46 | #define cbGATT_ERROR (-1) |
lypinator | 0:bb348c97df44 | 47 | #define cbGATT_ERROR_WRONG_STATE (-2) |
lypinator | 0:bb348c97df44 | 48 | #define cbGATT_ERROR_WRONG_HANDLE (-3) |
lypinator | 0:bb348c97df44 | 49 | #define cbGATT_ERROR_WRONG_PARAMETERS (-4) |
lypinator | 0:bb348c97df44 | 50 | |
lypinator | 0:bb348c97df44 | 51 | // This should be the same as in ATT |
lypinator | 0:bb348c97df44 | 52 | #define cbGATT_DEFAULT_MTU_LE 23 |
lypinator | 0:bb348c97df44 | 53 | |
lypinator | 0:bb348c97df44 | 54 | #define cbGATT_GET_MAX_READ_MULTIPLE_MTU(mtu) (mtu-1) |
lypinator | 0:bb348c97df44 | 55 | #define cbGATT_GET_MAX_WRITE_CHARACTERISTIC_MTU(mtu) (mtu-3) |
lypinator | 0:bb348c97df44 | 56 | #define cbGATT_GET_MAX_WRITE_SIGNED_CHARACTERISTIC_MTU(mtu) (mtu-13) |
lypinator | 0:bb348c97df44 | 57 | #define cbGATT_GET_MAX_NOTIFICATION_MTU(mtu) (mtu-3) |
lypinator | 0:bb348c97df44 | 58 | #define cbGATT_GET_MAX_INDICATION_MTU(mtu) (mtu-3) |
lypinator | 0:bb348c97df44 | 59 | |
lypinator | 0:bb348c97df44 | 60 | #define cbGATT_INVALID_ATTR_HANDLE 0x0000 |
lypinator | 0:bb348c97df44 | 61 | #define cbGATT_MIN_ATTR_HANDLE 0x0001 |
lypinator | 0:bb348c97df44 | 62 | #define cbGATT_MAX_ATTR_HANDLE 0xFFFF |
lypinator | 0:bb348c97df44 | 63 | |
lypinator | 0:bb348c97df44 | 64 | #define cbGATT_PROP_BCST 0x01 // Broadcast |
lypinator | 0:bb348c97df44 | 65 | #define cbGATT_PROP_RD 0x02 // Readable |
lypinator | 0:bb348c97df44 | 66 | #define cbGATT_PROP_WR_NO_RSP 0x04 // Write with no response |
lypinator | 0:bb348c97df44 | 67 | #define cbGATT_PROP_WR 0x08 // Writable |
lypinator | 0:bb348c97df44 | 68 | #define cbGATT_PROP_NOT 0x10 // Notify |
lypinator | 0:bb348c97df44 | 69 | #define cbGATT_PROP_IND 0x20 // Indicate |
lypinator | 0:bb348c97df44 | 70 | #define cbGATT_PROP_SIGN_WR 0x40 // Authenticated signed write |
lypinator | 0:bb348c97df44 | 71 | #define cbGATT_PROP_EXT 0x80 // extended property |
lypinator | 0:bb348c97df44 | 72 | |
lypinator | 0:bb348c97df44 | 73 | #define cbGATT_PROP_EXT_REL_WR 0x0001 // Reliable write |
lypinator | 0:bb348c97df44 | 74 | #define cbGATT_PROP_EXT_WR_AUX 0x0002 // auxiliary write |
lypinator | 0:bb348c97df44 | 75 | #define cbGATT_CLIENT_CFG_NONE 0x0000 // Client configuration disabled |
lypinator | 0:bb348c97df44 | 76 | #define cbGATT_CLIENT_CFG_NOT 0x0001 // Client notification configuration |
lypinator | 0:bb348c97df44 | 77 | #define cbGATT_CLIENT_CFG_IND 0x0002 // Server indication configuration |
lypinator | 0:bb348c97df44 | 78 | #define cbGATT_SERVER_CFG_BCST 0x0001 // Server broadcast configuration |
lypinator | 0:bb348c97df44 | 79 | |
lypinator | 0:bb348c97df44 | 80 | #define cbGATT_GET_BROADCAST_PROP(prop) ((0x01 & prop) == 0x01) |
lypinator | 0:bb348c97df44 | 81 | #define cbGATT_GET_READ_PROP(prop) ((0x02 & prop) == 0x02) |
lypinator | 0:bb348c97df44 | 82 | #define cbGATT_GET_WRITE_WITHOUT_RSP_PROP(prop) ((0x04 & prop) == 0x04) |
lypinator | 0:bb348c97df44 | 83 | #define cbGATT_GET_WRITE_PROP(prop) ((0x08 & prop) == 0x08) |
lypinator | 0:bb348c97df44 | 84 | #define cbGATT_GET_NOTIFY_PROP(prop) ((0x10 & prop) == 0x10) |
lypinator | 0:bb348c97df44 | 85 | #define cbGATT_GET_INDICATE_PROP(prop) ((0x20 & prop) == 0x20) |
lypinator | 0:bb348c97df44 | 86 | #define cbGATT_GET_AUTH_SIGNED_WRITES_PROP(prop) ((0x40 & prop) == 0x40) |
lypinator | 0:bb348c97df44 | 87 | #define cbGATT_GET_EXTENDED_PROP(prop) ((0x80 & prop) == 0x80) |
lypinator | 0:bb348c97df44 | 88 | |
lypinator | 0:bb348c97df44 | 89 | #define cbGATT_GET_PROP_EXT_REL_WR(prop) ((0x0001 & prop) == 0x0001) |
lypinator | 0:bb348c97df44 | 90 | #define cbGATT_GET_PROP_EXT_WR_AUX(prop) ((0x0002 & prop) == 0x0002) |
lypinator | 0:bb348c97df44 | 91 | #define cbGATT_GET_CLIENT_CFG_NOT(cfg) ((0x0001 & cfg) == 0x0001) |
lypinator | 0:bb348c97df44 | 92 | #define cbGATT_GET_CLIENT_CFG_IND(cfg) ((0x0002 & cfg) == 0x0002) |
lypinator | 0:bb348c97df44 | 93 | #define cbGATT_GET_SERVER_CFG_BCST(cfg) ((0x0001 & cfg) == 0x0001) |
lypinator | 0:bb348c97df44 | 94 | |
lypinator | 0:bb348c97df44 | 95 | #define cbGATT_SET_BROADCAST_PROP(prop) (prop = prop | 0x01) |
lypinator | 0:bb348c97df44 | 96 | #define cbGATT_SET_READ_PROPERTY(prop) (prop = prop | 0x02) |
lypinator | 0:bb348c97df44 | 97 | #define cbGATT_SET_WRITE_WITHOUT_RSP_PROP(prop) (prop = prop | 0x04) |
lypinator | 0:bb348c97df44 | 98 | #define cbGATT_SET_WRITE_PROP(prop) (prop = prop | 0x08) |
lypinator | 0:bb348c97df44 | 99 | #define cbGATT_SET_NOTIFY_PROP(prop) (prop = prop | 0x10) |
lypinator | 0:bb348c97df44 | 100 | #define cbGATT_SET_INDICATE_PROP(prop) (prop = prop | 0x20) |
lypinator | 0:bb348c97df44 | 101 | #define cbGATT_SET_AUTH_SIGNED_WRITES_PROP(prop) (prop = prop | 0x40) |
lypinator | 0:bb348c97df44 | 102 | #define cbGATT_SET_EXTENDED_PROP(prop) (prop = prop | 0x80) |
lypinator | 0:bb348c97df44 | 103 | |
lypinator | 0:bb348c97df44 | 104 | #define cbGATT_SET_PROP_EXT_REL_WR(prop) (prop = prop | 0x0001) |
lypinator | 0:bb348c97df44 | 105 | #define cbGATT_SET_PROP_EXT_WR_AUX(prop) (prop = prop | 0x0002) |
lypinator | 0:bb348c97df44 | 106 | #define cbGATT_SET_CLIENT_CFG_NOT(cfg) (cfg = cfg | 0x0001) |
lypinator | 0:bb348c97df44 | 107 | #define cbGATT_SET_CLIENT_CFG_IND(cfg) (cfg = cfg | 0x0002) |
lypinator | 0:bb348c97df44 | 108 | #define cbGATT_SET_SERVER_CFG_BCST(cfg) (cfg = cfg | 0x0001) |
lypinator | 0:bb348c97df44 | 109 | |
lypinator | 0:bb348c97df44 | 110 | // Below specification level as of 2011-09-13 |
lypinator | 0:bb348c97df44 | 111 | #define cbGATT_SERVICE_GENERIC_ACCESS 0x1800 // 0.5 |
lypinator | 0:bb348c97df44 | 112 | #define cbGATT_SERVICE_GENERIC_ATTRIBUTE 0x1801 // 0.5 |
lypinator | 0:bb348c97df44 | 113 | #define cbGATT_SERVICE_IMMEDIATE_ALERT 0x1802 // Adopted |
lypinator | 0:bb348c97df44 | 114 | #define cbGATT_SERVICE_LINK_LOSS 0x1803 // Adopted |
lypinator | 0:bb348c97df44 | 115 | #define cbGATT_SERVICE_TX_POWER 0x1804 // Adopted |
lypinator | 0:bb348c97df44 | 116 | #define cbGATT_SERVICE_CURRENT_TIME 0x1805 // Prototype |
lypinator | 0:bb348c97df44 | 117 | #define cbGATT_SERVICE_REFERENCE_TIME_UPDATE 0x1806 // Prototype |
lypinator | 0:bb348c97df44 | 118 | #define cbGATT_SERVICE_NEXT_DST_CHANGE 0x1807 // Prototype |
lypinator | 0:bb348c97df44 | 119 | #define cbGATT_SERVICE_HEALTH_THERMOMETER 0x1809 // Adopted |
lypinator | 0:bb348c97df44 | 120 | #define cbGATT_SERVICE_DEVICE_INFORMATION 0x180A // Adopted |
lypinator | 0:bb348c97df44 | 121 | #define cbGATT_SERVICE_NETWORK_AVAILABILITY 0x180B // 0.9 |
lypinator | 0:bb348c97df44 | 122 | #define cbGATT_SERVICE_WATCHDOG 0x180C // 0.5 |
lypinator | 0:bb348c97df44 | 123 | #define cbGATT_SERVICE_HEART_RATE 0x180D // Adopted |
lypinator | 0:bb348c97df44 | 124 | #define cbGATT_SERVICE_PHONE_ALERT_STATUS 0x180E // Prototype |
lypinator | 0:bb348c97df44 | 125 | #define cbGATT_SERVICE_BATTERY_SERVICE 0x180F // Prototype |
lypinator | 0:bb348c97df44 | 126 | #define cbGATT_SERVICE_BLOOD_PRESSURE 0x1810 // 0.9 |
lypinator | 0:bb348c97df44 | 127 | #define cbGATT_SERVICE_ALERT_NOTIFICATION 0x1811 // Prototype |
lypinator | 0:bb348c97df44 | 128 | #define cbGATT_SERVICE_HUMAN_INTERFACE_DEVICE 0x1812 // 0.5 |
lypinator | 0:bb348c97df44 | 129 | #define cbGATT_SERVICE_SCAN_PARAMETER 0x1813 // 0.5 |
lypinator | 0:bb348c97df44 | 130 | |
lypinator | 0:bb348c97df44 | 131 | #define cbGATT_PRIMARY_SERVICE_DECL 0x2800 |
lypinator | 0:bb348c97df44 | 132 | #define cbGATT_SECONDARY_SERVICE_DECL 0x2801 |
lypinator | 0:bb348c97df44 | 133 | #define cbGATT_INCLUDE_DECL 0x2802 |
lypinator | 0:bb348c97df44 | 134 | #define cbGATT_CHAR_DECL 0x2803 |
lypinator | 0:bb348c97df44 | 135 | #define cbGATT_CHAR_EXT_PROP 0x2900 |
lypinator | 0:bb348c97df44 | 136 | #define cbGATT_CHAR_USER_DESC 0x2901 |
lypinator | 0:bb348c97df44 | 137 | #define cbGATT_CLIENT_CHAR_CONFIG 0x2902 |
lypinator | 0:bb348c97df44 | 138 | #define cbGATT_SERVER_CHAR_CONFIG 0x2903 |
lypinator | 0:bb348c97df44 | 139 | #define cbGATT_CHAR_FORMAT 0x2904 |
lypinator | 0:bb348c97df44 | 140 | #define cbGATT_CHAR_AGGR_FORMAT 0x2905 |
lypinator | 0:bb348c97df44 | 141 | |
lypinator | 0:bb348c97df44 | 142 | #define cbGATT_CHAR_GAP_DEVICE_NAME 0x2A00 // Adopted |
lypinator | 0:bb348c97df44 | 143 | #define cbGATT_CHAR_GAP_APPEARANCE 0x2A01 // Adopted |
lypinator | 0:bb348c97df44 | 144 | #define cbGATT_CHAR_GAP_PERIP_PRIV 0x2A02 // Adopted |
lypinator | 0:bb348c97df44 | 145 | #define cbGATT_CHAR_GAP_RECONN_ADDR 0x2A03 // Adopted |
lypinator | 0:bb348c97df44 | 146 | #define cbGATT_CHAR_GAP_CONN_PARAMS 0x2A04 // Adopted |
lypinator | 0:bb348c97df44 | 147 | #define cbGATT_CHAR_GATT_SVC_CHANGED 0x2A05 // Adopted |
lypinator | 0:bb348c97df44 | 148 | #define cbGATT_CHAR_ALERT_LEVEL 0x2A06 // Adopted |
lypinator | 0:bb348c97df44 | 149 | #define cbGATT_CHAR_TX_POWER_LEVEL 0x2A07 // Adopted |
lypinator | 0:bb348c97df44 | 150 | #define cbGATT_CHAR_DATE_TIME 0x2A08 // Adopted |
lypinator | 0:bb348c97df44 | 151 | #define cbGATT_CHAR_DAY_OF_WEEK 0x2A09 // Prototype |
lypinator | 0:bb348c97df44 | 152 | #define cbGATT_CHAR_DAY_DATE_TIME 0x2A0A // Prototype |
lypinator | 0:bb348c97df44 | 153 | #define cbGATT_CHAR_EXACT_TIME_100 0x2A0B // 0.9 |
lypinator | 0:bb348c97df44 | 154 | #define cbGATT_CHAR_EXACT_TIME_256 0x2A0C // Prototype |
lypinator | 0:bb348c97df44 | 155 | #define cbGATT_CHAR_DST_OFFSET 0x2A0D // Prototype |
lypinator | 0:bb348c97df44 | 156 | #define cbGATT_CHAR_TIME_ZONE 0x2A0E // Prototype |
lypinator | 0:bb348c97df44 | 157 | #define cbGATT_CHAR_LOCAL_TIME_INFORMATION 0x2A0F // Prototype |
lypinator | 0:bb348c97df44 | 158 | #define cbGATT_CHAR_SECONDARY_TIME_ZONE 0x2A10 // 0.9 |
lypinator | 0:bb348c97df44 | 159 | #define cbGATT_CHAR_TIME_WITH_DST 0x2A11 // Prototype |
lypinator | 0:bb348c97df44 | 160 | #define cbGATT_CHAR_TIME_ACCURACY 0x2A12 // Prototype |
lypinator | 0:bb348c97df44 | 161 | #define cbGATT_CHAR_TIME_SOURCE 0x2A13 // Prototype |
lypinator | 0:bb348c97df44 | 162 | #define cbGATT_CHAR_REFERENCE_TIME_INFORMATION 0x2A14 // Prototype |
lypinator | 0:bb348c97df44 | 163 | #define cbGATT_CHAR_TIME_BROADCAST 0x2A15 // 0.9 |
lypinator | 0:bb348c97df44 | 164 | #define cbGATT_CHAR_TIME_UPDATE_CONTROL_POINT 0x2A16 // Prototype |
lypinator | 0:bb348c97df44 | 165 | #define cbGATT_CHAR_TIME_UPDATE_STATE 0x2A17 // Prototype |
lypinator | 0:bb348c97df44 | 166 | #define cbGATT_CHAR_BOOLEAN 0x2A18 // 0.9 |
lypinator | 0:bb348c97df44 | 167 | #define cbGATT_CHAR_BATTERY_LEVEL 0x2A19 // 0.9 |
lypinator | 0:bb348c97df44 | 168 | #define cbGATT_CHAR_BATTERY_POWER_STATE 0x2A1A // 0.9 |
lypinator | 0:bb348c97df44 | 169 | #define cbGATT_CHAR_BATTERY_LEVEL_STATE 0x2A1B // 0.9 |
lypinator | 0:bb348c97df44 | 170 | #define cbGATT_CHAR_TEMP_MEASUREMENT 0x2A1C // Adopted |
lypinator | 0:bb348c97df44 | 171 | #define cbGATT_CHAR_TEMP_TYPE 0x2A1D // Adopted |
lypinator | 0:bb348c97df44 | 172 | #define cbGATT_CHAR_INTERMEDIATE_TEMP 0x2A1E // Adopted |
lypinator | 0:bb348c97df44 | 173 | #define cbGATT_CHAR_TEMP_CELSIUS 0x2A1F // 0.9 |
lypinator | 0:bb348c97df44 | 174 | #define cbGATT_CHAR_TEMP_FAHRENHEIT 0x2A20 // 0.9 |
lypinator | 0:bb348c97df44 | 175 | #define cbGATT_CHAR_MEASUREMENT_INTERVAL 0x2A21 // Adopted |
lypinator | 0:bb348c97df44 | 176 | #define cbGATT_CHAR_SYSTEM_ID 0x2A23 // Adopted |
lypinator | 0:bb348c97df44 | 177 | #define cbGATT_CHAR_MODEL_NUMBER_STRING 0x2A24 // Adopted |
lypinator | 0:bb348c97df44 | 178 | #define cbGATT_CHAR_SERIAL_NUMBER_STRING 0x2A25 // Adopted |
lypinator | 0:bb348c97df44 | 179 | #define cbGATT_CHAR_FIRMWARE_REV_STRING 0x2A26 // Adopted |
lypinator | 0:bb348c97df44 | 180 | #define cbGATT_CHAR_HARDWARE_REV_STRING 0x2A27 // Adopted |
lypinator | 0:bb348c97df44 | 181 | #define cbGATT_CHAR_SOFTWARE_REV_STRING 0x2A28 // Adopted |
lypinator | 0:bb348c97df44 | 182 | #define cbGATT_CHAR_MANUFACTURER_NAME_STRING 0x2A29 // Adopted |
lypinator | 0:bb348c97df44 | 183 | #define cbGATT_CHAR_IEEE_REG_CERT_DATA_LIST 0x2A2A // Adopted |
lypinator | 0:bb348c97df44 | 184 | #define cbGATT_CHAR_CURRENT_TIME 0x2A2B // Prototype |
lypinator | 0:bb348c97df44 | 185 | #define cbGATT_CHAR_ELEVATION 0x2A2C // 0.5 |
lypinator | 0:bb348c97df44 | 186 | #define cbGATT_CHAR_LATITUDE 0x2A2D // 0.5 |
lypinator | 0:bb348c97df44 | 187 | #define cbGATT_CHAR_LONGITUDE 0x2A2E // 0.5 |
lypinator | 0:bb348c97df44 | 188 | #define cbGATT_CHAR_POSITION_2D 0x2A2F // 0.5 |
lypinator | 0:bb348c97df44 | 189 | #define cbGATT_CHAR_POSITION_3D 0x2A30 // 0.5 |
lypinator | 0:bb348c97df44 | 190 | #define cbGATT_CHAR_VENDOR_ID_V1_1 0x2A31 // 0.5 |
lypinator | 0:bb348c97df44 | 191 | #define cbGATT_CHAR_PRODUCT_ID 0x2A32 // 0.5 |
lypinator | 0:bb348c97df44 | 192 | #define cbGATT_CHAR_HID_VERSION 0x2A33 // 0.5 |
lypinator | 0:bb348c97df44 | 193 | #define cbGATT_CHAR_VENDOR_ID_SOURCE 0x2A34 // 0.5 |
lypinator | 0:bb348c97df44 | 194 | #define cbGATT_CHAR_BLOOD_PRESSURE_MEASUREMENT 0x2A35 // 0.9 |
lypinator | 0:bb348c97df44 | 195 | #define cbGATT_CHAR_INTERMEDIATE_BLOOD_PRESSURE 0x2A36 // 0.9 |
lypinator | 0:bb348c97df44 | 196 | #define cbGATT_CHAR_HEART_RATE_MEASUREMENT 0x2A37 // Adopted |
lypinator | 0:bb348c97df44 | 197 | #define cbGATT_CHAR_BODY_SENSOR_LOCATION 0x2A38 // Adopted |
lypinator | 0:bb348c97df44 | 198 | #define cbGATT_CHAR_HEART_RATE_CONTROL_POINT 0x2A39 // Adopted |
lypinator | 0:bb348c97df44 | 199 | #define cbGATT_CHAR_REMOVABLE 0x2A3A // 0.5 |
lypinator | 0:bb348c97df44 | 200 | #define cbGATT_CHAR_SERVICE_REQUIRED 0x2A3B // 0.9 |
lypinator | 0:bb348c97df44 | 201 | #define cbGATT_CHAR_SCIENTIFIC_TEMP_CELSIUS 0x2A3C // 0.9 |
lypinator | 0:bb348c97df44 | 202 | #define cbGATT_CHAR_STRING 0x2A3D // 0.9 |
lypinator | 0:bb348c97df44 | 203 | #define cbGATT_CHAR_NETWORK_AVAILABILITY 0x2A3E // 0.9 |
lypinator | 0:bb348c97df44 | 204 | #define cbGATT_CHAR_ALERT_STATUS 0x2A3F // Prototype |
lypinator | 0:bb348c97df44 | 205 | #define cbGATT_CHAR_RINGER_CONTROL_POINT 0x2A40 // Prototype |
lypinator | 0:bb348c97df44 | 206 | #define cbGATT_CHAR_RINGER_SETTING 0x2A41 // Prototype |
lypinator | 0:bb348c97df44 | 207 | #define cbGATT_CHAR_ALERT_CATEGORY_ID_BIT_MASK 0x2A42 // 0.9 |
lypinator | 0:bb348c97df44 | 208 | #define cbGATT_CHAR_ALERT_CATEGORY_ID 0x2A43 // 0.9 |
lypinator | 0:bb348c97df44 | 209 | #define cbGATT_CHAR_ALERT_NOTIF_CONTROL_POINT 0x2A44 // 0.9 |
lypinator | 0:bb348c97df44 | 210 | #define cbGATT_CHAR_UNREAD_ALERT_STATUS 0x2A45 // 0.9 |
lypinator | 0:bb348c97df44 | 211 | #define cbGATT_CHAR_NEW_ALERT 0x2A46 // 0.9 |
lypinator | 0:bb348c97df44 | 212 | #define cbGATT_CHAR_SUPPORTED_NEW_ALERT_CATEGORY 0x2A47 // 0.9 |
lypinator | 0:bb348c97df44 | 213 | #define cbGATT_CHAR_SUPPORTED_UNREAD_ALERT_CATEGORY 0x2A48 // 0.9 |
lypinator | 0:bb348c97df44 | 214 | #define cbGATT_CHAR_BLOOD_PRESSURE_FEATURE 0x2A49 // 0.9 |
lypinator | 0:bb348c97df44 | 215 | |
lypinator | 0:bb348c97df44 | 216 | /*============================================================================== |
lypinator | 0:bb348c97df44 | 217 | * TYPES |
lypinator | 0:bb348c97df44 | 218 | *============================================================================== |
lypinator | 0:bb348c97df44 | 219 | */ |
lypinator | 0:bb348c97df44 | 220 | |
lypinator | 0:bb348c97df44 | 221 | typedef enum |
lypinator | 0:bb348c97df44 | 222 | { |
lypinator | 0:bb348c97df44 | 223 | cbGATT_WRITE_METHOD_WITH_RSP, |
lypinator | 0:bb348c97df44 | 224 | cbGATT_WRITE_METHOD_NO_RSP, |
lypinator | 0:bb348c97df44 | 225 | cbGATT_WRITE_METHOD_SIGN, |
lypinator | 0:bb348c97df44 | 226 | cbGATT_WRITE_METHOD_RELIABLE_PREPARE, |
lypinator | 0:bb348c97df44 | 227 | } cbGATT_WriteMethod; |
lypinator | 0:bb348c97df44 | 228 | |
lypinator | 0:bb348c97df44 | 229 | typedef enum |
lypinator | 0:bb348c97df44 | 230 | { |
lypinator | 0:bb348c97df44 | 231 | cbGATT_UNIT_UNITLESS = 0x2700, |
lypinator | 0:bb348c97df44 | 232 | cbGATT_UNIT_LENGTH_METRE = 0x2701, |
lypinator | 0:bb348c97df44 | 233 | cbGATT_UNIT_MASS_KILOGRAM = 0x2702, |
lypinator | 0:bb348c97df44 | 234 | cbGATT_UNIT_TIME_SECOND = 0x2703, |
lypinator | 0:bb348c97df44 | 235 | cbGATT_UNIT_ELECTRIC_CURRENT_AMPERE = 0x2704, |
lypinator | 0:bb348c97df44 | 236 | cbGATT_UNIT_THERMODYNAMIC_TEMPERATURE_KELVIN = 0x2705, |
lypinator | 0:bb348c97df44 | 237 | cbGATT_UNIT_AMOUNT_OF_SUBSTANCE_MOLE = 0x2706, |
lypinator | 0:bb348c97df44 | 238 | cbGATT_UNIT_LUMINOUS_INTENSITY_CANDELA = 0x2707, |
lypinator | 0:bb348c97df44 | 239 | cbGATT_UNIT_AREA_SQUARE_METRES = 0x2710, |
lypinator | 0:bb348c97df44 | 240 | cbGATT_UNIT_VOLUME_CUBIC_METRES = 0x2711, |
lypinator | 0:bb348c97df44 | 241 | cbGATT_UNIT_VELOCITY_METRES_PER_SECOND = 0x2712, |
lypinator | 0:bb348c97df44 | 242 | cbGATT_UNIT_ACCELERATION_METRES_PER_SECOND_SQUARED = 0x2713, |
lypinator | 0:bb348c97df44 | 243 | cbGATT_UNIT_WAVENUMBER_RECIPROCAL_METRE = 0x2714, |
lypinator | 0:bb348c97df44 | 244 | cbGATT_UNIT_DENSITY_KILOGRAM_PER_CUBIC_METRE = 0x2715, |
lypinator | 0:bb348c97df44 | 245 | cbGATT_UNIT_SURFACE_DENSITY_KILOGRAM_PER_SQUARE_METRE = 0x2716, |
lypinator | 0:bb348c97df44 | 246 | cbGATT_UNIT_SPECIFIC_VOLUME_CUBIC_METRE_PER_KILOGRAM = 0x2717, |
lypinator | 0:bb348c97df44 | 247 | cbGATT_UNIT_CURRENT_DENSITY_AMPERE_PER_SQUARE_METRE = 0x2718, |
lypinator | 0:bb348c97df44 | 248 | cbGATT_UNIT_MAGNETIC_FIELD_STRENGTH_AMPERE_PER_METRE = 0x2719, |
lypinator | 0:bb348c97df44 | 249 | cbGATT_UNIT_AMOUNT_CONCENTRATION_MOLE_PER_CUBIC_METRE = 0x271A, |
lypinator | 0:bb348c97df44 | 250 | cbGATT_UNIT_MASS_CONCENTRATION_KILOGRAM_PER_CUBIC_METRE = 0x271B, |
lypinator | 0:bb348c97df44 | 251 | cbGATT_UNIT_LUMINANCE_CANDELA_PER_SQUARE_METRE = 0x271C, |
lypinator | 0:bb348c97df44 | 252 | cbGATT_UNIT_REFRACTIVE_INDEX = 0x271D, |
lypinator | 0:bb348c97df44 | 253 | cbGATT_UNIT_RELATIVE_PERMEABILITY = 0x271E, |
lypinator | 0:bb348c97df44 | 254 | cbGATT_UNIT_PLANE_ANGLE_RADIAN = 0x2720, |
lypinator | 0:bb348c97df44 | 255 | cbGATT_UNIT_SOLID_ANGLE_STERADIAN = 0x2721, |
lypinator | 0:bb348c97df44 | 256 | cbGATT_UNIT_FREQUENCY_HERTZ = 0x2722, |
lypinator | 0:bb348c97df44 | 257 | cbGATT_UNIT_FORCE_NEWTON = 0x2723, |
lypinator | 0:bb348c97df44 | 258 | cbGATT_UNIT_PRESSURE_PASCAL = 0x2724, |
lypinator | 0:bb348c97df44 | 259 | cbGATT_UNIT_ENERGY_JOULE = 0x2725, |
lypinator | 0:bb348c97df44 | 260 | cbGATT_UNIT_POWER_WATT = 0x2726, |
lypinator | 0:bb348c97df44 | 261 | cbGATT_UNIT_ELECTRIC_CHARGE_COULOMB = 0x2727, |
lypinator | 0:bb348c97df44 | 262 | cbGATT_UNIT_ELECTRIC_POTENTIAL_DIFFERENCE_VOLT = 0x2728, |
lypinator | 0:bb348c97df44 | 263 | cbGATT_UNIT_CAPACITANCE_FARAD = 0x2729, |
lypinator | 0:bb348c97df44 | 264 | cbGATT_UNIT_ELECTRIC_RESISTANCE_OHM = 0x272A, |
lypinator | 0:bb348c97df44 | 265 | cbGATT_UNIT_ELECTRIC_CONDUCTANCE_SIEMENS = 0x272B, |
lypinator | 0:bb348c97df44 | 266 | cbGATT_UNIT_MAGNETIC_FLEX_WEBER = 0x272C, |
lypinator | 0:bb348c97df44 | 267 | cbGATT_UNIT_MAGNETIC_FLEX_DENSITY_TESLA = 0x272D, |
lypinator | 0:bb348c97df44 | 268 | cbGATT_UNIT_INDUCTANCE_HENRY = 0x272E, |
lypinator | 0:bb348c97df44 | 269 | cbGATT_UNIT_THERMODYNAMIC_TEMPERATURE_DEGREE_CELSIUS = 0x272F, |
lypinator | 0:bb348c97df44 | 270 | cbGATT_UNIT_LUMINOUS_FLUX_LUMEN = 0x2730, |
lypinator | 0:bb348c97df44 | 271 | cbGATT_UNIT_ILLUMINANCE_LUX = 0x2731, |
lypinator | 0:bb348c97df44 | 272 | cbGATT_UNIT_ACTIVITY_REFERRED_TO_A_RADIONUCLIDE_BECQUEREL = 0x2732, |
lypinator | 0:bb348c97df44 | 273 | cbGATT_UNIT_ABSORBED_DOSE_GRAY = 0x2733, |
lypinator | 0:bb348c97df44 | 274 | cbGATT_UNIT_DOSE_EQUIVALENT_SIEVERT = 0x2734, |
lypinator | 0:bb348c97df44 | 275 | cbGATT_UNIT_CATALYTIC_ACTIVITY_KATAL = 0x2735, |
lypinator | 0:bb348c97df44 | 276 | cbGATT_UNIT_DYNAMIC_VISCOSITY_PASCAL_SECOND = 0x2740, |
lypinator | 0:bb348c97df44 | 277 | cbGATT_UNIT_MOMENT_OF_FORCE_NEWTON_METRE = 0x2741, |
lypinator | 0:bb348c97df44 | 278 | cbGATT_UNIT_SURFACE_TENSION_NEWTON_PER_METRE = 0x2742, |
lypinator | 0:bb348c97df44 | 279 | cbGATT_UNIT_ANGULAR_VELOCITY_RADIAN_PER_SECOND = 0x2743, |
lypinator | 0:bb348c97df44 | 280 | cbGATT_UNIT_ANGULAR_ACCELERATION_RADIAN_PER_SECOND_SQUARED = 0x2744, |
lypinator | 0:bb348c97df44 | 281 | cbGATT_UNIT_HEAT_FLUX_DENSITY_WATT_PER_SQUARE_METRE = 0x2745, |
lypinator | 0:bb348c97df44 | 282 | cbGATT_UNIT_HEAT_CAPACITY_JOULE_PER_KELVIN = 0x2746, |
lypinator | 0:bb348c97df44 | 283 | cbGATT_UNIT_SPECIFIC_HEAT_CAPACITY_JOULE_PER_KILOGRAM_KELVIN = 0x2747, |
lypinator | 0:bb348c97df44 | 284 | cbGATT_UNIT_SPECIFIC_ENERGY_JOULE_PER_KILOGRAM = 0x2748, |
lypinator | 0:bb348c97df44 | 285 | cbGATT_UNIT_THERMAL_CONDUCTIVITY_WATT_PER_METRE_KELVIN = 0x2749, |
lypinator | 0:bb348c97df44 | 286 | cbGATT_UNIT_ENERGY_DENSITY_JOULE_PER_CUBIC_METRE = 0x274A, |
lypinator | 0:bb348c97df44 | 287 | cbGATT_UNIT_ELECTRIC_FIELD_STRENGTH_VOLT_PER_METRE = 0x274B, |
lypinator | 0:bb348c97df44 | 288 | cbGATT_UNIT_ELECTRIC_CHARGE_DENSITY_COULOMB_PER_CUBIC_METRE = 0x274C, |
lypinator | 0:bb348c97df44 | 289 | cbGATT_UNIT_SURFACE_CHARGE_DENSITY_COULOMB_PER_SQUARE_METRE = 0x274D, |
lypinator | 0:bb348c97df44 | 290 | cbGATT_UNIT_ELECTRIC_FLUX_DENSITY_COULOMB_PER_SQUARE_METRE = 0x274E, |
lypinator | 0:bb348c97df44 | 291 | cbGATT_UNIT_PERMITTIVITY_FARAD_PER_METRE = 0x274F, |
lypinator | 0:bb348c97df44 | 292 | cbGATT_UNIT_PERMEABILITY_HENRY_PER_METRE = 0x2750, |
lypinator | 0:bb348c97df44 | 293 | cbGATT_UNIT_MOLAR_ENERGY_JOULE_PER_MOLE = 0x2751, |
lypinator | 0:bb348c97df44 | 294 | cbGATT_UNIT_MOLAR_ENTROPY_JOULE_PER_MOLE_KELVIN = 0x2752, |
lypinator | 0:bb348c97df44 | 295 | cbGATT_UNIT_EXPOSURE_COULOMB_PER_KILOGRAM = 0x2753, |
lypinator | 0:bb348c97df44 | 296 | cbGATT_UNIT_ABSORBED_DOSE_RATE_GRAY_PER_SECOND = 0x2754, |
lypinator | 0:bb348c97df44 | 297 | cbGATT_UNIT_RADIANT_INTENSITY_WATT_PER_STERADIAN = 0x2755, |
lypinator | 0:bb348c97df44 | 298 | cbGATT_UNIT_RADIANCE_WATT_PER_SQUARE_METER_STERADIAN = 0x2756, |
lypinator | 0:bb348c97df44 | 299 | cbGATT_UNIT_CATALYTIC_ACTIVITY_CONCENTRATION_KATAL_PER_CUBIC_METRE = 0x2757, |
lypinator | 0:bb348c97df44 | 300 | cbGATT_UNIT_TIME_MINUTE = 0x2760, |
lypinator | 0:bb348c97df44 | 301 | cbGATT_UNIT_TIME_HOUR = 0x2761, |
lypinator | 0:bb348c97df44 | 302 | cbGATT_UNIT_TIME_DAY = 0x2762, |
lypinator | 0:bb348c97df44 | 303 | cbGATT_UNIT_PLANE_ANGLE_DEGREE = 0x2763, |
lypinator | 0:bb348c97df44 | 304 | cbGATT_UNIT_PLANE_ANGLE_MINUTE = 0x2764, |
lypinator | 0:bb348c97df44 | 305 | cbGATT_UNIT_PLANE_ANGLE_SECOND = 0x2765, |
lypinator | 0:bb348c97df44 | 306 | cbGATT_UNIT_AREA_HECTARE = 0x2766, |
lypinator | 0:bb348c97df44 | 307 | cbGATT_UNIT_VOLUME_LITRE = 0x2767, |
lypinator | 0:bb348c97df44 | 308 | cbGATT_UNIT_MASS_TONNE = 0x2768, |
lypinator | 0:bb348c97df44 | 309 | cbGATT_UNIT_PRESSURE_BAR = 0x2780, |
lypinator | 0:bb348c97df44 | 310 | cbGATT_UNIT_PRESSURE_MILLIMETRE_OF_MERCURY = 0x2781, |
lypinator | 0:bb348c97df44 | 311 | cbGATT_UNIT_LENGTH_ANGSTROM = 0x2782, |
lypinator | 0:bb348c97df44 | 312 | cbGATT_UNIT_LENGTH_NAUTICAL_MILE = 0x2783, |
lypinator | 0:bb348c97df44 | 313 | cbGATT_UNIT_AREA_BARN = 0x2784, |
lypinator | 0:bb348c97df44 | 314 | cbGATT_UNIT_VELOCITY_KNOT = 0x2785, |
lypinator | 0:bb348c97df44 | 315 | cbGATT_UNIT_LOGARITHMIC_RADIO_QUANTITY_NEPER = 0x2786, |
lypinator | 0:bb348c97df44 | 316 | cbGATT_UNIT_LOGARITHMIC_RADIO_QUANTITY_BEL = 0x2787, |
lypinator | 0:bb348c97df44 | 317 | cbGATT_UNIT_LENGTH_YARD = 0x27A0, |
lypinator | 0:bb348c97df44 | 318 | cbGATT_UNIT_LENGTH_PARSEC = 0x27A1, |
lypinator | 0:bb348c97df44 | 319 | cbGATT_UNIT_LENGTH_INCH = 0x27A2, |
lypinator | 0:bb348c97df44 | 320 | cbGATT_UNIT_LENGTH_FOOT = 0x27A3, |
lypinator | 0:bb348c97df44 | 321 | cbGATT_UNIT_LENGTH_MILE = 0x27A4, |
lypinator | 0:bb348c97df44 | 322 | cbGATT_UNIT_PRESSURE_POUND_FORCE_PER_SQUARE_INCH = 0x27A5, |
lypinator | 0:bb348c97df44 | 323 | cbGATT_UNIT_VELOCITY_KILOMETRE_PER_HOUR = 0x27A6, |
lypinator | 0:bb348c97df44 | 324 | cbGATT_UNIT_VELOCITY_MILE_PER_HOUR = 0x27A7, |
lypinator | 0:bb348c97df44 | 325 | cbGATT_UNIT_ANGULAR_VELOCITY_REVOLUTION_PER_MINUTE = 0x27A8, |
lypinator | 0:bb348c97df44 | 326 | cbGATT_UNIT_ENERGY_GRAM_CALORIE = 0x27A9, |
lypinator | 0:bb348c97df44 | 327 | cbGATT_UNIT_ENERGY_KILOGRAM_CALORIE = 0x27AA, |
lypinator | 0:bb348c97df44 | 328 | cbGATT_UNIT_ENERGY_KILOWATT_HOUR = 0x27AB, |
lypinator | 0:bb348c97df44 | 329 | cbGATT_UNIT_THERMODYNAMIC_TEMPERATURE_DEGREE_FAHRENHEIT = 0x27AC, |
lypinator | 0:bb348c97df44 | 330 | cbGATT_UNIT_PERCENTAGE = 0x27AD, |
lypinator | 0:bb348c97df44 | 331 | cbGATT_UNIT_PER_MILLE = 0x27AE, |
lypinator | 0:bb348c97df44 | 332 | cbGATT_UNIT_PERIOD_BEATS_PER_MINUTE = 0x27AF, |
lypinator | 0:bb348c97df44 | 333 | cbGATT_UNIT_ELECTRIC_CHARGE_AMPERE_HOURS = 0x27B0, |
lypinator | 0:bb348c97df44 | 334 | cbGATT_UNIT_MASS_DENSITY_MILLIGRAM_PER_DECILITRE = 0x27B1, |
lypinator | 0:bb348c97df44 | 335 | cbGATT_UNIT_MASS_DENSITY_MILLIMOLE_PER_LITRE = 0x27B2, |
lypinator | 0:bb348c97df44 | 336 | cbGATT_UNIT_TIME_YEAR = 0x27B3, |
lypinator | 0:bb348c97df44 | 337 | cbGATT_UNIT_TIME_MONTH = 0x27B4, |
lypinator | 0:bb348c97df44 | 338 | } cbGATT_Unit; |
lypinator | 0:bb348c97df44 | 339 | |
lypinator | 0:bb348c97df44 | 340 | typedef enum |
lypinator | 0:bb348c97df44 | 341 | { |
lypinator | 0:bb348c97df44 | 342 | |
lypinator | 0:bb348c97df44 | 343 | // Note, check http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.cbGATT.characteristic_presentation_format.xml |
lypinator | 0:bb348c97df44 | 344 | // for any changes |
lypinator | 0:bb348c97df44 | 345 | cbGATT_FORMAT_TYPE_BOOLEAN = 0x01, |
lypinator | 0:bb348c97df44 | 346 | cbGATT_FORMAT_TYPE_2BIT = 0x02, |
lypinator | 0:bb348c97df44 | 347 | cbGATT_FORMAT_TYPE_NIBBLE = 0x03, |
lypinator | 0:bb348c97df44 | 348 | cbGATT_FORMAT_TYPE_UINT8 = 0x04, |
lypinator | 0:bb348c97df44 | 349 | cbGATT_FORMAT_TYPE_UINT12 = 0x05, |
lypinator | 0:bb348c97df44 | 350 | cbGATT_FORMAT_TYPE_UINT16 = 0x06, |
lypinator | 0:bb348c97df44 | 351 | cbGATT_FORMAT_TYPE_UINT24 = 0x07, |
lypinator | 0:bb348c97df44 | 352 | cbGATT_FORMAT_TYPE_UINT32 = 0x08, |
lypinator | 0:bb348c97df44 | 353 | cbGATT_FORMAT_TYPE_UINT48 = 0x09, |
lypinator | 0:bb348c97df44 | 354 | cbGATT_FORMAT_TYPE_UINT64 = 0x0A, |
lypinator | 0:bb348c97df44 | 355 | cbGATT_FORMAT_TYPE_UINT128 = 0x0B, |
lypinator | 0:bb348c97df44 | 356 | cbGATT_FORMAT_TYPE_SINT8 = 0x0C, |
lypinator | 0:bb348c97df44 | 357 | cbGATT_FORMAT_TYPE_SINT12 = 0x0D, |
lypinator | 0:bb348c97df44 | 358 | cbGATT_FORMAT_TYPE_SINT16 = 0x0E, |
lypinator | 0:bb348c97df44 | 359 | cbGATT_FORMAT_TYPE_SINT24 = 0x0F, |
lypinator | 0:bb348c97df44 | 360 | cbGATT_FORMAT_TYPE_SINT32 = 0x10, |
lypinator | 0:bb348c97df44 | 361 | cbGATT_FORMAT_TYPE_SINT48 = 0x11, |
lypinator | 0:bb348c97df44 | 362 | cbGATT_FORMAT_TYPE_SINT64 = 0x12, |
lypinator | 0:bb348c97df44 | 363 | cbGATT_FORMAT_TYPE_SINT128 = 0x13, |
lypinator | 0:bb348c97df44 | 364 | cbGATT_FORMAT_TYPE_FLOAT32 = 0x14, |
lypinator | 0:bb348c97df44 | 365 | cbGATT_FORMAT_TYPE_FLOAT64 = 0x15, |
lypinator | 0:bb348c97df44 | 366 | cbGATT_FORMAT_TYPE_SFLOAT = 0x16, |
lypinator | 0:bb348c97df44 | 367 | cbGATT_FORMAT_TYPE_FLOAT = 0x17, |
lypinator | 0:bb348c97df44 | 368 | cbGATT_FORMAT_TYPE_DUINT16 = 0x18, |
lypinator | 0:bb348c97df44 | 369 | cbGATT_FORMAT_TYPE_UTF8S = 0x19, |
lypinator | 0:bb348c97df44 | 370 | cbGATT_FORMAT_TYPE_UTF16S = 0x1A, |
lypinator | 0:bb348c97df44 | 371 | cbGATT_FORMAT_TYPE_STRUCT = 0x1B, |
lypinator | 0:bb348c97df44 | 372 | } cbGATT_FormatType; |
lypinator | 0:bb348c97df44 | 373 | |
lypinator | 0:bb348c97df44 | 374 | typedef enum |
lypinator | 0:bb348c97df44 | 375 | { |
lypinator | 0:bb348c97df44 | 376 | // This should map to ATT_TRole |
lypinator | 0:bb348c97df44 | 377 | cbGATT_ROLE_CLIENT = 0, |
lypinator | 0:bb348c97df44 | 378 | cbGATT_ROLE_SERVER = 1, |
lypinator | 0:bb348c97df44 | 379 | cbGATT_ROLE_BOTH = 2 |
lypinator | 0:bb348c97df44 | 380 | } cbGATT_Role; |
lypinator | 0:bb348c97df44 | 381 | |
lypinator | 0:bb348c97df44 | 382 | typedef enum |
lypinator | 0:bb348c97df44 | 383 | { |
lypinator | 0:bb348c97df44 | 384 | cbGATT_NAMESPACE_BT_SIG = 0x01, |
lypinator | 0:bb348c97df44 | 385 | } cbGATT_Namespace; |
lypinator | 0:bb348c97df44 | 386 | |
lypinator | 0:bb348c97df44 | 387 | typedef enum |
lypinator | 0:bb348c97df44 | 388 | { |
lypinator | 0:bb348c97df44 | 389 | cbGATT_NAMESPACE_DESC_UNKNOWN = 0x0000, |
lypinator | 0:bb348c97df44 | 390 | } cbGATT_NamespaceDesc; |
lypinator | 0:bb348c97df44 | 391 | |
lypinator | 0:bb348c97df44 | 392 | typedef struct |
lypinator | 0:bb348c97df44 | 393 | { |
lypinator | 0:bb348c97df44 | 394 | cbGATT_FormatType format; |
lypinator | 0:bb348c97df44 | 395 | cb_uint8 exponent; |
lypinator | 0:bb348c97df44 | 396 | cbGATT_Unit unit; |
lypinator | 0:bb348c97df44 | 397 | cbGATT_Namespace gattNamespace; |
lypinator | 0:bb348c97df44 | 398 | cbGATT_NamespaceDesc namespaceDesc; |
lypinator | 0:bb348c97df44 | 399 | } cbGATT_CharFormat; |
lypinator | 0:bb348c97df44 | 400 | |
lypinator | 0:bb348c97df44 | 401 | // This enum must match ATT_TErrorCode for the first two parts |
lypinator | 0:bb348c97df44 | 402 | // (not the GATT specific) |
lypinator | 0:bb348c97df44 | 403 | typedef enum |
lypinator | 0:bb348c97df44 | 404 | { |
lypinator | 0:bb348c97df44 | 405 | cbGATT_ERROR_CODE_OK = 0x00, |
lypinator | 0:bb348c97df44 | 406 | cbGATT_ERROR_CODE_INVALID_HANDLE = 0x01, |
lypinator | 0:bb348c97df44 | 407 | cbGATT_ERROR_CODE_READ_NOT_PERMITTED = 0x02, |
lypinator | 0:bb348c97df44 | 408 | cbGATT_ERROR_CODE_WRITE_NOT_PERMITTED = 0x03, |
lypinator | 0:bb348c97df44 | 409 | cbGATT_ERROR_CODE_INVALID_PDU = 0x04, |
lypinator | 0:bb348c97df44 | 410 | cbGATT_ERROR_CODE_INSUFFICIENT_AUTHENTICATION = 0x05, |
lypinator | 0:bb348c97df44 | 411 | cbGATT_ERROR_CODE_REQUEST_NOT_SUPPORTED = 0x06, |
lypinator | 0:bb348c97df44 | 412 | cbGATT_ERROR_CODE_INVALID_OFFSET = 0x07, |
lypinator | 0:bb348c97df44 | 413 | cbGATT_ERROR_CODE_INSUFFICIENT_AUTHORIZATION = 0x08, |
lypinator | 0:bb348c97df44 | 414 | cbGATT_ERROR_CODE_PREPARE_FULL_QUEUE = 0x09, |
lypinator | 0:bb348c97df44 | 415 | cbGATT_ERROR_CODE_ATTRIBUTE_NOT_FOUND = 0x0A, |
lypinator | 0:bb348c97df44 | 416 | cbGATT_ERROR_CODE_ATTRIBUTE_NOT_LONG = 0x0B, |
lypinator | 0:bb348c97df44 | 417 | cbGATT_ERROR_CODE_INSUFFICIENT_ENCRYPT_KEY_SIZE = 0x0C, |
lypinator | 0:bb348c97df44 | 418 | cbGATT_ERROR_CODE_INVALID_ATTRIBUTE_VALUE_LENGTH = 0x0D, |
lypinator | 0:bb348c97df44 | 419 | cbGATT_ERROR_CODE_UNLIKELY_ERROR = 0x0E, |
lypinator | 0:bb348c97df44 | 420 | cbGATT_ERROR_CODE_INSUFFICIENT_ENCRYPTION = 0x0F, |
lypinator | 0:bb348c97df44 | 421 | cbGATT_ERROR_CODE_UNSUPPORTED_GROUP_TPYE = 0x10, |
lypinator | 0:bb348c97df44 | 422 | cbGATT_ERROR_CODE_INSUFFICIENT_RESOURCES = 0x11, |
lypinator | 0:bb348c97df44 | 423 | |
lypinator | 0:bb348c97df44 | 424 | cbGATT_ERROR_CODE_OUT_OF_RANGE = 0xFF, |
lypinator | 0:bb348c97df44 | 425 | cbGATT_ERROR_CODE_PROCEDURE_ALREADY_IN_PROGRESS = 0xFE, |
lypinator | 0:bb348c97df44 | 426 | cbGATT_ERROR_CODE_IMPROPER_CLIENT_CHAR_CFG = 0xFD, |
lypinator | 0:bb348c97df44 | 427 | |
lypinator | 0:bb348c97df44 | 428 | // Special error codes not according to BT spec. |
lypinator | 0:bb348c97df44 | 429 | // Will never be sent over the air. |
lypinator | 0:bb348c97df44 | 430 | cbGATT_ERROR_CODE_TRANSACTION_TIMEOUT = 0x80, |
lypinator | 0:bb348c97df44 | 431 | cbGATT_ERROR_CODE_DISCONNECTED = 0x81, |
lypinator | 0:bb348c97df44 | 432 | cbGATT_ERROR_CODE_RELIABLE_CHECK_FAILED = 0x82, |
lypinator | 0:bb348c97df44 | 433 | cbGATT_ERROR_CODE_DELAYED_RSP = 0x83, |
lypinator | 0:bb348c97df44 | 434 | } cbGATT_ErrorCode; |
lypinator | 0:bb348c97df44 | 435 | |
lypinator | 0:bb348c97df44 | 436 | |
lypinator | 0:bb348c97df44 | 437 | typedef enum |
lypinator | 0:bb348c97df44 | 438 | { |
lypinator | 0:bb348c97df44 | 439 | // This must map to ATT_TUuidFormat |
lypinator | 0:bb348c97df44 | 440 | cbGATT_UUID_16 = 0x01, |
lypinator | 0:bb348c97df44 | 441 | cbGATT_UUID_128 = 0x02 |
lypinator | 0:bb348c97df44 | 442 | } cbGATT_UuidFormat; |
lypinator | 0:bb348c97df44 | 443 | |
lypinator | 0:bb348c97df44 | 444 | typedef enum |
lypinator | 0:bb348c97df44 | 445 | { |
lypinator | 0:bb348c97df44 | 446 | cbGATT_FINAL_DATA = 0x00, |
lypinator | 0:bb348c97df44 | 447 | cbGATT_MORE_DATA = 0x01, |
lypinator | 0:bb348c97df44 | 448 | cbGATT_CANCEL_DATA = 0x02 |
lypinator | 0:bb348c97df44 | 449 | } cbGATT_WriteLongCharFlag; |
lypinator | 0:bb348c97df44 | 450 | |
lypinator | 0:bb348c97df44 | 451 | typedef struct |
lypinator | 0:bb348c97df44 | 452 | { |
lypinator | 0:bb348c97df44 | 453 | // This must map to ATT_TUuid |
lypinator | 0:bb348c97df44 | 454 | union |
lypinator | 0:bb348c97df44 | 455 | { |
lypinator | 0:bb348c97df44 | 456 | cb_uint16 uuid16; |
lypinator | 0:bb348c97df44 | 457 | cb_uint8 uuid128[16]; |
lypinator | 0:bb348c97df44 | 458 | }; |
lypinator | 0:bb348c97df44 | 459 | cbGATT_UuidFormat format; |
lypinator | 0:bb348c97df44 | 460 | } cbGATT_Uuid; |
lypinator | 0:bb348c97df44 | 461 | |
lypinator | 0:bb348c97df44 | 462 | /** |
lypinator | 0:bb348c97df44 | 463 | * Called when an ACL connection is established |
lypinator | 0:bb348c97df44 | 464 | * @param handle Connection handle |
lypinator | 0:bb348c97df44 | 465 | * @param errorCode Connect error code |
lypinator | 0:bb348c97df44 | 466 | * @param role TODO Add a proper type for role client/server master/slave central/peripheral |
lypinator | 0:bb348c97df44 | 467 | * @param peerBdAddress Address of remote device |
lypinator | 0:bb348c97df44 | 468 | * @param connInterval Connection interval |
lypinator | 0:bb348c97df44 | 469 | * @param connLatency Connection latency |
lypinator | 0:bb348c97df44 | 470 | * @param connTmo Connection timeout |
lypinator | 0:bb348c97df44 | 471 | * @param masterClkAccuracy Master clock accuracy |
lypinator | 0:bb348c97df44 | 472 | * @return None |
lypinator | 0:bb348c97df44 | 473 | */ |
lypinator | 0:bb348c97df44 | 474 | typedef void (*cbGATT_ConnComplEvt)( |
lypinator | 0:bb348c97df44 | 475 | TConnHandle handle, |
lypinator | 0:bb348c97df44 | 476 | TErrorCode errorCode, |
lypinator | 0:bb348c97df44 | 477 | cb_uint8 role, |
lypinator | 0:bb348c97df44 | 478 | TBdAddr peerBdAddress, |
lypinator | 0:bb348c97df44 | 479 | cb_uint16 connInterval, |
lypinator | 0:bb348c97df44 | 480 | cb_uint16 connLatency, |
lypinator | 0:bb348c97df44 | 481 | cb_uint16 connTmo, |
lypinator | 0:bb348c97df44 | 482 | cb_uint8 masterClkAccuracy); |
lypinator | 0:bb348c97df44 | 483 | /** |
lypinator | 0:bb348c97df44 | 484 | * Called when ACL connection is lost. |
lypinator | 0:bb348c97df44 | 485 | * @param handle Connection handle |
lypinator | 0:bb348c97df44 | 486 | * @param errorCode Disconnect error code |
lypinator | 0:bb348c97df44 | 487 | * @return None |
lypinator | 0:bb348c97df44 | 488 | */ |
lypinator | 0:bb348c97df44 | 489 | typedef void (*cbGATT_DisconnectEvt)( |
lypinator | 0:bb348c97df44 | 490 | TConnHandle handle, |
lypinator | 0:bb348c97df44 | 491 | TErrorCode errorCode); |
lypinator | 0:bb348c97df44 | 492 | |
lypinator | 0:bb348c97df44 | 493 | |
lypinator | 0:bb348c97df44 | 494 | /*=========================================================================== |
lypinator | 0:bb348c97df44 | 495 | * FUNCTIONS |
lypinator | 0:bb348c97df44 | 496 | *=========================================================================*/ |
lypinator | 0:bb348c97df44 | 497 | |
lypinator | 0:bb348c97df44 | 498 | |
lypinator | 0:bb348c97df44 | 499 | |
lypinator | 0:bb348c97df44 | 500 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 501 | } |
lypinator | 0:bb348c97df44 | 502 | #endif |
lypinator | 0:bb348c97df44 | 503 | |
lypinator | 0:bb348c97df44 | 504 | #endif |