Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nRF51822 by
ble_gattc.h
00001 /* 00002 * Copyright (c) Nordic Semiconductor ASA 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without modification, 00006 * are permitted provided that the following conditions are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright notice, this 00009 * list of conditions and the following disclaimer. 00010 * 00011 * 2. Redistributions in binary form must reproduce the above copyright notice, this 00012 * list of conditions and the following disclaimer in the documentation and/or 00013 * other materials provided with the distribution. 00014 * 00015 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other 00016 * contributors to this software may be used to endorse or promote products 00017 * derived from this software without specific prior written permission. 00018 * 00019 * 4. This software must only be used in a processor manufactured by Nordic 00020 * Semiconductor ASA, or in a processor manufactured by a third party that 00021 * is used in combination with a processor manufactured by Nordic Semiconductor. 00022 * 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00025 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00026 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00027 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 00028 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00029 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00030 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00031 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00032 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00033 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 */ 00036 00037 /** 00038 @addtogroup BLE_GATTC Generic Attribute Profile (GATT) Client 00039 @{ 00040 @brief Definitions and prototypes for the GATT Client interface. 00041 */ 00042 00043 #ifndef BLE_GATTC_H__ 00044 #define BLE_GATTC_H__ 00045 00046 #include "ble_gatt.h" 00047 #include "ble_types.h" 00048 #include "ble_ranges.h" 00049 #include "nrf_svc.h" 00050 00051 /** @addtogroup BLE_GATTC_ENUMERATIONS Enumerations 00052 * @{ */ 00053 00054 /**@brief GATTC API SVC numbers. */ 00055 enum BLE_GATTC_SVCS 00056 { 00057 SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER = BLE_GATTC_SVC_BASE, /**< Primary Service Discovery. */ 00058 SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, /**< Relationship Discovery. */ 00059 SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, /**< Characteristic Discovery. */ 00060 SD_BLE_GATTC_DESCRIPTORS_DISCOVER, /**< Characteristic Descriptor Discovery. */ 00061 SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, /**< Read Characteristic Value by UUID. */ 00062 SD_BLE_GATTC_READ, /**< Generic read. */ 00063 SD_BLE_GATTC_CHAR_VALUES_READ, /**< Read multiple Characteristic Values. */ 00064 SD_BLE_GATTC_WRITE, /**< Generic write. */ 00065 SD_BLE_GATTC_HV_CONFIRM /**< Handle Value Confirmation. */ 00066 }; 00067 00068 /** 00069 * @brief GATT Client Event IDs. 00070 */ 00071 enum BLE_GATTC_EVTS 00072 { 00073 BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP = BLE_GATTC_EVT_BASE, /**< Primary Service Discovery Response event. @ref ble_gattc_evt_prim_srvc_disc_rsp_t */ 00074 BLE_GATTC_EVT_REL_DISC_RSP, /**< Relationship Discovery Response event. @ref ble_gattc_evt_rel_disc_rsp_t */ 00075 BLE_GATTC_EVT_CHAR_DISC_RSP, /**< Characteristic Discovery Response event. @ref ble_gattc_evt_char_disc_rsp_t */ 00076 BLE_GATTC_EVT_DESC_DISC_RSP, /**< Descriptor Discovery Response event. @ref ble_gattc_evt_desc_disc_rsp_t */ 00077 BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP, /**< Read By UUID Response event. @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t */ 00078 BLE_GATTC_EVT_READ_RSP, /**< Read Response event. @ref ble_gattc_evt_read_rsp_t */ 00079 BLE_GATTC_EVT_CHAR_VALS_READ_RSP, /**< Read multiple Response event. @ref ble_gattc_evt_char_vals_read_rsp_t */ 00080 BLE_GATTC_EVT_WRITE_RSP, /**< Write Response event. @ref ble_gattc_evt_write_rsp_t */ 00081 BLE_GATTC_EVT_HVX, /**< Handle Value Notification or Indication event. @ref ble_gattc_evt_hvx_t */ 00082 BLE_GATTC_EVT_TIMEOUT /**< Timeout event. @ref ble_gattc_evt_timeout_t */ 00083 }; 00084 00085 /** @} */ 00086 00087 /** @addtogroup BLE_GATTC_DEFINES Defines 00088 * @{ */ 00089 00090 /** @defgroup BLE_ERRORS_GATTC SVC return values specific to GATTC 00091 * @{ */ 00092 #define BLE_ERROR_GATTC_PROC_NOT_PERMITTED (NRF_GATTC_ERR_BASE + 0x000) /**< Procedure not Permitted. */ 00093 /** @} */ 00094 00095 /**@brief Last Attribute Handle. */ 00096 #define BLE_GATTC_HANDLE_END 0xFFFF 00097 00098 /** @} */ 00099 00100 /** @addtogroup BLE_GATTC_STRUCTURES Structures 00101 * @{ */ 00102 00103 /**@brief Operation Handle Range. */ 00104 typedef struct 00105 { 00106 uint16_t start_handle; /**< Start Handle. */ 00107 uint16_t end_handle; /**< End Handle. */ 00108 } ble_gattc_handle_range_t; 00109 00110 00111 /**@brief GATT service. */ 00112 typedef struct 00113 { 00114 ble_uuid_t uuid; /**< Service UUID. */ 00115 ble_gattc_handle_range_t handle_range; /**< Service Handle Range. */ 00116 } ble_gattc_service_t; 00117 00118 00119 /**@brief GATT include. */ 00120 typedef struct 00121 { 00122 uint16_t handle; /**< Include Handle. */ 00123 ble_gattc_service_t included_srvc; /**< Handle of the included service. */ 00124 } ble_gattc_include_t; 00125 00126 00127 /**@brief GATT characteristic. */ 00128 typedef struct 00129 { 00130 ble_uuid_t uuid; /**< Characteristic UUID. */ 00131 ble_gatt_char_props_t char_props; /**< Characteristic Properties. */ 00132 uint8_t char_ext_props : 1; /**< Extended properties present. */ 00133 uint16_t handle_decl; /**< Handle of the Characteristic Declaration. */ 00134 uint16_t handle_value; /**< Handle of the Characteristic Value. */ 00135 } ble_gattc_char_t; 00136 00137 00138 /**@brief GATT descriptor. */ 00139 typedef struct 00140 { 00141 uint16_t handle; /**< Descriptor Handle. */ 00142 ble_uuid_t uuid; /**< Descriptor UUID. */ 00143 } ble_gattc_desc_t; 00144 00145 00146 /**@brief Write Parameters. */ 00147 typedef struct 00148 { 00149 uint8_t write_op; /**< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS. */ 00150 uint8_t flags; /**< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS. */ 00151 uint16_t handle; /**< Handle to the attribute to be written. */ 00152 uint16_t offset; /**< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0. */ 00153 uint16_t len; /**< Length of data in bytes. */ 00154 uint8_t *p_value; /**< Pointer to the value data. */ 00155 } ble_gattc_write_params_t; 00156 00157 /**@brief Event structure for @ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP. */ 00158 typedef struct 00159 { 00160 uint16_t count; /**< Service count. */ 00161 ble_gattc_service_t services[1]; /**< Service data, variable length. */ 00162 } ble_gattc_evt_prim_srvc_disc_rsp_t; 00163 00164 /**@brief Event structure for @ref BLE_GATTC_EVT_REL_DISC_RSP. */ 00165 typedef struct 00166 { 00167 uint16_t count; /**< Include count. */ 00168 ble_gattc_include_t includes[1]; /**< Include data, variable length. */ 00169 } ble_gattc_evt_rel_disc_rsp_t; 00170 00171 /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_DISC_RSP. */ 00172 typedef struct 00173 { 00174 uint16_t count; /**< Characteristic count. */ 00175 ble_gattc_char_t chars[1]; /**< Characteristic data, variable length. */ 00176 } ble_gattc_evt_char_disc_rsp_t; 00177 00178 /**@brief Event structure for @ref BLE_GATTC_EVT_DESC_DISC_RSP. */ 00179 typedef struct 00180 { 00181 uint16_t count; /**< Descriptor count. */ 00182 ble_gattc_desc_t descs[1]; /**< Descriptor data, variable length. */ 00183 } ble_gattc_evt_desc_disc_rsp_t; 00184 00185 /**@brief GATT read by UUID handle value pair. */ 00186 typedef struct 00187 { 00188 uint16_t handle; /**< Attribute Handle. */ 00189 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). 00190 Please note that this pointer is absolute to the memory provided by the user when retrieving the event, 00191 so it will effectively point to a location inside the handle_value array. */ 00192 } ble_gattc_handle_value_t; 00193 00194 /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP. */ 00195 typedef struct 00196 { 00197 uint16_t count; /**< Handle-Value Pair Count. */ 00198 uint16_t value_len; /**< Length of the value in Handle-Value(s) list. */ 00199 ble_gattc_handle_value_t handle_value[1]; /**< Handle-Value(s) list, variable length. */ 00200 } ble_gattc_evt_char_val_by_uuid_read_rsp_t; 00201 00202 /**@brief Event structure for @ref BLE_GATTC_EVT_READ_RSP. */ 00203 typedef struct 00204 { 00205 uint16_t handle; /**< Attribute Handle. */ 00206 uint16_t offset; /**< Offset of the attribute data. */ 00207 uint16_t len; /**< Attribute data length. */ 00208 uint8_t data[1]; /**< Attribute data, variable length. */ 00209 } ble_gattc_evt_read_rsp_t; 00210 00211 /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP. */ 00212 typedef struct 00213 { 00214 uint16_t len; /**< Concatenated Attribute values length. */ 00215 uint8_t values[1]; /**< Attribute values, variable length. */ 00216 } ble_gattc_evt_char_vals_read_rsp_t; 00217 00218 /**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_RSP. */ 00219 typedef struct 00220 { 00221 uint16_t handle; /**< Attribute Handle. */ 00222 uint8_t write_op; /**< Type of write operation, see @ref BLE_GATT_WRITE_OPS. */ 00223 uint16_t offset; /**< Data offset. */ 00224 uint16_t len; /**< Data length. */ 00225 uint8_t data[1]; /**< Data, variable length. */ 00226 } ble_gattc_evt_write_rsp_t; 00227 00228 /**@brief Event structure for @ref BLE_GATTC_EVT_HVX. */ 00229 typedef struct 00230 { 00231 uint16_t handle; /**< Handle to which the HVx operation applies. */ 00232 uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */ 00233 uint16_t len; /**< Attribute data length. */ 00234 uint8_t data[1]; /**< Attribute data, variable length. */ 00235 } ble_gattc_evt_hvx_t; 00236 00237 /**@brief Event structure for @ref BLE_GATTC_EVT_TIMEOUT. */ 00238 typedef struct 00239 { 00240 uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */ 00241 } ble_gattc_evt_timeout_t; 00242 00243 /**@brief GATTC event structure. */ 00244 typedef struct 00245 { 00246 uint16_t conn_handle; /**< Connection Handle on which event occured. */ 00247 uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */ 00248 uint16_t error_handle; /**< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID. */ 00249 union 00250 { 00251 ble_gattc_evt_prim_srvc_disc_rsp_t prim_srvc_disc_rsp; /**< Primary Service Discovery Response Event Parameters. */ 00252 ble_gattc_evt_rel_disc_rsp_t rel_disc_rsp; /**< Relationship Discovery Response Event Parameters. */ 00253 ble_gattc_evt_char_disc_rsp_t char_disc_rsp; /**< Characteristic Discovery Response Event Parameters. */ 00254 ble_gattc_evt_desc_disc_rsp_t desc_disc_rsp; /**< Descriptor Discovery Response Event Parameters. */ 00255 ble_gattc_evt_char_val_by_uuid_read_rsp_t char_val_by_uuid_read_rsp; /**< Characteristic Value Read by UUID Response Event Parameters. */ 00256 ble_gattc_evt_read_rsp_t read_rsp; /**< Read Response Event Parameters. */ 00257 ble_gattc_evt_char_vals_read_rsp_t char_vals_read_rsp; /**< Characteristic Values Read Response Event Parameters. */ 00258 ble_gattc_evt_write_rsp_t write_rsp; /**< Write Response Event Parameters. */ 00259 ble_gattc_evt_hvx_t hvx; /**< Handle Value Notification/Indication Event Parameters. */ 00260 ble_gattc_evt_timeout_t timeout; /**< Timeout Event Parameters. */ 00261 } params; /**< Event Parameters. @note Only valid if @ref gatt_status == @ref BLE_GATT_STATUS_SUCCESS. */ 00262 } ble_gattc_evt_t; 00263 /** @} */ 00264 00265 /** @addtogroup BLE_GATTC_FUNCTIONS Functions 00266 * @{ */ 00267 00268 /**@brief Initiate or continue a GATT Primary Service Discovery procedure. 00269 * 00270 * @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle. 00271 * If the last service has not been reached, this function must be called again with an updated start handle value to continue the search. 00272 * 00273 * @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 00274 * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event. 00275 * 00276 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00277 * @param[in] start_handle Handle to start searching from. 00278 * @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned. 00279 * 00280 * @retval ::NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure. 00281 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00282 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. 00283 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. 00284 * @retval ::NRF_ERROR_BUSY Client procedure already in progress. 00285 */ 00286 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)); 00287 00288 00289 /**@brief Initiate or continue a GATT Relationship Discovery procedure. 00290 * 00291 * @details This function initiates or resumes the Find Included Services sub-procedure. If the last included service has not been reached, 00292 * this must be called again with an updated handle range to continue the search. 00293 * 00294 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00295 * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on. 00296 * 00297 * @retval ::NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure. 00298 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00299 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. 00300 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. 00301 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. 00302 * @retval ::NRF_ERROR_BUSY Client procedure already in progress. 00303 */ 00304 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)); 00305 00306 00307 /**@brief Initiate or continue a GATT Characteristic Discovery procedure. 00308 * 00309 * @details This function initiates or resumes a Characteristic discovery procedure. If the last Characteristic has not been reached, 00310 * this must be called again with an updated handle range to continue the discovery. 00311 * 00312 * @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 00313 * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event. 00314 * 00315 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00316 * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on. 00317 * 00318 * @retval ::NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure. 00319 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00320 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. 00321 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. 00322 * @retval ::NRF_ERROR_BUSY Client procedure already in progress. 00323 */ 00324 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)); 00325 00326 00327 /**@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure. 00328 * 00329 * @details This function initiates or resumes a Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached, 00330 * this must be called again with an updated handle range to continue the discovery. 00331 * 00332 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00333 * @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on. 00334 * 00335 * @retval ::NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure. 00336 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00337 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. 00338 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. 00339 * @retval ::NRF_ERROR_BUSY Client procedure already in progress. 00340 */ 00341 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)); 00342 00343 00344 /**@brief Initiate or continue a GATT Read using Characteristic UUID procedure. 00345 * 00346 * @details This function initiates or resumes a Read using Characteristic UUID procedure. If the last Characteristic has not been reached, 00347 * this must be called again with an updated handle range to continue the discovery. 00348 * 00349 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00350 * @param[in] p_uuid Pointer to a Characteristic value UUID to read. 00351 * @param[in] p_handle_range A pointer to the range of handles to perform this procedure on. 00352 * 00353 * @retval ::NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure. 00354 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00355 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. 00356 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. 00357 * @retval ::NRF_ERROR_BUSY Client procedure already in progress. 00358 */ 00359 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)); 00360 00361 00362 /**@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure. 00363 * 00364 * @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor 00365 * to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the 00366 * complete value. 00367 * 00368 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00369 * @param[in] handle The handle of the attribute to be read. 00370 * @param[in] offset Offset into the attribute value to be read. 00371 * 00372 * @retval ::NRF_SUCCESS Successfully started or resumed the Read (Long) procedure. 00373 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00374 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. 00375 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. 00376 * @retval ::NRF_ERROR_BUSY Client procedure already in progress. 00377 */ 00378 SVCALL(SD_BLE_GATTC_READ, uint32_t, sd_ble_gattc_read(uint16_t conn_handle, uint16_t handle, uint16_t offset)); 00379 00380 00381 /**@brief Initiate a GATT Read Multiple Characteristic Values procedure. 00382 * 00383 * @details This function initiates a GATT Read Multiple Characteristic Values procedure. 00384 * 00385 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00386 * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read. 00387 * @param[in] handle_count The number of handles in p_handles. 00388 * 00389 * @retval ::NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure. 00390 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00391 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. 00392 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. 00393 * @retval ::NRF_ERROR_BUSY Client procedure already in progress. 00394 */ 00395 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)); 00396 00397 00398 /**@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure. 00399 * 00400 * @details This function can perform all write procedures described in GATT. 00401 * 00402 * @note It is important to note that a write without response will <b>consume an application buffer</b>, and will therefore 00403 * 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 00404 * standard client internal buffer and thus will only generate a @ref BLE_GATTC_EVT_WRITE_RSP event as soon as the write response 00405 * has been received from the peer. Please see the documentation of @ref sd_ble_tx_buffer_count_get for more details. 00406 * 00407 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00408 * @param[in] p_write_params A pointer to a write parameters structure. 00409 * 00410 * @retval ::NRF_SUCCESS Successfully started the Write procedure. 00411 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00412 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. 00413 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. 00414 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. 00415 * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. 00416 * @retval ::NRF_ERROR_BUSY Procedure already in progress. 00417 * @retval ::BLE_ERROR_NO_TX_BUFFERS There are no available buffers left. 00418 */ 00419 SVCALL(SD_BLE_GATTC_WRITE, uint32_t, sd_ble_gattc_write(uint16_t conn_handle, ble_gattc_write_params_t const *p_write_params)); 00420 00421 00422 /**@brief Send a Handle Value Confirmation to the GATT Server. 00423 * 00424 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. 00425 * @param[in] handle The handle of the attribute in the indication. 00426 * 00427 * @retval ::NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission. 00428 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. 00429 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no Indication pending to be confirmed. 00430 * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle. 00431 */ 00432 SVCALL(SD_BLE_GATTC_HV_CONFIRM, uint32_t, sd_ble_gattc_hv_confirm(uint16_t conn_handle, uint16_t handle)); 00433 00434 /** @} */ 00435 00436 #endif /* BLE_GATTC_H__ */ 00437 00438 /** 00439 @} 00440 @} 00441 */
Generated on Tue Jul 12 2022 19:22:46 by
1.7.2
