The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_VBLUNO51/TOOLCHAIN_IAR/nrf_ble_gattc.h@171:3a7713b1edbc, 2018-11-08 (annotated)
- Committer:
- AnnaBridge
- Date:
- Thu Nov 08 11:45:42 2018 +0000
- Revision:
- 171:3a7713b1edbc
- Parent:
- TARGET_TY51822R3/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/TARGET_MCU_NRF51822_UNIFIED/sdk/softdevice/s130/headers/nrf_ble_gattc.h@169:a7c7b631e539
mbed library. Release version 164
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 148:fd96258d940d | 1 | /* |
Kojto | 148:fd96258d940d | 2 | * Copyright (c) 2000 Nordic Semiconductor ASA |
Kojto | 148:fd96258d940d | 3 | * All rights reserved. |
Kojto | 148:fd96258d940d | 4 | * |
Kojto | 148:fd96258d940d | 5 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 148:fd96258d940d | 6 | * are permitted provided that the following conditions are met: |
Kojto | 148:fd96258d940d | 7 | * |
Kojto | 148:fd96258d940d | 8 | * 1. Redistributions of source code must retain the above copyright notice, this list |
Kojto | 148:fd96258d940d | 9 | * of conditions and the following disclaimer. |
Kojto | 148:fd96258d940d | 10 | * |
Kojto | 148:fd96258d940d | 11 | * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA |
Kojto | 148:fd96258d940d | 12 | * integrated circuit in a product or a software update for such product, must reproduce |
Kojto | 148:fd96258d940d | 13 | * the above copyright notice, this list of conditions and the following disclaimer in |
Kojto | 148:fd96258d940d | 14 | * the documentation and/or other materials provided with the distribution. |
Kojto | 148:fd96258d940d | 15 | * |
Kojto | 148:fd96258d940d | 16 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be |
Kojto | 148:fd96258d940d | 17 | * used to endorse or promote products derived from this software without specific prior |
Kojto | 148:fd96258d940d | 18 | * written permission. |
Kojto | 148:fd96258d940d | 19 | * |
Kojto | 148:fd96258d940d | 20 | * 4. This software, with or without modification, must only be used with a |
Kojto | 148:fd96258d940d | 21 | * Nordic Semiconductor ASA integrated circuit. |
Kojto | 148:fd96258d940d | 22 | * |
Kojto | 148:fd96258d940d | 23 | * 5. Any software provided in binary or object form under this license must not be reverse |
Kojto | 148:fd96258d940d | 24 | * engineered, decompiled, modified and/or disassembled. |
Kojto | 148:fd96258d940d | 25 | * |
Kojto | 148:fd96258d940d | 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Kojto | 148:fd96258d940d | 27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Kojto | 148:fd96258d940d | 28 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 148:fd96258d940d | 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Kojto | 148:fd96258d940d | 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Kojto | 148:fd96258d940d | 31 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Kojto | 148:fd96258d940d | 32 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Kojto | 148:fd96258d940d | 33 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Kojto | 148:fd96258d940d | 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Kojto | 148:fd96258d940d | 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 148:fd96258d940d | 36 | * |
Kojto | 148:fd96258d940d | 37 | */ |
Kojto | 148:fd96258d940d | 38 | |
Kojto | 148:fd96258d940d | 39 | |
Kojto | 148:fd96258d940d | 40 | /** |
Kojto | 148:fd96258d940d | 41 | @addtogroup BLE_GATTC Generic Attribute Profile (GATT) Client |
Kojto | 148:fd96258d940d | 42 | @{ |
Kojto | 148:fd96258d940d | 43 | @brief Definitions and prototypes for the GATT Client interface. |
Kojto | 148:fd96258d940d | 44 | */ |
Kojto | 148:fd96258d940d | 45 | |
Kojto | 148:fd96258d940d | 46 | #ifndef NRF_BLE_GATTC_H__ |
Kojto | 148:fd96258d940d | 47 | #define NRF_BLE_GATTC_H__ |
Kojto | 148:fd96258d940d | 48 | |
Kojto | 148:fd96258d940d | 49 | #include "nrf_ble_gatt.h" |
Kojto | 148:fd96258d940d | 50 | #include "nrf_ble_types.h" |
Kojto | 148:fd96258d940d | 51 | #include "nrf_ble_ranges.h" |
Kojto | 148:fd96258d940d | 52 | #include "nrf_svc.h" |
Kojto | 148:fd96258d940d | 53 | |
Kojto | 148:fd96258d940d | 54 | #ifdef __cplusplus |
Kojto | 148:fd96258d940d | 55 | extern "C" { |
Kojto | 148:fd96258d940d | 56 | #endif |
Kojto | 148:fd96258d940d | 57 | |
Kojto | 148:fd96258d940d | 58 | /** @addtogroup BLE_GATTC_ENUMERATIONS Enumerations |
Kojto | 148:fd96258d940d | 59 | * @{ */ |
Kojto | 148:fd96258d940d | 60 | |
Kojto | 148:fd96258d940d | 61 | /**@brief GATTC API SVC numbers. */ |
Kojto | 148:fd96258d940d | 62 | enum BLE_GATTC_SVCS |
Kojto | 148:fd96258d940d | 63 | { |
Kojto | 148:fd96258d940d | 64 | SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER = BLE_GATTC_SVC_BASE, /**< Primary Service Discovery. */ |
Kojto | 148:fd96258d940d | 65 | SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, /**< Relationship Discovery. */ |
Kojto | 148:fd96258d940d | 66 | SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, /**< Characteristic Discovery. */ |
Kojto | 148:fd96258d940d | 67 | SD_BLE_GATTC_DESCRIPTORS_DISCOVER, /**< Characteristic Descriptor Discovery. */ |
Kojto | 148:fd96258d940d | 68 | SD_BLE_GATTC_ATTR_INFO_DISCOVER, /**< Attribute Information Discovery. */ |
Kojto | 148:fd96258d940d | 69 | SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, /**< Read Characteristic Value by UUID. */ |
Kojto | 148:fd96258d940d | 70 | SD_BLE_GATTC_READ, /**< Generic read. */ |
Kojto | 148:fd96258d940d | 71 | SD_BLE_GATTC_CHAR_VALUES_READ, /**< Read multiple Characteristic Values. */ |
Kojto | 148:fd96258d940d | 72 | SD_BLE_GATTC_WRITE, /**< Generic write. */ |
Kojto | 148:fd96258d940d | 73 | SD_BLE_GATTC_HV_CONFIRM, /**< Handle Value Confirmation. */ |
Kojto | 148:fd96258d940d | 74 | }; |
Kojto | 148:fd96258d940d | 75 | |
Kojto | 148:fd96258d940d | 76 | /** |
Kojto | 148:fd96258d940d | 77 | * @brief GATT Client Event IDs. |
Kojto | 148:fd96258d940d | 78 | */ |
Kojto | 148:fd96258d940d | 79 | enum BLE_GATTC_EVTS |
Kojto | 148:fd96258d940d | 80 | { |
Kojto | 148:fd96258d940d | 81 | BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP = BLE_GATTC_EVT_BASE, /**< Primary Service Discovery Response event. \n See @ref ble_gattc_evt_prim_srvc_disc_rsp_t. */ |
Kojto | 148:fd96258d940d | 82 | BLE_GATTC_EVT_REL_DISC_RSP, /**< Relationship Discovery Response event. \n See @ref ble_gattc_evt_rel_disc_rsp_t. */ |
Kojto | 148:fd96258d940d | 83 | BLE_GATTC_EVT_CHAR_DISC_RSP, /**< Characteristic Discovery Response event. \n See @ref ble_gattc_evt_char_disc_rsp_t. */ |
Kojto | 148:fd96258d940d | 84 | BLE_GATTC_EVT_DESC_DISC_RSP, /**< Descriptor Discovery Response event. \n See @ref ble_gattc_evt_desc_disc_rsp_t. */ |
Kojto | 148:fd96258d940d | 85 | BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, /**< Attribute Information Response event. \n See @ref ble_gattc_evt_attr_info_disc_rsp_t. */ |
Kojto | 148:fd96258d940d | 86 | BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP, /**< Read By UUID Response event. \n See @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t. */ |
Kojto | 148:fd96258d940d | 87 | BLE_GATTC_EVT_READ_RSP, /**< Read Response event. \n See @ref ble_gattc_evt_read_rsp_t. */ |
Kojto | 148:fd96258d940d | 88 | BLE_GATTC_EVT_CHAR_VALS_READ_RSP, /**< Read multiple Response event. \n See @ref ble_gattc_evt_char_vals_read_rsp_t. */ |
Kojto | 148:fd96258d940d | 89 | BLE_GATTC_EVT_WRITE_RSP, /**< Write Response event. \n See @ref ble_gattc_evt_write_rsp_t. */ |
Kojto | 148:fd96258d940d | 90 | BLE_GATTC_EVT_HVX, /**< Handle Value Notification or Indication event. \n Confirm indication with @ref sd_ble_gattc_hv_confirm. \n See @ref ble_gattc_evt_hvx_t. */ |
Kojto | 148:fd96258d940d | 91 | BLE_GATTC_EVT_TIMEOUT /**< Timeout event. \n See @ref ble_gattc_evt_timeout_t. */ |
Kojto | 148:fd96258d940d | 92 | }; |
Kojto | 148:fd96258d940d | 93 | |
Kojto | 148:fd96258d940d | 94 | /** @} */ |
Kojto | 148:fd96258d940d | 95 | |
Kojto | 148:fd96258d940d | 96 | /** @addtogroup BLE_GATTC_DEFINES Defines |
Kojto | 148:fd96258d940d | 97 | * @{ */ |
Kojto | 148:fd96258d940d | 98 | |
Kojto | 148:fd96258d940d | 99 | /** @defgroup BLE_ERRORS_GATTC SVC return values specific to GATTC |
Kojto | 148:fd96258d940d | 100 | * @{ */ |
Kojto | 148:fd96258d940d | 101 | #define BLE_ERROR_GATTC_PROC_NOT_PERMITTED (NRF_GATTC_ERR_BASE + 0x000) /**< Procedure not Permitted. */ |
Kojto | 148:fd96258d940d | 102 | /** @} */ |
Kojto | 148:fd96258d940d | 103 | |
Kojto | 148:fd96258d940d | 104 | /** @defgroup BLE_GATTC_ATTR_INFO_FORMAT Attribute Information Formats |
Kojto | 148:fd96258d940d | 105 | * @{ */ |
Kojto | 148:fd96258d940d | 106 | #define BLE_GATTC_ATTR_INFO_FORMAT_16BIT 1 /**< 16-bit Attribute Information Format. */ |
Kojto | 148:fd96258d940d | 107 | #define BLE_GATTC_ATTR_INFO_FORMAT_128BIT 2 /**< 128-bit Attribute Information Format. */ |
Kojto | 148:fd96258d940d | 108 | /** @} */ |
Kojto | 148:fd96258d940d | 109 | |
Kojto | 148:fd96258d940d | 110 | /** @} */ |
Kojto | 148:fd96258d940d | 111 | |
Kojto | 148:fd96258d940d | 112 | /** @addtogroup BLE_GATTC_STRUCTURES Structures |
Kojto | 148:fd96258d940d | 113 | * @{ */ |
Kojto | 148:fd96258d940d | 114 | |
Kojto | 148:fd96258d940d | 115 | /**@brief Operation Handle Range. */ |
Kojto | 148:fd96258d940d | 116 | typedef struct |
Kojto | 148:fd96258d940d | 117 | { |
Kojto | 148:fd96258d940d | 118 | uint16_t start_handle; /**< Start Handle. */ |
Kojto | 148:fd96258d940d | 119 | uint16_t end_handle; /**< End Handle. */ |
Kojto | 148:fd96258d940d | 120 | } ble_gattc_handle_range_t; |
Kojto | 148:fd96258d940d | 121 | |
Kojto | 148:fd96258d940d | 122 | |
Kojto | 148:fd96258d940d | 123 | /**@brief GATT service. */ |
Kojto | 148:fd96258d940d | 124 | typedef struct |
Kojto | 148:fd96258d940d | 125 | { |
Kojto | 148:fd96258d940d | 126 | ble_uuid_t uuid; /**< Service UUID. */ |
Kojto | 148:fd96258d940d | 127 | ble_gattc_handle_range_t handle_range; /**< Service Handle Range. */ |
Kojto | 148:fd96258d940d | 128 | } ble_gattc_service_t; |
Kojto | 148:fd96258d940d | 129 | |
Kojto | 148:fd96258d940d | 130 | |
Kojto | 148:fd96258d940d | 131 | /**@brief GATT include. */ |
Kojto | 148:fd96258d940d | 132 | typedef struct |
Kojto | 148:fd96258d940d | 133 | { |
Kojto | 148:fd96258d940d | 134 | uint16_t handle; /**< Include Handle. */ |
Kojto | 148:fd96258d940d | 135 | ble_gattc_service_t included_srvc; /**< Handle of the included service. */ |
Kojto | 148:fd96258d940d | 136 | } ble_gattc_include_t; |
Kojto | 148:fd96258d940d | 137 | |
Kojto | 148:fd96258d940d | 138 | |
Kojto | 148:fd96258d940d | 139 | /**@brief GATT characteristic. */ |
Kojto | 148:fd96258d940d | 140 | typedef struct |
Kojto | 148:fd96258d940d | 141 | { |
Kojto | 148:fd96258d940d | 142 | ble_uuid_t uuid; /**< Characteristic UUID. */ |
Kojto | 148:fd96258d940d | 143 | ble_gatt_char_props_t char_props; /**< Characteristic Properties. */ |
Kojto | 148:fd96258d940d | 144 | uint8_t char_ext_props : 1; /**< Extended properties present. */ |
Kojto | 148:fd96258d940d | 145 | uint16_t handle_decl; /**< Handle of the Characteristic Declaration. */ |
Kojto | 148:fd96258d940d | 146 | uint16_t handle_value; /**< Handle of the Characteristic Value. */ |
Kojto | 148:fd96258d940d | 147 | } ble_gattc_char_t; |
Kojto | 148:fd96258d940d | 148 | |
Kojto | 148:fd96258d940d | 149 | |
Kojto | 148:fd96258d940d | 150 | /**@brief GATT descriptor. */ |
Kojto | 148:fd96258d940d | 151 | typedef struct |
Kojto | 148:fd96258d940d | 152 | { |
Kojto | 148:fd96258d940d | 153 | uint16_t handle; /**< Descriptor Handle. */ |
Kojto | 148:fd96258d940d | 154 | ble_uuid_t uuid; /**< Descriptor UUID. */ |
Kojto | 148:fd96258d940d | 155 | } ble_gattc_desc_t; |
Kojto | 148:fd96258d940d | 156 | |
Kojto | 148:fd96258d940d | 157 | |
Kojto | 148:fd96258d940d | 158 | /**@brief Write Parameters. */ |
Kojto | 148:fd96258d940d | 159 | typedef struct |
Kojto | 148:fd96258d940d | 160 | { |
Kojto | 148:fd96258d940d | 161 | uint8_t write_op; /**< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS. */ |
Kojto | 148:fd96258d940d | 162 | uint8_t flags; /**< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS. */ |
Kojto | 148:fd96258d940d | 163 | uint16_t handle; /**< Handle to the attribute to be written. */ |
Kojto | 148:fd96258d940d | 164 | uint16_t offset; /**< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0. */ |
Kojto | 148:fd96258d940d | 165 | uint16_t len; /**< Length of data in bytes. */ |
Kojto | 148:fd96258d940d | 166 | uint8_t *p_value; /**< Pointer to the value data. */ |
Kojto | 148:fd96258d940d | 167 | } ble_gattc_write_params_t; |
Kojto | 148:fd96258d940d | 168 | |
Kojto | 148:fd96258d940d | 169 | /**@brief Attribute Information. */ |
Kojto | 148:fd96258d940d | 170 | typedef struct |
Kojto | 148:fd96258d940d | 171 | { |
Kojto | 148:fd96258d940d | 172 | uint16_t handle; /**< Attribute handle. */ |
Kojto | 148:fd96258d940d | 173 | union { |
Kojto | 148:fd96258d940d | 174 | ble_uuid_t uuid16; /**< 16-bit Attribute UUID. */ |
Kojto | 148:fd96258d940d | 175 | ble_uuid128_t uuid128; /**< 128-bit Attribute UUID. */ |
Kojto | 148:fd96258d940d | 176 | } info; |
Kojto | 148:fd96258d940d | 177 | } ble_gattc_attr_info_t; |
Kojto | 148:fd96258d940d | 178 | |
Kojto | 148:fd96258d940d | 179 | /**@brief Event structure for @ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP. */ |
Kojto | 148:fd96258d940d | 180 | typedef struct |
Kojto | 148:fd96258d940d | 181 | { |
Kojto | 148:fd96258d940d | 182 | uint16_t count; /**< Service count. */ |
Kojto | 148:fd96258d940d | 183 | ble_gattc_service_t services[1]; /**< Service data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 184 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 185 | } ble_gattc_evt_prim_srvc_disc_rsp_t; |
Kojto | 148:fd96258d940d | 186 | |
Kojto | 148:fd96258d940d | 187 | /**@brief Event structure for @ref BLE_GATTC_EVT_REL_DISC_RSP. */ |
Kojto | 148:fd96258d940d | 188 | typedef struct |
Kojto | 148:fd96258d940d | 189 | { |
Kojto | 148:fd96258d940d | 190 | uint16_t count; /**< Include count. */ |
Kojto | 148:fd96258d940d | 191 | ble_gattc_include_t includes[1]; /**< Include data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 192 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 193 | } ble_gattc_evt_rel_disc_rsp_t; |
Kojto | 148:fd96258d940d | 194 | |
Kojto | 148:fd96258d940d | 195 | /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_DISC_RSP. */ |
Kojto | 148:fd96258d940d | 196 | typedef struct |
Kojto | 148:fd96258d940d | 197 | { |
Kojto | 148:fd96258d940d | 198 | uint16_t count; /**< Characteristic count. */ |
Kojto | 148:fd96258d940d | 199 | ble_gattc_char_t chars[1]; /**< Characteristic data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 200 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 201 | } ble_gattc_evt_char_disc_rsp_t; |
Kojto | 148:fd96258d940d | 202 | |
Kojto | 148:fd96258d940d | 203 | /**@brief Event structure for @ref BLE_GATTC_EVT_DESC_DISC_RSP. */ |
Kojto | 148:fd96258d940d | 204 | typedef struct |
Kojto | 148:fd96258d940d | 205 | { |
Kojto | 148:fd96258d940d | 206 | uint16_t count; /**< Descriptor count. */ |
Kojto | 148:fd96258d940d | 207 | ble_gattc_desc_t descs[1]; /**< Descriptor data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 208 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 209 | } ble_gattc_evt_desc_disc_rsp_t; |
Kojto | 148:fd96258d940d | 210 | |
Kojto | 148:fd96258d940d | 211 | /**@brief Event structure for @ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP. */ |
Kojto | 148:fd96258d940d | 212 | typedef struct |
Kojto | 148:fd96258d940d | 213 | { |
Kojto | 148:fd96258d940d | 214 | uint16_t count; /**< Attribute count. */ |
Kojto | 148:fd96258d940d | 215 | uint8_t format; /**< Attribute information format, see @ref BLE_GATTC_ATTR_INFO_FORMAT. */ |
Kojto | 148:fd96258d940d | 216 | ble_gattc_attr_info_t attr_info[1]; /**< Attribute information. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 217 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 218 | } ble_gattc_evt_attr_info_disc_rsp_t; |
Kojto | 148:fd96258d940d | 219 | |
Kojto | 148:fd96258d940d | 220 | /**@brief GATT read by UUID handle value pair. */ |
Kojto | 148:fd96258d940d | 221 | typedef struct |
Kojto | 148:fd96258d940d | 222 | { |
Kojto | 148:fd96258d940d | 223 | uint16_t handle; /**< Attribute Handle. */ |
Kojto | 148:fd96258d940d | 224 | uint8_t *p_value; /**< Pointer to value, variable length (length available as value_len in @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t). |
Kojto | 148:fd96258d940d | 225 | Please note that this pointer is absolute to the memory provided by the user when retrieving the event, |
Kojto | 148:fd96258d940d | 226 | so it will effectively point to a location inside the handle_value array. */ |
Kojto | 148:fd96258d940d | 227 | } ble_gattc_handle_value_t; |
Kojto | 148:fd96258d940d | 228 | |
Kojto | 148:fd96258d940d | 229 | /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP. */ |
Kojto | 148:fd96258d940d | 230 | typedef struct |
Kojto | 148:fd96258d940d | 231 | { |
Kojto | 148:fd96258d940d | 232 | uint16_t count; /**< Handle-Value Pair Count. */ |
Kojto | 148:fd96258d940d | 233 | uint16_t value_len; /**< Length of the value in Handle-Value(s) list. */ |
Kojto | 148:fd96258d940d | 234 | ble_gattc_handle_value_t handle_value[1]; /**< Handle-Value(s) list. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 235 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 236 | } ble_gattc_evt_char_val_by_uuid_read_rsp_t; |
Kojto | 148:fd96258d940d | 237 | |
Kojto | 148:fd96258d940d | 238 | /**@brief Event structure for @ref BLE_GATTC_EVT_READ_RSP. */ |
Kojto | 148:fd96258d940d | 239 | typedef struct |
Kojto | 148:fd96258d940d | 240 | { |
Kojto | 148:fd96258d940d | 241 | uint16_t handle; /**< Attribute Handle. */ |
Kojto | 148:fd96258d940d | 242 | uint16_t offset; /**< Offset of the attribute data. */ |
Kojto | 148:fd96258d940d | 243 | uint16_t len; /**< Attribute data length. */ |
Kojto | 148:fd96258d940d | 244 | uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 245 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 246 | } ble_gattc_evt_read_rsp_t; |
Kojto | 148:fd96258d940d | 247 | |
Kojto | 148:fd96258d940d | 248 | /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP. */ |
Kojto | 148:fd96258d940d | 249 | typedef struct |
Kojto | 148:fd96258d940d | 250 | { |
Kojto | 148:fd96258d940d | 251 | uint16_t len; /**< Concatenated Attribute values length. */ |
Kojto | 148:fd96258d940d | 252 | uint8_t values[1]; /**< Attribute values. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 253 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 254 | } ble_gattc_evt_char_vals_read_rsp_t; |
Kojto | 148:fd96258d940d | 255 | |
Kojto | 148:fd96258d940d | 256 | /**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_RSP. */ |
Kojto | 148:fd96258d940d | 257 | typedef struct |
Kojto | 148:fd96258d940d | 258 | { |
Kojto | 148:fd96258d940d | 259 | uint16_t handle; /**< Attribute Handle. */ |
Kojto | 148:fd96258d940d | 260 | uint8_t write_op; /**< Type of write operation, see @ref BLE_GATT_WRITE_OPS. */ |
Kojto | 148:fd96258d940d | 261 | uint16_t offset; /**< Data offset. */ |
Kojto | 148:fd96258d940d | 262 | uint16_t len; /**< Data length. */ |
Kojto | 148:fd96258d940d | 263 | uint8_t data[1]; /**< Data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 264 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 265 | } ble_gattc_evt_write_rsp_t; |
Kojto | 148:fd96258d940d | 266 | |
Kojto | 148:fd96258d940d | 267 | /**@brief Event structure for @ref BLE_GATTC_EVT_HVX. */ |
Kojto | 148:fd96258d940d | 268 | typedef struct |
Kojto | 148:fd96258d940d | 269 | { |
Kojto | 148:fd96258d940d | 270 | uint16_t handle; /**< Handle to which the HVx operation applies. */ |
Kojto | 148:fd96258d940d | 271 | uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */ |
Kojto | 148:fd96258d940d | 272 | uint16_t len; /**< Attribute data length. */ |
Kojto | 148:fd96258d940d | 273 | uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. |
Kojto | 148:fd96258d940d | 274 | See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ |
Kojto | 148:fd96258d940d | 275 | } ble_gattc_evt_hvx_t; |
Kojto | 148:fd96258d940d | 276 | |
Kojto | 148:fd96258d940d | 277 | /**@brief Event structure for @ref BLE_GATTC_EVT_TIMEOUT. */ |
Kojto | 148:fd96258d940d | 278 | typedef struct |
Kojto | 148:fd96258d940d | 279 | { |
Kojto | 148:fd96258d940d | 280 | uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */ |
Kojto | 148:fd96258d940d | 281 | } ble_gattc_evt_timeout_t; |
Kojto | 148:fd96258d940d | 282 | |
Kojto | 148:fd96258d940d | 283 | /**@brief GATTC event structure. */ |
Kojto | 148:fd96258d940d | 284 | typedef struct |
Kojto | 148:fd96258d940d | 285 | { |
Kojto | 148:fd96258d940d | 286 | uint16_t conn_handle; /**< Connection Handle on which event occured. */ |
Kojto | 148:fd96258d940d | 287 | uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */ |
Kojto | 148:fd96258d940d | 288 | uint16_t error_handle; /**< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID. */ |
Kojto | 148:fd96258d940d | 289 | union |
Kojto | 148:fd96258d940d | 290 | { |
Kojto | 148:fd96258d940d | 291 | ble_gattc_evt_prim_srvc_disc_rsp_t prim_srvc_disc_rsp; /**< Primary Service Discovery Response Event Parameters. */ |
Kojto | 148:fd96258d940d | 292 | ble_gattc_evt_rel_disc_rsp_t rel_disc_rsp; /**< Relationship Discovery Response Event Parameters. */ |
Kojto | 148:fd96258d940d | 293 | ble_gattc_evt_char_disc_rsp_t char_disc_rsp; /**< Characteristic Discovery Response Event Parameters. */ |
Kojto | 148:fd96258d940d | 294 | ble_gattc_evt_desc_disc_rsp_t desc_disc_rsp; /**< Descriptor Discovery Response Event Parameters. */ |
Kojto | 148:fd96258d940d | 295 | ble_gattc_evt_char_val_by_uuid_read_rsp_t char_val_by_uuid_read_rsp; /**< Characteristic Value Read by UUID Response Event Parameters. */ |
Kojto | 148:fd96258d940d | 296 | ble_gattc_evt_read_rsp_t read_rsp; /**< Read Response Event Parameters. */ |
Kojto | 148:fd96258d940d | 297 | ble_gattc_evt_char_vals_read_rsp_t char_vals_read_rsp; /**< Characteristic Values Read Response Event Parameters. */ |
Kojto | 148:fd96258d940d | 298 | ble_gattc_evt_write_rsp_t write_rsp; /**< Write Response Event Parameters. */ |
Kojto | 148:fd96258d940d | 299 | ble_gattc_evt_hvx_t hvx; /**< Handle Value Notification/Indication Event Parameters. */ |
Kojto | 148:fd96258d940d | 300 | ble_gattc_evt_timeout_t timeout; /**< Timeout Event Parameters. */ |
Kojto | 148:fd96258d940d | 301 | ble_gattc_evt_attr_info_disc_rsp_t attr_info_disc_rsp; /**< Attribute Information Discovery Event Parameters. */ |
Kojto | 148:fd96258d940d | 302 | } params; /**< Event Parameters. @note Only valid if @ref gatt_status == @ref BLE_GATT_STATUS_SUCCESS. */ |
Kojto | 148:fd96258d940d | 303 | } ble_gattc_evt_t; |
Kojto | 148:fd96258d940d | 304 | /** @} */ |
Kojto | 148:fd96258d940d | 305 | |
Kojto | 148:fd96258d940d | 306 | /** @addtogroup BLE_GATTC_FUNCTIONS Functions |
Kojto | 148:fd96258d940d | 307 | * @{ */ |
Kojto | 148:fd96258d940d | 308 | |
Kojto | 148:fd96258d940d | 309 | /**@brief Initiate or continue a GATT Primary Service Discovery procedure. |
Kojto | 148:fd96258d940d | 310 | * |
Kojto | 148:fd96258d940d | 311 | * @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle. |
Kojto | 148:fd96258d940d | 312 | * If the last service has not been reached, this function must be called again with an updated start handle value to continue the search. |
Kojto | 148:fd96258d940d | 313 | * |
Kojto | 148:fd96258d940d | 314 | * @note If any of the discovered services have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with |
Kojto | 148:fd96258d940d | 315 | * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event. |
Kojto | 148:fd96258d940d | 316 | * |
Kojto | 148:fd96258d940d | 317 | * @events |
Kojto | 148:fd96258d940d | 318 | * @event{@ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP} |
Kojto | 148:fd96258d940d | 319 | * @endevents |
Kojto | 148:fd96258d940d | 320 | * |
Kojto | 148:fd96258d940d | 321 | * @mscs |
Kojto | 148:fd96258d940d | 322 | * @mmsc{@ref BLE_GATTC_PRIM_SRVC_DISC_MSC} |
Kojto | 148:fd96258d940d | 323 | * @endmscs |
Kojto | 148:fd96258d940d | 324 | * |
Kojto | 148:fd96258d940d | 325 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 326 | * @param[in] start_handle Handle to start searching from. |
Kojto | 148:fd96258d940d | 327 | * @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned. |
Kojto | 148:fd96258d940d | 328 | * |
Kojto | 148:fd96258d940d | 329 | * @retval ::NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure. |
Kojto | 148:fd96258d940d | 330 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 331 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. |
Kojto | 148:fd96258d940d | 332 | * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
Kojto | 148:fd96258d940d | 333 | * @retval ::NRF_ERROR_BUSY Client procedure already in progress. |
Kojto | 148:fd96258d940d | 334 | */ |
Kojto | 148:fd96258d940d | 335 | SVCALL(SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER, uint32_t, sd_ble_gattc_primary_services_discover(uint16_t conn_handle, uint16_t start_handle, ble_uuid_t const *p_srvc_uuid)); |
Kojto | 148:fd96258d940d | 336 | |
Kojto | 148:fd96258d940d | 337 | |
Kojto | 148:fd96258d940d | 338 | /**@brief Initiate or continue a GATT Relationship Discovery procedure. |
Kojto | 148:fd96258d940d | 339 | * |
Kojto | 148:fd96258d940d | 340 | * @details This function initiates or resumes the Find Included Services sub-procedure. If the last included service has not been reached, |
Kojto | 148:fd96258d940d | 341 | * this must be called again with an updated handle range to continue the search. |
Kojto | 148:fd96258d940d | 342 | * |
Kojto | 148:fd96258d940d | 343 | * @events |
Kojto | 148:fd96258d940d | 344 | * @event{@ref BLE_GATTC_EVT_REL_DISC_RSP} |
Kojto | 148:fd96258d940d | 345 | * @endevents |
Kojto | 148:fd96258d940d | 346 | * |
Kojto | 148:fd96258d940d | 347 | * @mscs |
Kojto | 148:fd96258d940d | 348 | * @mmsc{@ref BLE_GATTC_REL_DISC_MSC} |
Kojto | 148:fd96258d940d | 349 | * @endmscs |
Kojto | 148:fd96258d940d | 350 | * |
Kojto | 148:fd96258d940d | 351 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 352 | * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on. |
Kojto | 148:fd96258d940d | 353 | * |
Kojto | 148:fd96258d940d | 354 | * @retval ::NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure. |
Kojto | 148:fd96258d940d | 355 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 356 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. |
Kojto | 148:fd96258d940d | 357 | * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
Kojto | 148:fd96258d940d | 358 | * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
Kojto | 148:fd96258d940d | 359 | * @retval ::NRF_ERROR_BUSY Client procedure already in progress. |
Kojto | 148:fd96258d940d | 360 | */ |
Kojto | 148:fd96258d940d | 361 | SVCALL(SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, uint32_t, sd_ble_gattc_relationships_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); |
Kojto | 148:fd96258d940d | 362 | |
Kojto | 148:fd96258d940d | 363 | |
Kojto | 148:fd96258d940d | 364 | /**@brief Initiate or continue a GATT Characteristic Discovery procedure. |
Kojto | 148:fd96258d940d | 365 | * |
Kojto | 148:fd96258d940d | 366 | * @details This function initiates or resumes a Characteristic discovery procedure. If the last Characteristic has not been reached, |
Kojto | 148:fd96258d940d | 367 | * this must be called again with an updated handle range to continue the discovery. |
Kojto | 148:fd96258d940d | 368 | * |
Kojto | 148:fd96258d940d | 369 | * @note If any of the discovered characteristics have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with |
Kojto | 148:fd96258d940d | 370 | * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event. |
Kojto | 148:fd96258d940d | 371 | * |
Kojto | 148:fd96258d940d | 372 | * @events |
Kojto | 148:fd96258d940d | 373 | * @event{@ref BLE_GATTC_EVT_CHAR_DISC_RSP} |
Kojto | 148:fd96258d940d | 374 | * @endevents |
Kojto | 148:fd96258d940d | 375 | * |
Kojto | 148:fd96258d940d | 376 | * @mscs |
Kojto | 148:fd96258d940d | 377 | * @mmsc{@ref BLE_GATTC_CHAR_DISC_MSC} |
Kojto | 148:fd96258d940d | 378 | * @endmscs |
Kojto | 148:fd96258d940d | 379 | * |
Kojto | 148:fd96258d940d | 380 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 381 | * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on. |
Kojto | 148:fd96258d940d | 382 | * |
Kojto | 148:fd96258d940d | 383 | * @retval ::NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure. |
Kojto | 148:fd96258d940d | 384 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 385 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. |
Kojto | 148:fd96258d940d | 386 | * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
Kojto | 148:fd96258d940d | 387 | * @retval ::NRF_ERROR_BUSY Client procedure already in progress. |
Kojto | 148:fd96258d940d | 388 | */ |
Kojto | 148:fd96258d940d | 389 | SVCALL(SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, uint32_t, sd_ble_gattc_characteristics_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); |
Kojto | 148:fd96258d940d | 390 | |
Kojto | 148:fd96258d940d | 391 | |
Kojto | 148:fd96258d940d | 392 | /**@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure. |
Kojto | 148:fd96258d940d | 393 | * |
Kojto | 148:fd96258d940d | 394 | * @details This function initiates or resumes a Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached, |
Kojto | 148:fd96258d940d | 395 | * this must be called again with an updated handle range to continue the discovery. |
Kojto | 148:fd96258d940d | 396 | * |
Kojto | 148:fd96258d940d | 397 | * @events |
Kojto | 148:fd96258d940d | 398 | * @event{BLE_GATTC_EVT_DESC_DISC_RSP} |
Kojto | 148:fd96258d940d | 399 | * @endevents |
Kojto | 148:fd96258d940d | 400 | * |
Kojto | 148:fd96258d940d | 401 | * @mscs |
Kojto | 148:fd96258d940d | 402 | * @mmsc{@ref BLE_GATTC_DESC_DISC_MSC} |
Kojto | 148:fd96258d940d | 403 | * @endmscs |
Kojto | 148:fd96258d940d | 404 | * |
Kojto | 148:fd96258d940d | 405 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 406 | * @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on. |
Kojto | 148:fd96258d940d | 407 | * |
Kojto | 148:fd96258d940d | 408 | * @retval ::NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure. |
Kojto | 148:fd96258d940d | 409 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 410 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. |
Kojto | 148:fd96258d940d | 411 | * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
Kojto | 148:fd96258d940d | 412 | * @retval ::NRF_ERROR_BUSY Client procedure already in progress. |
Kojto | 148:fd96258d940d | 413 | */ |
Kojto | 148:fd96258d940d | 414 | SVCALL(SD_BLE_GATTC_DESCRIPTORS_DISCOVER, uint32_t, sd_ble_gattc_descriptors_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); |
Kojto | 148:fd96258d940d | 415 | |
Kojto | 148:fd96258d940d | 416 | |
Kojto | 148:fd96258d940d | 417 | /**@brief Initiate or continue a GATT Read using Characteristic UUID procedure. |
Kojto | 148:fd96258d940d | 418 | * |
Kojto | 148:fd96258d940d | 419 | * @details This function initiates or resumes a Read using Characteristic UUID procedure. If the last Characteristic has not been reached, |
Kojto | 148:fd96258d940d | 420 | * this must be called again with an updated handle range to continue the discovery. |
Kojto | 148:fd96258d940d | 421 | * |
Kojto | 148:fd96258d940d | 422 | * @events |
Kojto | 148:fd96258d940d | 423 | * @event{BLE_GATTC_EVT_DESC_DISC_RSP} |
Kojto | 148:fd96258d940d | 424 | * @endevents |
Kojto | 148:fd96258d940d | 425 | * |
Kojto | 148:fd96258d940d | 426 | * @mscs |
Kojto | 148:fd96258d940d | 427 | * @mmsc{@ref BLE_GATTC_READ_UUID_MSC} |
Kojto | 148:fd96258d940d | 428 | * @endmscs |
Kojto | 148:fd96258d940d | 429 | * |
Kojto | 148:fd96258d940d | 430 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 431 | * @param[in] p_uuid Pointer to a Characteristic value UUID to read. |
Kojto | 148:fd96258d940d | 432 | * @param[in] p_handle_range A pointer to the range of handles to perform this procedure on. |
Kojto | 148:fd96258d940d | 433 | * |
Kojto | 148:fd96258d940d | 434 | * @retval ::NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure. |
Kojto | 148:fd96258d940d | 435 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 436 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. |
Kojto | 148:fd96258d940d | 437 | * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
Kojto | 148:fd96258d940d | 438 | * @retval ::NRF_ERROR_BUSY Client procedure already in progress. |
Kojto | 148:fd96258d940d | 439 | */ |
Kojto | 148:fd96258d940d | 440 | SVCALL(SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, uint32_t, sd_ble_gattc_char_value_by_uuid_read(uint16_t conn_handle, ble_uuid_t const *p_uuid, ble_gattc_handle_range_t const *p_handle_range)); |
Kojto | 148:fd96258d940d | 441 | |
Kojto | 148:fd96258d940d | 442 | |
Kojto | 148:fd96258d940d | 443 | /**@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure. |
Kojto | 148:fd96258d940d | 444 | * |
Kojto | 148:fd96258d940d | 445 | * @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor |
Kojto | 148:fd96258d940d | 446 | * to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the |
Kojto | 148:fd96258d940d | 447 | * complete value. |
Kojto | 148:fd96258d940d | 448 | * |
Kojto | 148:fd96258d940d | 449 | * @events |
Kojto | 148:fd96258d940d | 450 | * @event{@ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP} |
Kojto | 148:fd96258d940d | 451 | * @endevents |
Kojto | 148:fd96258d940d | 452 | * |
Kojto | 148:fd96258d940d | 453 | * @mscs |
Kojto | 148:fd96258d940d | 454 | * @mmsc{@ref BLE_GATTC_VALUE_READ_MSC} |
Kojto | 148:fd96258d940d | 455 | * @endmscs |
Kojto | 148:fd96258d940d | 456 | * |
Kojto | 148:fd96258d940d | 457 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 458 | * @param[in] handle The handle of the attribute to be read. |
Kojto | 148:fd96258d940d | 459 | * @param[in] offset Offset into the attribute value to be read. |
Kojto | 148:fd96258d940d | 460 | * |
Kojto | 148:fd96258d940d | 461 | * @retval ::NRF_SUCCESS Successfully started or resumed the Read (Long) procedure. |
Kojto | 148:fd96258d940d | 462 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 463 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. |
Kojto | 148:fd96258d940d | 464 | * @retval ::NRF_ERROR_BUSY Client procedure already in progress. |
Kojto | 148:fd96258d940d | 465 | */ |
Kojto | 148:fd96258d940d | 466 | SVCALL(SD_BLE_GATTC_READ, uint32_t, sd_ble_gattc_read(uint16_t conn_handle, uint16_t handle, uint16_t offset)); |
Kojto | 148:fd96258d940d | 467 | |
Kojto | 148:fd96258d940d | 468 | |
Kojto | 148:fd96258d940d | 469 | /**@brief Initiate a GATT Read Multiple Characteristic Values procedure. |
Kojto | 148:fd96258d940d | 470 | * |
Kojto | 148:fd96258d940d | 471 | * @details This function initiates a GATT Read Multiple Characteristic Values procedure. |
Kojto | 148:fd96258d940d | 472 | * |
Kojto | 148:fd96258d940d | 473 | * @events |
Kojto | 148:fd96258d940d | 474 | * @event{@ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP} |
Kojto | 148:fd96258d940d | 475 | * @endevents |
Kojto | 148:fd96258d940d | 476 | * |
Kojto | 148:fd96258d940d | 477 | * @mscs |
Kojto | 148:fd96258d940d | 478 | * @mmsc{@ref BLE_GATTC_READ_MULT_MSC} |
Kojto | 148:fd96258d940d | 479 | * @endmscs |
Kojto | 148:fd96258d940d | 480 | * |
Kojto | 148:fd96258d940d | 481 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 482 | * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read. |
Kojto | 148:fd96258d940d | 483 | * @param[in] handle_count The number of handles in p_handles. |
Kojto | 148:fd96258d940d | 484 | * |
Kojto | 148:fd96258d940d | 485 | * @retval ::NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure. |
Kojto | 148:fd96258d940d | 486 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 487 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. |
Kojto | 148:fd96258d940d | 488 | * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
Kojto | 148:fd96258d940d | 489 | * @retval ::NRF_ERROR_BUSY Client procedure already in progress. |
Kojto | 148:fd96258d940d | 490 | */ |
Kojto | 148:fd96258d940d | 491 | SVCALL(SD_BLE_GATTC_CHAR_VALUES_READ, uint32_t, sd_ble_gattc_char_values_read(uint16_t conn_handle, uint16_t const *p_handles, uint16_t handle_count)); |
Kojto | 148:fd96258d940d | 492 | |
Kojto | 148:fd96258d940d | 493 | |
Kojto | 148:fd96258d940d | 494 | /**@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure. |
Kojto | 148:fd96258d940d | 495 | * |
Kojto | 148:fd96258d940d | 496 | * @details This function can perform all write procedures described in GATT. |
Kojto | 148:fd96258d940d | 497 | * |
Kojto | 148:fd96258d940d | 498 | * @note It is important to note that a write without response will <b>consume an application buffer</b>, and will therefore |
Kojto | 148:fd96258d940d | 499 | * generate a @ref BLE_EVT_TX_COMPLETE event when the packet has been transmitted. A write (with response) on the other hand will use the |
Kojto | 148:fd96258d940d | 500 | * standard client internal buffer and thus will only generate a @ref BLE_GATTC_EVT_WRITE_RSP event as soon as the write response |
Kojto | 148:fd96258d940d | 501 | * has been received from the peer. Please see the documentation of @ref sd_ble_tx_packet_count_get for more details. |
Kojto | 148:fd96258d940d | 502 | * |
Kojto | 148:fd96258d940d | 503 | * @events |
Kojto | 148:fd96258d940d | 504 | * @event{@ref BLE_GATTC_EVT_WRITE_RSP, Generated when using write request or queued writes.} |
Kojto | 148:fd96258d940d | 505 | * @endevents |
Kojto | 148:fd96258d940d | 506 | * |
Kojto | 148:fd96258d940d | 507 | * @mscs |
Kojto | 148:fd96258d940d | 508 | * @mmsc{@ref BLE_GATTC_VALUE_WRITE_MSC} |
Kojto | 148:fd96258d940d | 509 | * @mmsc{@ref BLE_GATTC_VALUE_LONG_WRITE_MSC} |
Kojto | 148:fd96258d940d | 510 | * @mmsc{@ref BLE_GATTC_VALUE_RELIABLE_WRITE_MSC} |
Kojto | 148:fd96258d940d | 511 | * @mmsc{@ref BLE_COMMON_APP_BUFF_MSC} |
Kojto | 148:fd96258d940d | 512 | * @endmscs |
Kojto | 148:fd96258d940d | 513 | * |
Kojto | 148:fd96258d940d | 514 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 515 | * @param[in] p_write_params A pointer to a write parameters structure. |
Kojto | 148:fd96258d940d | 516 | * |
Kojto | 148:fd96258d940d | 517 | * @retval ::NRF_SUCCESS Successfully started the Write procedure. |
Kojto | 148:fd96258d940d | 518 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 519 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. |
Kojto | 148:fd96258d940d | 520 | * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
Kojto | 148:fd96258d940d | 521 | * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. |
Kojto | 148:fd96258d940d | 522 | * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. |
Kojto | 148:fd96258d940d | 523 | * @retval ::NRF_ERROR_BUSY Procedure already in progress. |
Kojto | 148:fd96258d940d | 524 | * @retval ::BLE_ERROR_NO_TX_PACKETS No available application packets for this connection. |
Kojto | 148:fd96258d940d | 525 | */ |
Kojto | 148:fd96258d940d | 526 | SVCALL(SD_BLE_GATTC_WRITE, uint32_t, sd_ble_gattc_write(uint16_t conn_handle, ble_gattc_write_params_t const *p_write_params)); |
Kojto | 148:fd96258d940d | 527 | |
Kojto | 148:fd96258d940d | 528 | |
Kojto | 148:fd96258d940d | 529 | /**@brief Send a Handle Value Confirmation to the GATT Server. |
Kojto | 148:fd96258d940d | 530 | * |
Kojto | 148:fd96258d940d | 531 | * @mscs |
Kojto | 148:fd96258d940d | 532 | * @mmsc{@ref BLE_GATTC_HVI_MSC} |
Kojto | 148:fd96258d940d | 533 | * @endmscs |
Kojto | 148:fd96258d940d | 534 | * |
Kojto | 148:fd96258d940d | 535 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 536 | * @param[in] handle The handle of the attribute in the indication. |
Kojto | 148:fd96258d940d | 537 | * |
Kojto | 148:fd96258d940d | 538 | * @retval ::NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission. |
Kojto | 148:fd96258d940d | 539 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. |
Kojto | 148:fd96258d940d | 540 | * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no Indication pending to be confirmed. |
Kojto | 148:fd96258d940d | 541 | * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle. |
Kojto | 148:fd96258d940d | 542 | */ |
Kojto | 148:fd96258d940d | 543 | SVCALL(SD_BLE_GATTC_HV_CONFIRM, uint32_t, sd_ble_gattc_hv_confirm(uint16_t conn_handle, uint16_t handle)); |
Kojto | 148:fd96258d940d | 544 | |
Kojto | 148:fd96258d940d | 545 | /**@brief Discovers information about a range of attributes on a GATT server. |
Kojto | 148:fd96258d940d | 546 | * |
Kojto | 148:fd96258d940d | 547 | * @events |
Kojto | 148:fd96258d940d | 548 | * @event{@ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, Generated when information about a range of attributes has been received.} |
Kojto | 148:fd96258d940d | 549 | * @endevents |
Kojto | 148:fd96258d940d | 550 | * |
Kojto | 148:fd96258d940d | 551 | * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. |
Kojto | 148:fd96258d940d | 552 | * @param[in] p_handle_range The range of handles to request information about. |
Kojto | 148:fd96258d940d | 553 | * |
Kojto | 148:fd96258d940d | 554 | * @retval ::NRF_SUCCESS Successfully started an attribute information discovery procedure. |
Kojto | 148:fd96258d940d | 555 | * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle. |
Kojto | 148:fd96258d940d | 556 | * @retval ::NRF_ERROR_INVALID_STATE Invalid connection state |
Kojto | 148:fd96258d940d | 557 | * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. |
Kojto | 148:fd96258d940d | 558 | * @retval ::NRF_ERROR_BUSY Client procedure already in progress. |
Kojto | 148:fd96258d940d | 559 | */ |
Kojto | 148:fd96258d940d | 560 | SVCALL(SD_BLE_GATTC_ATTR_INFO_DISCOVER, uint32_t, sd_ble_gattc_attr_info_discover(uint16_t conn_handle, ble_gattc_handle_range_t const * p_handle_range)); |
Kojto | 148:fd96258d940d | 561 | |
Kojto | 148:fd96258d940d | 562 | /** @} */ |
Kojto | 148:fd96258d940d | 563 | |
Kojto | 148:fd96258d940d | 564 | #ifdef __cplusplus |
Kojto | 148:fd96258d940d | 565 | } |
Kojto | 148:fd96258d940d | 566 | #endif |
Kojto | 148:fd96258d940d | 567 | #endif /* NRF_BLE_GATTC_H__ */ |
Kojto | 148:fd96258d940d | 568 | |
Kojto | 148:fd96258d940d | 569 | /** |
Kojto | 148:fd96258d940d | 570 | @} |
Kojto | 148:fd96258d940d | 571 | @} |
Kojto | 148:fd96258d940d | 572 | */ |