ble_gattc.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file ble_gattc.h
5 *
6 * @brief BLE GATTC API
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup BLE
40 * @{
41 */
42
43 /**
44 * @addtogroup BLE_GATT Generic Attribute Profile (GATT)
45 * @{
46 * @brief Definitions and prototypes for the GATT interface.
47 */
48
49 /**
50 @addtogroup BLE_GATTC Generic Attribute Profile (GATT) Client
51 @{
52 @brief Definitions and prototypes for the GATT client interfaces.
53 */
54
55 #ifndef __BLE_GATTC_H__
56 #define __BLE_GATTC_H__
57
58 #include "ble_error.h"
59 #include "ble_gatt.h"
60 #include "ble_att.h"
61 #include "gr55xx_sys_cfg.h"
62
63 #include <stdint.h>
64 #include <stdbool.h>
65
66 /** @addtogroup BLE_GATTC_ENUMERATIONS Enumerations
67 * @{ */
68
69 /**
70 * @brief GATT Client Service type IDs.
71 */
72 typedef enum
73 {
74 BLE_GATTC_PRI_SERV, /**< Primary Service. */
75 BLE_GATTC_SEC_SERV, /**< Secondary Service. */
76 } gatt_serv_type_t;
77
78 /** @} */
79
80
81 /**
82 * @brief GATT Client Service Discover Attribute type IDs.
83 */
84 typedef enum
85 {
86 BLE_GATTC_BROWSE_NONE, /**< No Attribute Information. */
87 BLE_GATTC_BROWSE_INC_SRVC, /**< Included Service information. */
88 BLE_GATTC_BROWSE_ATTR_CHAR, /**< Characteristic Declaration. */
89 BLE_GATTC_BROWSE_ATTR_VAL, /**< Attribute Value definition. */
90 BLE_GATTC_BROWSE_ATTR_DESC, /**< Attribute Descriptor. */
91 } ble_gattc_attr_type_t;
92
93
94 /**@brief GATT Client Cache Update Current State. */
95 typedef enum
96 {
97 BLE_GATT_CACHE_UPDATING, /**< GATT Cache in updating process. */
98 BLE_GATT_CACHE_FINISH, /**< GATT Cache is updated or checked. */
99 } ble_gattc_cache_current_state_t;
100
101 /** @} */
102
103 /** @addtogroup BLE_GATTC_STRUCTURES Structures
104 * @{ */
105
106 /**
107 * @brief GATTC discovery characteristic structure.
108 */
109 typedef struct
110 {
111 uint16_t start_hdl; /**< Start handle. */
112 uint16_t end_hdl; /**< End handle. */
113 ble_uuid_t *p_uuid; /**< Characteristic UUID. */
114 } ble_gattc_disc_char_t;
115
116 /**
117 * @brief GATTC read by characteristic UUID structure.
118 */
119 typedef struct
120 {
121 uint16_t start_hdl; /**< Start handle. */
122 uint16_t end_hdl; /**< End handle. */
123 ble_uuid_t *p_uuid; /**< Characteristic UUID. */
124 } ble_gattc_read_by_uuid_t;
125
126 /**
127 * @brief GATTC write attribute value structure.
128 */
129 typedef struct
130 {
131 uint16_t handle; /**< Attribute handle. */
132 uint16_t offset; /**< value offset to start with. */
133 uint16_t length; /**< Write length. */
134 uint8_t *p_value; /**< Value to write. */
135 } ble_gattc_write_attr_value_t;
136
137 /**
138 * @brief GATTC write without response structure.
139 */
140 typedef struct
141 {
142 bool signed_write; /**< True if signed write should be used when possible/applicable. */
143 uint16_t handle; /**< Attribute handle. */
144 uint16_t length; /**< Write length. */
145 uint8_t *p_value; /**< Value to write. */
146 } ble_gattc_write_no_resp_t;
147
148 /**@brief Read Multiple Handles. */
149 typedef struct
150 {
151 uint16_t handle; /**< Attribute handle. */
152 uint16_t len; /**< Known value: length of the handle (len shall not be set to 0). */
153 } ble_gattc_multiple_att_t;
154
155 /**@brief GATTC Read Multiple. */
156 typedef struct
157 {
158 uint16_t handle_count; /**< Handle count of the multiple attributes to be read. */
159 ble_gattc_multiple_att_t *p_read_multiple; /**< Pointer to the multiple attributes to be read. */
160 } ble_gattc_read_multiple_t;
161
162
163 /**@brief GATTC Browse information about Characteristic. */
164 typedef struct
165 {
166 ble_gattc_attr_type_t attr_type; /**< Attribute type. See @ref BLE_GATTC_BROWSE_ATTR_CHAR for Characteristic Declaration. */
167 uint8_t prop; /**< Value property. */
168 uint16_t handle; /**< Value handle. */
169 uint8_t uuid_len; /**< Characteristic UUID length. */
170 uint8_t uuid[BLE_ATT_UUID_128_LEN]; /**< Characteristic UUID. */
171 } ble_gattc_browse_attr_char_t;
172
173 /**@brief GATTC Browse information about Included Service. */
174 typedef struct
175 {
176 ble_gattc_attr_type_t attr_type; /**< Attribute type. See @ref BLE_GATTC_BROWSE_INC_SRVC for Included Service Information. */
177 uint8_t uuid_len; /**< Included Service UUID length. */
178 uint8_t uuid[BLE_ATT_UUID_128_LEN]; /**< Included Service UUID. */
179 uint16_t start_hdl; /**< Included Service start handle. */
180 uint16_t end_hdl; /**< Included Service end handle. */
181 } ble_gattc_browse_inc_srvc_t;
182
183 /**@brief GATTC Browse information about Attribute. */
184 typedef struct
185 {
186 ble_gattc_attr_type_t attr_type; /**< Attribute type. See @ref BLE_GATTC_BROWSE_ATTR_VAL for Attribute Value. See @ref BLE_GATTC_BROWSE_ATTR_DESC for Attribute Descriptor. */
187 uint8_t uuid_len; /**< Attribute UUID length. */
188 uint8_t uuid[BLE_ATT_UUID_128_LEN]; /**< Characteristic UUID or Characteristic Descriptor UUID. */
189 } ble_gattc_browse_attr_t;
190
191 /**@brief GATTC Browse attribute information. */
192 union ble_gattc_browse_attr_info
193 {
194 ble_gattc_attr_type_t attr_type; /**< Attribute type. See @ref ble_gattc_attr_type_t. */
195 ble_gattc_browse_attr_char_t attr_char; /**< Information about Characteristic. When union attr_type is @ref BLE_GATTC_BROWSE_ATTR_CHAR */
196 ble_gattc_browse_inc_srvc_t inc_srvc; /**< Information about Included Service. When union attr_type is @ref BLE_GATTC_BROWSE_INC_SRVC */
197 ble_gattc_browse_attr_t attr; /**< Information about Attribute. When union attr_type is @ref BLE_GATTC_BROWSE_ATTR_VAL or @ref BLE_GATTC_BROWSE_ATTR_DESC. */
198 };
199
200 /**@brief GATT service. */
201 typedef struct
202 {
203 uint16_t start_hdl; /**< Start handle. */
204 uint16_t end_hdl; /**< End handle. */
205 uint8_t uuid_len; /**< Service UUID length. */
206 uint8_t *p_uuid; /**< Service UUID. */
207 } ble_gattc_service_t;
208
209 /**@brief GATT include. */
210 typedef struct
211 {
212 uint16_t attr_hdl; /**< Attribute handle. */
213 uint16_t start_hdl; /**< Start handle. */
214 uint16_t end_hdl; /**< End handle. */
215 uint8_t uuid_len; /**< Service UUID length. */
216 uint8_t *p_uuid; /**< Service UUID. */
217 } ble_gattc_include_t;
218
219 /**@brief GATT characteristic. */
220 typedef struct
221 {
222 uint16_t handle_decl; /**< Handle of the Characteristic Declaration. */
223 uint16_t handle_value; /**< Handle of the Characteristic Value. */
224 uint8_t prop; /**< Properties. */
225 uint8_t uuid_len; /**< Characteristic UUID length. */
226 uint8_t *p_uuid; /**< Characteristic UUID. */
227 } ble_gattc_char_t;
228
229 /**@brief GATT descriptor. */
230 typedef struct
231 {
232 uint16_t attr_hdl; /**< Attribute handle. */
233 uint8_t uuid_len; /**< Descriptor UUID length. */
234 uint8_t *p_uuid; /**< Descriptor UUID. */
235 } ble_gattc_desc_t;
236
237 /**@brief GATT Client Read value. */
238 typedef struct
239 {
240 uint16_t handle; /**< Attribute handle. */
241 uint16_t offset; /**< Offset of the attribute value. */
242 uint16_t length; /**< Attribute value length. */
243 uint8_t *p_value; /**< Pointer to the attribute value data. */
244 } ble_gattc_read_value_t;
245
246 /**@brief GATTC Browse service(s) event for @ref BLE_GATTC_EVT_SRVC_BROWSE. */
247 typedef struct
248 {
249 uint8_t serv_type; /**< Service type. See @ref gatt_serv_type_t.*/
250 uint8_t uuid_len; /**< Service UUID length. */
251 uint8_t uuid[BLE_ATT_UUID_128_LEN]; /**< Service UUID. */
252 uint16_t start_hdl; /**< Service start handle. */
253 uint16_t end_hdl; /**< Service end handle. */
254 union ble_gattc_browse_attr_info *info; /**< Attribute information presented in the service(array length = end_hdl - start_hdl);If attr_type is equal to BLE_GATTC_BROWSE_NONE, the last attribute information has been found in previous one, although not reach the service end handle. */
255 } ble_gattc_evt_browse_srvc_t;
256
257 /**@brief GATT service discovery event for @ref BLE_GATTC_EVT_PRIMARY_SRVC_DISC. */
258 typedef struct
259 {
260 uint16_t count; /**< Service count. */
261 ble_gattc_service_t *services; /**< Service data. */
262 } ble_gattc_evt_srvc_disc_t;
263
264 /**@brief GATT include discovery event for @ref BLE_GATTC_EVT_INCLUDE_SRVC_DISC. */
265 typedef struct
266 {
267 uint16_t count; /**< Include count. */
268 ble_gattc_include_t *includes; /**< Include data. */
269 } ble_gattc_evt_incl_disc_t;
270
271 /**@brief GATT characteristic discovery event for @ref BLE_GATTC_EVT_CHAR_DISC. */
272 typedef struct
273 {
274 uint16_t count; /**< Characteristic count. */
275 ble_gattc_char_t *chars; /**< Characteristic data. */
276 } ble_gattc_evt_char_disc_t;
277
278 /**@brief GATT characteristic descriptor discovery event for @ref BLE_GATTC_EVT_CHAR_DESC_DISC. */
279 typedef struct
280 {
281 uint16_t count; /**< Descriptor count. */
282 ble_gattc_desc_t *char_descs; /**< Descriptor data. */
283 } ble_gattc_evt_char_desc_disc_t;
284
285 /**@brief GATT Client Read response event for @ref BLE_GATTC_EVT_READ_RSP. */
286 typedef struct
287 {
288 uint16_t count; /**< Value Count. */
289 ble_gattc_read_value_t *value; /**< Value(s) list. */
290 } ble_gattc_evt_read_t;
291
292
293 /**@brief GATT Client Write Response event for @ref BLE_GATTC_EVT_WRITE_RSP. */
294 typedef struct
295 {
296 uint16_t handle; /**< Attribute handle. */
297 } ble_gattc_evt_write_t;
298
299
300 /**@brief GATTC Notification and Indication event for @ref BLE_GATTC_EVT_NTF_IND. */
301 typedef struct
302 {
303 ble_gatt_evt_type_t type; /**< Event type. */
304 uint16_t length; /**< Attribute value length. */
305 uint16_t handle; /**< Attribute handle. */
306 uint8_t *p_value; /**< Pointer to the attribute value data. */
307 } ble_gattc_evt_ntf_ind_t;
308
309
310 /**@brief GATT Client Cache Update event for @ref BLE_GATTC_EVT_CACHE_UPDATE. */
311 typedef struct
312 {
313 bool cache_valid; /**< Cache validity. */
314 ble_gattc_cache_current_state_t cache_current_state;
315 } ble_gattc_evt_cache_update_t;
316
317 /**@brief GATTC Browse service(s) indication. */
318 typedef struct
319 {
320 uint16_t cid; /**< Channel id. */
321 uint8_t serv_type; /**< Service type. See @ref gatt_serv_type_t.*/
322 uint8_t uuid_len; /**< Service UUID length. */
323 uint8_t uuid[BLE_ATT_UUID_128_LEN]; /**< Service UUID. */
324 uint16_t start_hdl; /**< Service start handle. */
325 uint16_t end_hdl; /**< Service end handle. */
326 union ble_gattc_browse_attr_info *info; /**< Attribute information presented in the service(array length = end_hdl - start_hdl);
327 If attr_type is equal to BLE_GATTC_BROWSE_NONE, the last attribute information has been found in previous one, although not reach the service end handle. */
328 } ble_gattc_evt_enh_browse_srvc_t;
329
330 /**@brief GATT service discovery. */
331 typedef struct
332 {
333 uint16_t cid; /**< Channel id. */
334 uint16_t count; /**< Service count. */
335 ble_gattc_service_t *services; /**< Service data. */
336 } ble_gattc_evt_enh_srvc_disc_t;
337
338 /**@brief GATT include discovery. */
339 typedef struct
340 {
341 uint16_t cid; /**< Channel id. */
342 uint16_t count; /**< Include count. */
343 ble_gattc_include_t *includes; /**< Include data. */
344 } ble_gattc_evt_enh_incl_disc_t;
345
346 /**@brief GATT characteristic discovery. */
347 typedef struct
348 {
349 uint16_t cid; /**< Channel id. */
350 uint16_t count; /**< Characteristic count. */
351 ble_gattc_char_t *chars; /**< Characteristic data. */
352 }ble_gattc_evt_enh_char_disc_t;
353
354 /**@brief GATT characteristic descriptor discovery. */
355 typedef struct
356 {
357 uint16_t cid; /**< Channel id. */
358 uint16_t count; /**< Descriptor count. */
359 ble_gattc_desc_t *char_descs; /**< Descriptor data. */
360 }ble_gattc_evt_enh_char_desc_disc_t;
361
362 /**@brief GATT value Read response event for @ref BLE_GATTC_EVT_READ_RSP. */
363 typedef struct
364 {
365 uint16_t cid; /**< Channel id. */
366 uint16_t count; /**< Value Count. */
367 ble_gattc_read_value_t *value; /**< Value(s) list. */
368 } ble_gattc_evt_enh_read_t;
369
370 /**@brief GATT Client Write Response event for @ref BLE_GATTC_EVT_WRITE_RSP. */
371 typedef struct
372 {
373 uint16_t cid; /**< Channel id. */
374 uint16_t handle; /**< Attribute handle. */
375 } ble_gattc_evt_enh_write_t;
376
377 /**@brief GATTC Notification and Indication value indication. */
378 typedef struct
379 {
380 uint16_t cid; /**< Channel id. */
381 ble_gatt_evt_type_t type; /**< Event type. */
382 uint16_t length; /**< Attribute value length. */
383 uint16_t handle; /**< Attribute handle. */
384 uint8_t *p_value; /**< Pointer to the attribute value data. */
385 } ble_gattc_evt_enh_ntf_ind_t;
386
387
388 /**@brief BLE GATTC event structure. */
389 typedef struct
390 {
391 uint8_t index; /**< Index of connection. */
392 union
393 {
394 ble_gattc_evt_browse_srvc_t srvc_browse; /**< Browce service discovery response event. */
395 ble_gattc_evt_srvc_disc_t prim_srvc_disc; /**< Primary service discovery response event. */
396 ble_gattc_evt_incl_disc_t inc_srvc_disc; /**< Include service discovery response event. */
397 ble_gattc_evt_char_disc_t char_disc; /**< Characteristic discovery response event. */
398 ble_gattc_evt_char_desc_disc_t char_desc_disc; /**< Characteristic descriptor discovery response event. */
399 ble_gattc_evt_read_t read_rsp; /**< Read response event. */
400 ble_gattc_evt_write_t write_rsp; /**< Write response event. */
401 ble_gattc_evt_ntf_ind_t ntf_ind; /**< Handle value Notification/Indication response. */
402 ble_gattc_evt_cache_update_t cache_update; /**< Cache update event. */
403 ble_gattc_evt_enh_browse_srvc_t enh_srvc_browse; /**< Browce service discovery response event. */
404 ble_gattc_evt_enh_srvc_disc_t enh_prim_srvc_disc; /**< Primary service discovery response event. */
405 ble_gattc_evt_enh_incl_disc_t enh_inc_srvc_disc; /**< Include service discovery response event. */
406 ble_gattc_evt_enh_char_disc_t enh_char_disc; /**< Characteristic discovery response event. */
407 ble_gattc_evt_enh_char_desc_disc_t enh_char_desc_disc; /**< Characteristic descriptor discovery response event. */
408 ble_gattc_evt_enh_read_t enh_read_rsp; /**< Read response event. */
409 ble_gattc_evt_enh_write_t enh_write_rsp; /**< Write response event. */
410 ble_gattc_evt_enh_ntf_ind_t enh_ntf_ind; /**< Handle value Notification/Indication response. */
411 } params; /**< Event Parameters. */
412 } ble_gattc_evt_t;
413 /** @} */
414
415 /** @addtogroup BLE_GATTC_FUNCTIONS Functions
416 * @{ */
417
418 /**
419 ****************************************************************************************
420 * @brief Perform MTU Exchange.
421 *
422 * @param[in] conn_idx: Current connection index.
423 *
424 * @retval ::SDK_SUCCESS: Successfully send an MTU Exchange request.
425 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
426 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
427 ****************************************************************************************
428 */
429 uint16_t ble_gattc_mtu_exchange(uint8_t conn_idx);
430
431 /**
432 ****************************************************************************************
433 * @brief Browse all Primary Services or specific Primary Service information on remote GATT server.
434 *
435 * @note This discovery automatically searches for Primary Services, Included Services, Characteristics and Descriptors of each service.
436 * To discover one or more services only, use ble_gattc_primary_services_discover() instead.
437 * This discovery is able to search all Primary Services or a specific one.
438 * If srvc_uuid is NULL, all services are returned.
439 *
440 * @param[in] conn_idx: Current connection index.
441 * @param[in] p_srvc_uuid: Pointer to Service UUID. If it is NULL, all services will be returned.
442 *
443 * @retval ::SDK_SUCCESS: Successfully start the Browse Service(s) procedure.
444 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
445 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
446 ****************************************************************************************
447 */
448 uint16_t ble_gattc_services_browse(uint8_t conn_idx, const ble_uuid_t *p_srvc_uuid);
449
450 /**
451 ****************************************************************************************
452 * @brief Discover Primary Services on remote GATT server.
453 *
454 * @param[in] conn_idx: Current connection index.
455 * @param[in] p_srvc_uuid: Pointer to Service UUID. If it is NULL, all Primary Services will be returned.
456 *
457 * @retval ::SDK_SUCCESS: Successfully start the Primary Service Discovery procedure.
458 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
459 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
460 ****************************************************************************************
461 */
462 uint16_t ble_gattc_primary_services_discover(uint8_t conn_idx, const ble_uuid_t *p_srvc_uuid);
463
464 /**
465 ****************************************************************************************
466 * @brief Discover Included Services on remote GATT server.
467 *
468 * @param[in] conn_idx: Current connection index.
469 * @param[in] start_hdl: Start handle.
470 * @param[in] end_hdl: End handle.
471 *
472 * @retval ::SDK_SUCCESS: Successfully start the Relationship Discovery procedure.
473 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
474 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
475 ****************************************************************************************
476 */
477 uint16_t ble_gattc_included_services_discover(uint8_t conn_idx, uint16_t start_hdl, uint16_t end_hdl);
478
479 /**
480 ****************************************************************************************
481 * @brief Discover Characteristics on remote GATT server.
482 *
483 * @param[in] conn_idx: Current connection index.
484 * @param[in] start_hdl: Start handle.
485 * @param[in] end_hdl: End handle.
486 * @param[in] p_char_uuid: Pointer to Characteristic UUID.If it is NULL, all characteristics are returned.
487 *
488 * @retval ::SDK_SUCCESS: Successfully start the Characteristic Discovery procedure.
489 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
490 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
491 ****************************************************************************************
492 */
493 uint16_t ble_gattc_char_discover(uint8_t conn_idx, uint16_t start_hdl, uint16_t end_hdl, const ble_uuid_t *p_char_uuid);
494
495 /**
496 ****************************************************************************************
497 * @brief Discover Characteristics Descriptors on remote GATT server.
498 *
499 * @param[in] conn_idx: Current connection index.
500 * @param[in] start_hdl: Start handle.
501 * @param[in] end_hdl: End handle.
502 *
503 * @retval ::SDK_SUCCESS: Successfully start the Descriptor Discovery procedure.
504 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
505 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
506 ****************************************************************************************
507 */
508 uint16_t ble_gattc_char_desc_discover(uint8_t conn_idx, uint16_t start_hdl, uint16_t end_hdl);
509
510 /**
511 ****************************************************************************************
512 * @brief Read Attribute from remote GATT server.
513 *
514 * @note This uses either the "Read Characteristic Value" procedure or the "Read Characteristic Descriptor"
515 * procedure, depending on the attribute pointed by handle. If offset is non-zero or the
516 * attribute length is larger than the MTU, the "Read Long Characteristic Value" procedure or the
517 * "Read Long Characteristic Descriptor" procedure will be used respectively.
518 *
519 * @param[in] conn_idx: Current connection index.
520 * @param[in] handle: Attribute handle.
521 * @param[in] offset: Value offset to start with.
522 *
523 * @retval ::SDK_SUCCESS: Successfully start the Read (Long) procedure.
524 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
525 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
526 ****************************************************************************************
527 */
528 uint16_t ble_gattc_read(uint8_t conn_idx, uint16_t handle, uint16_t offset);
529
530 /**
531 ****************************************************************************************
532 * @brief Read Attribute by UUID.
533 *
534 * @param[in] conn_idx: Current connection index.
535 * @param[in] start_hdl: Start handle.
536 * @param[in] end_hdl: End handle.
537 * @param[in] p_char_uuid: Pointer to Characteristic UUID.
538 *
539 *
540 * @retval ::SDK_SUCCESS: Successfully start the Read using Characteristic UUID procedure.
541 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
542 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
543 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
544 ****************************************************************************************
545 */
546 uint16_t ble_gattc_read_by_uuid(uint8_t conn_idx, uint16_t start_hdl, uint16_t end_hdl, const ble_uuid_t *p_char_uuid);
547
548 /**
549 ****************************************************************************************
550 * @brief Initiate a Read Multiple Characteristic Values procedure
551 *
552 * @param[in] conn_idx: Current connection index.
553 * @param[in] p_param: Pointer to the parameters of the value.
554 *
555 * @retval ::SDK_SUCCESS: Successfully start the Read Multiple Characteristic Values procedure.
556 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
557 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
558 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
559 ****************************************************************************************
560 */
561 uint16_t ble_gattc_read_multiple(uint8_t conn_idx, const ble_gattc_read_multiple_t *p_param);
562
563 /**
564 ****************************************************************************************
565 * @brief Write (long) Characteristic (Descriptor) Value.
566 *
567 * @note This uses either the "Write Characteristic Value" procedure or the "Write Characteristic
568 * Descriptor" procedure, depending on the attribute pointed by handle. If offset is non-zero
569 * or the attribute length is larger than the MTU, the "Write Long Characteristic Value" procedure
570 * or the "Write Long Characteristic Descriptor" procedure will be used respectively.
571 *
572 * @param[in] conn_idx: Current connection index.
573 * @param[in] handle: The handle of the attribute to be written.
574 * @param[in] offset: Offset into the attribute value to be written.
575 * @param[in] length: Length of the value data in bytes.
576 * @param[in] p_value: Pointer to the value data.
577 *
578 * @retval ::SDK_SUCCESS: Successfully start the Write procedure.
579 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
580 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
581 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
582 ****************************************************************************************
583 */
584 uint16_t ble_gattc_write(uint8_t conn_idx, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t *p_value);
585
586 /**
587 ****************************************************************************************
588 * @brief Prepare Long/Reliable Write to remote GATT server.
589 *
590 * @param[in] conn_idx: Current connection index.
591 * @param[in] handle: Attribute handle.
592 * @param[in] offset: Value offset to start with.
593 * @param[in] length: Value length.
594 * @param[in] p_value: Value data.
595 *
596 * @retval ::SDK_SUCCESS: Successfully send a Prepare Write request.
597 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
598 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
599 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
600 ****************************************************************************************
601 */
602 uint16_t ble_gattc_write_prepare(uint8_t conn_idx, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t *p_value);
603
604 /**
605 ****************************************************************************************
606 * @brief Execute Reliable/Long Write to remote GATT server.
607 *
608 * @param[in] conn_idx: Current connection index.
609 * @param[in] execute: True if data shall be written; false if cancel all prepared writes.
610 *
611 * @retval ::SDK_SUCCESS: Successfully send an Execute Write request.
612 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
613 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
614 ****************************************************************************************
615 */
616 uint16_t ble_gattc_write_execute(uint8_t conn_idx, bool execute);
617
618 /**
619 ****************************************************************************************
620 * @brief Write Attribute to remote GATT server (without response).
621 *
622 * @note If signed_write is set to false, the "Write Without Response" procedure will be used.
623 * If signed_write is set to true, the "Signed Write Without Response" procedure will be used on
624 * a link which is not encrypted.
625 * If a link is already encrypted, "Write Without Response" procedure shall be used instead of "Signed Write Without Response".
626 *
627 * @param[in] conn_idx: Current connection index.
628 * @param[in] handle: Attribute handle.
629 * @param[in] signed_write: True if signed write should be used, false write without response.
630 * @param[in] length: Value length.
631 * @param[in] p_value: Value data.
632 *
633 * @retval ::SDK_SUCCESS: Successfully start the (Signed) Write Without Response procedure.
634 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
635 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
636 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
637 ****************************************************************************************
638 */
639 uint16_t ble_gattc_write_no_resp(uint8_t conn_idx, bool signed_write, uint16_t handle, uint16_t length, const uint8_t *p_value);
640
641 /**
642 ****************************************************************************************
643 * @brief Confirm Reception of Indication.
644 *
645 * @note Confirm indication which has been correctly received from the peer.
646 *
647 * @param[in] conn_idx: Current connection index.
648 * @param[in] handle: Value handle.
649 *
650 * @retval ::SDK_SUCCESS: Successfully send indication confirm.
651 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
652 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
653 ****************************************************************************************
654 */
655 uint16_t ble_gattc_indicate_cfm(uint8_t conn_idx, uint16_t handle);
656
657 /** @} */
658
659 #endif
660
661 /** @} */
662
663 /** @} */
664
ble_gattc_browse_attr_char_t::handle
uint16_t handle
Value handle.
Definition: ble_gattc.h:168
ble_gattc_evt_enh_browse_srvc_t::info
union ble_gattc_browse_attr_info * info
Attribute information presented in the service(array length = end_hdl - start_hdl); If attr_type is e...
Definition: ble_gattc.h:326
ble_gattc_browse_attr_t::uuid_len
uint8_t uuid_len
Attribute UUID length.
Definition: ble_gattc.h:187
BLE_GATTC_BROWSE_NONE
@ BLE_GATTC_BROWSE_NONE
No Attribute Information.
Definition: ble_gattc.h:86
ble_gattc_evt_ntf_ind_t
GATTC Notification and Indication event for BLE_GATTC_EVT_NTF_IND.
Definition: ble_gattc.h:302
ble_gattc_evt_read_t
GATT Client Read response event for BLE_GATTC_EVT_READ_RSP.
Definition: ble_gattc.h:287
ble_gattc_evt_t::enh_srvc_browse
ble_gattc_evt_enh_browse_srvc_t enh_srvc_browse
Browce service discovery response event.
Definition: ble_gattc.h:403
ble_gattc_evt_char_desc_disc_t::count
uint16_t count
Descriptor count.
Definition: ble_gattc.h:281
BLE_GATTC_SEC_SERV
@ BLE_GATTC_SEC_SERV
Secondary Service.
Definition: ble_gattc.h:75
ble_gattc_evt_browse_srvc_t
GATTC Browse service(s) event for BLE_GATTC_EVT_SRVC_BROWSE.
Definition: ble_gattc.h:248
BLE_GATTC_BROWSE_ATTR_CHAR
@ BLE_GATTC_BROWSE_ATTR_CHAR
Characteristic Declaration.
Definition: ble_gattc.h:88
BLE_ATT_UUID_128_LEN
#define BLE_ATT_UUID_128_LEN
UUID length: 16 bytes.
Definition: ble_att.h:65
ble_gattc_evt_enh_char_desc_disc_t::char_descs
ble_gattc_desc_t * char_descs
Descriptor data.
Definition: ble_gattc.h:359
gatt_serv_type_t
gatt_serv_type_t
GATT Client Service type IDs.
Definition: ble_gattc.h:73
ble_gattc_evt_t::ntf_ind
ble_gattc_evt_ntf_ind_t ntf_ind
Handle value Notification/Indication response.
Definition: ble_gattc.h:401
ble_gattc_evt_enh_browse_srvc_t::start_hdl
uint16_t start_hdl
Service start handle.
Definition: ble_gattc.h:324
ble_gattc_evt_enh_write_t::handle
uint16_t handle
Attribute handle.
Definition: ble_gattc.h:374
ble_gattc_char_t::handle_value
uint16_t handle_value
Handle of the Characteristic Value.
Definition: ble_gattc.h:223
BLE_GATTC_BROWSE_INC_SRVC
@ BLE_GATTC_BROWSE_INC_SRVC
Included Service information.
Definition: ble_gattc.h:87
BLE_GATTC_BROWSE_ATTR_DESC
@ BLE_GATTC_BROWSE_ATTR_DESC
Attribute Descriptor.
Definition: ble_gattc.h:90
ble_gattc_service_t::p_uuid
uint8_t * p_uuid
Service UUID.
Definition: ble_gattc.h:206
ble_gattc_write_prepare
uint16_t ble_gattc_write_prepare(uint8_t conn_idx, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t *p_value)
Prepare Long/Reliable Write to remote GATT server.
ble_gattc_evt_enh_read_t::count
uint16_t count
Value Count.
Definition: ble_gattc.h:366
ble_gattc_browse_inc_srvc_t::end_hdl
uint16_t end_hdl
Included Service end handle.
Definition: ble_gattc.h:180
BLE_GATTC_BROWSE_ATTR_VAL
@ BLE_GATTC_BROWSE_ATTR_VAL
Attribute Value definition.
Definition: ble_gattc.h:89
ble_gattc_read_by_uuid_t::start_hdl
uint16_t start_hdl
Start handle.
Definition: ble_gattc.h:121
ble_gattc_evt_enh_srvc_disc_t::cid
uint16_t cid
Channel id.
Definition: ble_gattc.h:333
ble_gattc_included_services_discover
uint16_t ble_gattc_included_services_discover(uint8_t conn_idx, uint16_t start_hdl, uint16_t end_hdl)
Discover Included Services on remote GATT server.
ble_gattc_evt_browse_srvc_t::start_hdl
uint16_t start_hdl
Service start handle.
Definition: ble_gattc.h:252
ble_gattc_evt_browse_srvc_t::serv_type
uint8_t serv_type
Service type.
Definition: ble_gattc.h:249
ble_gattc_read_multiple_t::handle_count
uint16_t handle_count
Handle count of the multiple attributes to be read.
Definition: ble_gattc.h:158
ble_gattc_evt_read_t::value
ble_gattc_read_value_t * value
Value(s) list.
Definition: ble_gattc.h:289
ble_gattc_write_attr_value_t::length
uint16_t length
Write length.
Definition: ble_gattc.h:133
ble_gattc_write_attr_value_t::p_value
uint8_t * p_value
Value to write.
Definition: ble_gattc.h:134
ble_gattc_include_t::end_hdl
uint16_t end_hdl
End handle.
Definition: ble_gattc.h:214
ble_gattc_evt_t::inc_srvc_disc
ble_gattc_evt_incl_disc_t inc_srvc_disc
Include service discovery response event.
Definition: ble_gattc.h:396
ble_gattc_char_desc_discover
uint16_t ble_gattc_char_desc_discover(uint8_t conn_idx, uint16_t start_hdl, uint16_t end_hdl)
Discover Characteristics Descriptors on remote GATT server.
ble_gattc_multiple_att_t::len
uint16_t len
Known value: length of the handle (len shall not be set to 0).
Definition: ble_gattc.h:152
ble_gattc_evt_enh_ntf_ind_t::cid
uint16_t cid
Channel id.
Definition: ble_gattc.h:380
ble_gattc_evt_read_t::count
uint16_t count
Value Count.
Definition: ble_gattc.h:288
ble_gattc_evt_t::enh_write_rsp
ble_gattc_evt_enh_write_t enh_write_rsp
Write response event.
Definition: ble_gattc.h:409
ble_gattc_evt_enh_incl_disc_t::cid
uint16_t cid
Channel id.
Definition: ble_gattc.h:341
ble_gattc_evt_write_t
GATT Client Write Response event for BLE_GATTC_EVT_WRITE_RSP.
Definition: ble_gattc.h:295
ble_gattc_write_attr_value_t::offset
uint16_t offset
value offset to start with.
Definition: ble_gattc.h:132
ble_gattc_char_t::handle_decl
uint16_t handle_decl
Handle of the Characteristic Declaration.
Definition: ble_gattc.h:222
ble_gattc_evt_t::enh_char_desc_disc
ble_gattc_evt_enh_char_desc_disc_t enh_char_desc_disc
Characteristic descriptor discovery response event.
Definition: ble_gattc.h:407
ble_gattc_mtu_exchange
uint16_t ble_gattc_mtu_exchange(uint8_t conn_idx)
Perform MTU Exchange.
ble_gattc_multiple_att_t::handle
uint16_t handle
Attribute handle.
Definition: ble_gattc.h:151
ble_gattc_desc_t::uuid_len
uint8_t uuid_len
Descriptor UUID length.
Definition: ble_gattc.h:233
ble_gattc_service_t::uuid_len
uint8_t uuid_len
Service UUID length.
Definition: ble_gattc.h:205
ble_gattc_evt_t::write_rsp
ble_gattc_evt_write_t write_rsp
Write response event.
Definition: ble_gattc.h:400
ble_gattc_char_t::uuid_len
uint8_t uuid_len
Characteristic UUID length.
Definition: ble_gattc.h:225
ble_gattc_evt_srvc_disc_t
GATT service discovery event for BLE_GATTC_EVT_PRIMARY_SRVC_DISC.
Definition: ble_gattc.h:259
ble_gattc_evt_browse_srvc_t::uuid_len
uint8_t uuid_len
Service UUID length.
Definition: ble_gattc.h:250
ble_gattc_services_browse
uint16_t ble_gattc_services_browse(uint8_t conn_idx, const ble_uuid_t *p_srvc_uuid)
Browse all Primary Services or specific Primary Service information on remote GATT server.
ble_gattc_evt_char_desc_disc_t::char_descs
ble_gattc_desc_t * char_descs
Descriptor data.
Definition: ble_gattc.h:282
ble_gatt.h
BLE GATT.
ble_gattc_browse_attr_info::attr
ble_gattc_browse_attr_t attr
Information about Attribute.
Definition: ble_gattc.h:197
ble_gattc_evt_enh_browse_srvc_t::serv_type
uint8_t serv_type
Service type.
Definition: ble_gattc.h:321
ble_gattc_read_multiple_t::p_read_multiple
ble_gattc_multiple_att_t * p_read_multiple
Pointer to the multiple attributes to be read.
Definition: ble_gattc.h:159
ble_gattc_evt_enh_ntf_ind_t::p_value
uint8_t * p_value
Pointer to the attribute value data.
Definition: ble_gattc.h:384
ble_gattc_browse_attr_char_t
GATTC Browse information about Characteristic.
Definition: ble_gattc.h:165
gr55xx_sys_cfg.h
Define the chip configuration.
ble_gattc_evt_t::char_disc
ble_gattc_evt_char_disc_t char_disc
Characteristic discovery response event.
Definition: ble_gattc.h:397
ble_gattc_browse_attr_info::inc_srvc
ble_gattc_browse_inc_srvc_t inc_srvc
Information about Included Service.
Definition: ble_gattc.h:196
ble_gattc_char_t
GATT characteristic.
Definition: ble_gattc.h:221
ble_gattc_cache_current_state_t
ble_gattc_cache_current_state_t
GATT Client Cache Update Current State.
Definition: ble_gattc.h:96
ble_gattc_evt_t::enh_prim_srvc_disc
ble_gattc_evt_enh_srvc_disc_t enh_prim_srvc_disc
Primary service discovery response event.
Definition: ble_gattc.h:404
ble_gattc_browse_inc_srvc_t::uuid_len
uint8_t uuid_len
Included Service UUID length.
Definition: ble_gattc.h:177
ble_gattc_evt_ntf_ind_t::handle
uint16_t handle
Attribute handle.
Definition: ble_gattc.h:305
ble_gattc_read_value_t
GATT Client Read value.
Definition: ble_gattc.h:239
ble_gattc_evt_cache_update_t::cache_valid
bool cache_valid
Cache validity.
Definition: ble_gattc.h:313
ble_gattc_write_no_resp_t
GATTC write without response structure.
Definition: ble_gattc.h:141
ble_gattc_evt_write_t::handle
uint16_t handle
Attribute handle.
Definition: ble_gattc.h:296
ble_gattc_multiple_att_t
Read Multiple Handles.
Definition: ble_gattc.h:150
ble_gattc_evt_enh_read_t
GATT value Read response event for BLE_GATTC_EVT_READ_RSP.
Definition: ble_gattc.h:364
BLE_GATTC_PRI_SERV
@ BLE_GATTC_PRI_SERV
Primary Service.
Definition: ble_gattc.h:74
ble_gattc_write_attr_value_t::handle
uint16_t handle
Attribute handle.
Definition: ble_gattc.h:131
ble_gattc_char_t::prop
uint8_t prop
Properties.
Definition: ble_gattc.h:224
ble_gattc_evt_incl_disc_t::includes
ble_gattc_include_t * includes
Include data.
Definition: ble_gattc.h:268
ble_gattc_attr_type_t
ble_gattc_attr_type_t
GATT Client Service Discover Attribute type IDs.
Definition: ble_gattc.h:85
ble_gattc_evt_browse_srvc_t::end_hdl
uint16_t end_hdl
Service end handle.
Definition: ble_gattc.h:253
ble_error.h
File that contains error codes.
ble_gattc_browse_inc_srvc_t::attr_type
ble_gattc_attr_type_t attr_type
Attribute type.
Definition: ble_gattc.h:176
ble_gattc_evt_t::enh_inc_srvc_disc
ble_gattc_evt_enh_incl_disc_t enh_inc_srvc_disc
Include service discovery response event.
Definition: ble_gattc.h:405
ble_gattc_service_t::end_hdl
uint16_t end_hdl
End handle.
Definition: ble_gattc.h:204
ble_gattc_evt_enh_char_desc_disc_t
GATT characteristic descriptor discovery.
Definition: ble_gattc.h:356
ble_gattc_write_no_resp_t::p_value
uint8_t * p_value
Value to write.
Definition: ble_gattc.h:145
ble_gattc_evt_enh_char_disc_t::cid
uint16_t cid
Channel id.
Definition: ble_gattc.h:349
BLE_GATT_CACHE_UPDATING
@ BLE_GATT_CACHE_UPDATING
GATT Cache in updating process.
Definition: ble_gattc.h:97
ble_gattc_evt_enh_srvc_disc_t
GATT service discovery.
Definition: ble_gattc.h:332
ble_gattc_write
uint16_t ble_gattc_write(uint8_t conn_idx, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t *p_value)
Write (long) Characteristic (Descriptor) Value.
ble_gattc_include_t::uuid_len
uint8_t uuid_len
Service UUID length.
Definition: ble_gattc.h:215
ble_gattc_primary_services_discover
uint16_t ble_gattc_primary_services_discover(uint8_t conn_idx, const ble_uuid_t *p_srvc_uuid)
Discover Primary Services on remote GATT server.
ble_gattc_write_no_resp
uint16_t ble_gattc_write_no_resp(uint8_t conn_idx, bool signed_write, uint16_t handle, uint16_t length, const uint8_t *p_value)
Write Attribute to remote GATT server (without response).
ble_gattc_browse_attr_info::attr_type
ble_gattc_attr_type_t attr_type
Attribute type.
Definition: ble_gattc.h:194
ble_gattc_evt_enh_read_t::value
ble_gattc_read_value_t * value
Value(s) list.
Definition: ble_gattc.h:367
ble_gattc_evt_t::enh_char_disc
ble_gattc_evt_enh_char_disc_t enh_char_disc
Characteristic discovery response event.
Definition: ble_gattc.h:406
ble_gattc_write_no_resp_t::length
uint16_t length
Write length.
Definition: ble_gattc.h:144
ble_gattc_browse_attr_char_t::attr_type
ble_gattc_attr_type_t attr_type
Attribute type.
Definition: ble_gattc.h:166
ble_gattc_evt_enh_char_disc_t
GATT characteristic discovery.
Definition: ble_gattc.h:348
ble_gattc_evt_enh_char_disc_t::chars
ble_gattc_char_t * chars
Characteristic data.
Definition: ble_gattc.h:351
ble_gattc_evt_char_disc_t
GATT characteristic discovery event for BLE_GATTC_EVT_CHAR_DISC.
Definition: ble_gattc.h:273
ble_gattc_evt_enh_ntf_ind_t
GATTC Notification and Indication value indication.
Definition: ble_gattc.h:379
ble_gattc_disc_char_t::p_uuid
ble_uuid_t * p_uuid
Characteristic UUID.
Definition: ble_gattc.h:113
ble_gattc_evt_char_disc_t::count
uint16_t count
Characteristic count.
Definition: ble_gattc.h:274
ble_gattc_read_value_t::offset
uint16_t offset
Offset of the attribute value.
Definition: ble_gattc.h:241
ble_gattc_evt_incl_disc_t::count
uint16_t count
Include count.
Definition: ble_gattc.h:267
ble_gattc_desc_t
GATT descriptor.
Definition: ble_gattc.h:231
ble_gattc_evt_enh_incl_disc_t::includes
ble_gattc_include_t * includes
Include data.
Definition: ble_gattc.h:343
ble_gattc_evt_ntf_ind_t::type
ble_gatt_evt_type_t type
Event type.
Definition: ble_gattc.h:303
ble_gattc_evt_enh_char_desc_disc_t::cid
uint16_t cid
Channel id.
Definition: ble_gattc.h:357
ble_gatt_evt_type_t
ble_gatt_evt_type_t
GATT common events.
Definition: ble_gatt.h:67
ble_gattc_service_t
GATT service.
Definition: ble_gattc.h:202
ble_gattc_read
uint16_t ble_gattc_read(uint8_t conn_idx, uint16_t handle, uint16_t offset)
Read Attribute from remote GATT server.
ble_gattc_read_by_uuid_t::p_uuid
ble_uuid_t * p_uuid
Characteristic UUID.
Definition: ble_gattc.h:123
ble_gattc_browse_inc_srvc_t::start_hdl
uint16_t start_hdl
Included Service start handle.
Definition: ble_gattc.h:179
ble_gattc_evt_enh_incl_disc_t::count
uint16_t count
Include count.
Definition: ble_gattc.h:342
ble_gattc_char_discover
uint16_t ble_gattc_char_discover(uint8_t conn_idx, uint16_t start_hdl, uint16_t end_hdl, const ble_uuid_t *p_char_uuid)
Discover Characteristics on remote GATT server.
ble_gattc_evt_enh_write_t::cid
uint16_t cid
Channel id.
Definition: ble_gattc.h:373
ble_gattc_read_value_t::p_value
uint8_t * p_value
Pointer to the attribute value data.
Definition: ble_gattc.h:243
ble_gattc_write_attr_value_t
GATTC write attribute value structure.
Definition: ble_gattc.h:130
ble_gattc_desc_t::p_uuid
uint8_t * p_uuid
Descriptor UUID.
Definition: ble_gattc.h:234
ble_gattc_include_t
GATT include.
Definition: ble_gattc.h:211
ble_gattc_indicate_cfm
uint16_t ble_gattc_indicate_cfm(uint8_t conn_idx, uint16_t handle)
Confirm Reception of Indication.
ble_gattc_evt_srvc_disc_t::count
uint16_t count
Service count.
Definition: ble_gattc.h:260
ble_gattc_write_no_resp_t::signed_write
bool signed_write
True if signed write should be used when possible/applicable.
Definition: ble_gattc.h:142
ble_gattc_evt_t::cache_update
ble_gattc_evt_cache_update_t cache_update
Cache update event.
Definition: ble_gattc.h:402
ble_gattc_evt_enh_ntf_ind_t::handle
uint16_t handle
Attribute handle.
Definition: ble_gattc.h:383
ble_gattc_evt_t::prim_srvc_disc
ble_gattc_evt_srvc_disc_t prim_srvc_disc
Primary service discovery response event.
Definition: ble_gattc.h:395
ble_gattc_evt_enh_browse_srvc_t::cid
uint16_t cid
Channel id.
Definition: ble_gattc.h:320
ble_gattc_browse_attr_char_t::prop
uint8_t prop
Value property.
Definition: ble_gattc.h:167
ble_gattc_char_t::p_uuid
uint8_t * p_uuid
Characteristic UUID.
Definition: ble_gattc.h:226
ble_gattc_read_by_uuid_t
GATTC read by characteristic UUID structure.
Definition: ble_gattc.h:120
ble_gattc_read_by_uuid_t::end_hdl
uint16_t end_hdl
End handle.
Definition: ble_gattc.h:122
ble_gattc_evt_browse_srvc_t::info
union ble_gattc_browse_attr_info * info
Attribute information presented in the service(array length = end_hdl - start_hdl);If attr_type is eq...
Definition: ble_gattc.h:254
BLE_GATT_CACHE_FINISH
@ BLE_GATT_CACHE_FINISH
GATT Cache is updated or checked.
Definition: ble_gattc.h:98
ble_gattc_evt_t::index
uint8_t index
Index of connection.
Definition: ble_gattc.h:391
ble_gattc_disc_char_t::start_hdl
uint16_t start_hdl
Start handle.
Definition: ble_gattc.h:111
ble_gattc_evt_enh_ntf_ind_t::length
uint16_t length
Attribute value length.
Definition: ble_gattc.h:382
ble_gattc_evt_char_desc_disc_t
GATT characteristic descriptor discovery event for BLE_GATTC_EVT_CHAR_DESC_DISC.
Definition: ble_gattc.h:280
ble_att.h
Attribute Protocol.
ble_gattc_evt_t::char_desc_disc
ble_gattc_evt_char_desc_disc_t char_desc_disc
Characteristic descriptor discovery response event.
Definition: ble_gattc.h:398
ble_gattc_evt_char_disc_t::chars
ble_gattc_char_t * chars
Characteristic data.
Definition: ble_gattc.h:275
ble_gattc_browse_inc_srvc_t
GATTC Browse information about Included Service.
Definition: ble_gattc.h:175
ble_gattc_browse_attr_info
GATTC Browse attribute information.
Definition: ble_gattc.h:193
ble_gattc_evt_enh_browse_srvc_t::uuid_len
uint8_t uuid_len
Service UUID length.
Definition: ble_gattc.h:322
ble_gattc_evt_t::enh_read_rsp
ble_gattc_evt_enh_read_t enh_read_rsp
Read response event.
Definition: ble_gattc.h:408
ble_gattc_evt_enh_ntf_ind_t::type
ble_gatt_evt_type_t type
Event type.
Definition: ble_gattc.h:381
ble_gattc_include_t::p_uuid
uint8_t * p_uuid
Service UUID.
Definition: ble_gattc.h:216
ble_gattc_evt_t::srvc_browse
ble_gattc_evt_browse_srvc_t srvc_browse
Browce service discovery response event.
Definition: ble_gattc.h:394
ble_gattc_evt_cache_update_t::cache_current_state
ble_gattc_cache_current_state_t cache_current_state
Definition: ble_gattc.h:314
ble_gattc_evt_enh_char_desc_disc_t::count
uint16_t count
Descriptor count.
Definition: ble_gattc.h:358
ble_gattc_evt_enh_browse_srvc_t
GATTC Browse service(s) indication.
Definition: ble_gattc.h:319
ble_gattc_evt_srvc_disc_t::services
ble_gattc_service_t * services
Service data.
Definition: ble_gattc.h:261
ble_gattc_evt_enh_browse_srvc_t::end_hdl
uint16_t end_hdl
Service end handle.
Definition: ble_gattc.h:325
ble_gattc_evt_enh_srvc_disc_t::count
uint16_t count
Service count.
Definition: ble_gattc.h:334
ble_gattc_evt_t::read_rsp
ble_gattc_evt_read_t read_rsp
Read response event.
Definition: ble_gattc.h:399
ble_uuid_t
GATT UUID structure.
Definition: ble_gatt.h:81
ble_gattc_evt_cache_update_t
GATT Client Cache Update event for BLE_GATTC_EVT_CACHE_UPDATE.
Definition: ble_gattc.h:312
ble_gattc_read_by_uuid
uint16_t ble_gattc_read_by_uuid(uint8_t conn_idx, uint16_t start_hdl, uint16_t end_hdl, const ble_uuid_t *p_char_uuid)
Read Attribute by UUID.
ble_gattc_browse_attr_char_t::uuid_len
uint8_t uuid_len
Characteristic UUID length.
Definition: ble_gattc.h:169
ble_gattc_browse_attr_info::attr_char
ble_gattc_browse_attr_char_t attr_char
Information about Characteristic.
Definition: ble_gattc.h:195
ble_gattc_evt_incl_disc_t
GATT include discovery event for BLE_GATTC_EVT_INCLUDE_SRVC_DISC.
Definition: ble_gattc.h:266
ble_gattc_evt_t::enh_ntf_ind
ble_gattc_evt_enh_ntf_ind_t enh_ntf_ind
Handle value Notification/Indication response.
Definition: ble_gattc.h:410
ble_gattc_evt_enh_write_t
GATT Client Write Response event for BLE_GATTC_EVT_WRITE_RSP.
Definition: ble_gattc.h:372
ble_gattc_read_multiple_t
GATTC Read Multiple.
Definition: ble_gattc.h:157
ble_gattc_include_t::start_hdl
uint16_t start_hdl
Start handle.
Definition: ble_gattc.h:213
ble_gattc_desc_t::attr_hdl
uint16_t attr_hdl
Attribute handle.
Definition: ble_gattc.h:232
ble_gattc_include_t::attr_hdl
uint16_t attr_hdl
Attribute handle.
Definition: ble_gattc.h:212
ble_gattc_evt_enh_incl_disc_t
GATT include discovery.
Definition: ble_gattc.h:340
ble_gattc_evt_ntf_ind_t::p_value
uint8_t * p_value
Pointer to the attribute value data.
Definition: ble_gattc.h:306
ble_gattc_evt_enh_read_t::cid
uint16_t cid
Channel id.
Definition: ble_gattc.h:365
ble_gattc_evt_enh_srvc_disc_t::services
ble_gattc_service_t * services
Service data.
Definition: ble_gattc.h:335
ble_gattc_read_value_t::length
uint16_t length
Attribute value length.
Definition: ble_gattc.h:242
ble_gattc_read_value_t::handle
uint16_t handle
Attribute handle.
Definition: ble_gattc.h:240
ble_gattc_write_no_resp_t::handle
uint16_t handle
Attribute handle.
Definition: ble_gattc.h:143
ble_gattc_browse_attr_t
GATTC Browse information about Attribute.
Definition: ble_gattc.h:185
ble_gattc_browse_attr_t::attr_type
ble_gattc_attr_type_t attr_type
Attribute type.
Definition: ble_gattc.h:186
ble_gattc_write_execute
uint16_t ble_gattc_write_execute(uint8_t conn_idx, bool execute)
Execute Reliable/Long Write to remote GATT server.
ble_gattc_read_multiple
uint16_t ble_gattc_read_multiple(uint8_t conn_idx, const ble_gattc_read_multiple_t *p_param)
Initiate a Read Multiple Characteristic Values procedure.
ble_gattc_evt_ntf_ind_t::length
uint16_t length
Attribute value length.
Definition: ble_gattc.h:304
ble_gattc_disc_char_t::end_hdl
uint16_t end_hdl
End handle.
Definition: ble_gattc.h:112
ble_gattc_service_t::start_hdl
uint16_t start_hdl
Start handle.
Definition: ble_gattc.h:203
ble_gattc_evt_enh_char_disc_t::count
uint16_t count
Characteristic count.
Definition: ble_gattc.h:350
ble_gattc_evt_t
BLE GATTC event structure.
Definition: ble_gattc.h:390
ble_gattc_disc_char_t
GATTC discovery characteristic structure.
Definition: ble_gattc.h:110