1- /*
1+ /*
22 * Copyright (c) Nordic Semiconductor ASA
33 * All rights reserved.
4- *
4+ *
55 * Redistribution and use in source and binary forms, with or without modification,
66 * are permitted provided that the following conditions are met:
7- *
7+ *
88 * 1. Redistributions of source code must retain the above copyright notice, this
99 * list of conditions and the following disclaimer.
10- *
10+ *
1111 * 2. Redistributions in binary form must reproduce the above copyright notice, this
1212 * list of conditions and the following disclaimer in the documentation and/or
1313 * other materials provided with the distribution.
14- *
14+ *
1515 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other
1616 * contributors to this software may be used to endorse or promote products
1717 * derived from this software without specific prior written permission.
18- *
18+ *
1919 * 4. This software must only be used in a processor manufactured by Nordic
2020 * Semiconductor ASA, or in a processor manufactured by a third party that
2121 * is used in combination with a processor manufactured by Nordic Semiconductor.
22- *
23- *
22+ *
23+ *
2424 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
2525 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2626 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
3131 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3232 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3333 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34- *
34+ *
3535 */
3636
3737/**
@@ -170,7 +170,8 @@ typedef struct
170170typedef struct
171171{
172172 uint16_t handle ; /**< Attribute handle. */
173- union {
173+ union gattc_attr_info_union
174+ {
174175 ble_uuid_t uuid16 ; /**< 16-bit Attribute UUID. */
175176 ble_uuid128_t uuid128 ; /**< 128-bit Attribute UUID. */
176177 } info ;
@@ -218,10 +219,10 @@ typedef struct
218219} ble_gattc_evt_attr_info_disc_rsp_t ;
219220
220221/**@brief GATT read by UUID handle value pair. */
221- typedef struct
222+ typedef struct
222223{
223224 uint16_t handle ; /**< Attribute Handle. */
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).
225+ 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).
225226 Please note that this pointer is absolute to the memory provided by the user when retrieving the event,
226227 so it will effectively point to a location inside the handle_value array. */
227228} ble_gattc_handle_value_t ;
@@ -286,7 +287,7 @@ typedef struct
286287 uint16_t conn_handle ; /**< Connection Handle on which event occured. */
287288 uint16_t gatt_status ; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */
288289 uint16_t error_handle ; /**< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID. */
289- union
290+ union gattc_evt_params_union
290291 {
291292 ble_gattc_evt_prim_srvc_disc_rsp_t prim_srvc_disc_rsp ; /**< Primary Service Discovery Response Event Parameters. */
292293 ble_gattc_evt_rel_disc_rsp_t rel_disc_rsp ; /**< Relationship Discovery Response Event Parameters. */
@@ -308,7 +309,7 @@ typedef struct
308309
309310/**@brief Initiate or continue a GATT Primary Service Discovery procedure.
310311 *
311- * @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle.
312+ * @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle.
312313 * If the last service has not been reached, this function must be called again with an updated start handle value to continue the search.
313314 *
314315 * @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
@@ -317,11 +318,11 @@ typedef struct
317318 * @events
318319 * @event{@ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP}
319320 * @endevents
320- *
321+ *
321322 * @mscs
322323 * @mmsc{@ref BLE_GATTC_PRIM_SRVC_DISC_MSC}
323324 * @endmscs
324- *
325+ *
325326 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
326327 * @param[in] start_handle Handle to start searching from.
327328 * @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned.
@@ -343,11 +344,11 @@ SD_RPC_API uint32_t sd_ble_gattc_primary_services_discover(adapter_t *adapter, u
343344 * @events
344345 * @event{@ref BLE_GATTC_EVT_REL_DISC_RSP}
345346 * @endevents
346- *
347+ *
347348 * @mscs
348349 * @mmsc{@ref BLE_GATTC_REL_DISC_MSC}
349350 * @endmscs
350- *
351+ *
351352 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
352353 * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on.
353354 *
@@ -376,7 +377,7 @@ SD_RPC_API uint32_t sd_ble_gattc_relationships_discover(adapter_t *adapter, uint
376377 * @mscs
377378 * @mmsc{@ref BLE_GATTC_CHAR_DISC_MSC}
378379 * @endmscs
379- *
380+ *
380381 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
381382 * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on.
382383 *
@@ -401,7 +402,7 @@ SD_RPC_API uint32_t sd_ble_gattc_characteristics_discover(adapter_t *adapter, ui
401402 * @mscs
402403 * @mmsc{@ref BLE_GATTC_DESC_DISC_MSC}
403404 * @endmscs
404- *
405+ *
405406 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
406407 * @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on.
407408 *
@@ -422,11 +423,11 @@ SD_RPC_API uint32_t sd_ble_gattc_descriptors_discover(adapter_t *adapter, uint16
422423 * @events
423424 * @event{BLE_GATTC_EVT_DESC_DISC_RSP}
424425 * @endevents
425- *
426+ *
426427 * @mscs
427428 * @mmsc{@ref BLE_GATTC_READ_UUID_MSC}
428429 * @endmscs
429- *
430+ *
430431 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
431432 * @param[in] p_uuid Pointer to a Characteristic value UUID to read.
432433 * @param[in] p_handle_range A pointer to the range of handles to perform this procedure on.
@@ -443,17 +444,17 @@ SD_RPC_API uint32_t sd_ble_gattc_char_value_by_uuid_read(adapter_t *adapter, uin
443444/**@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure.
444445 *
445446 * @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor
446- * to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the
447+ * to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the
447448 * complete value.
448449 *
449450 * @events
450451 * @event{@ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP}
451452 * @endevents
452- *
453+ *
453454 * @mscs
454455 * @mmsc{@ref BLE_GATTC_VALUE_READ_MSC}
455456 * @endmscs
456- *
457+ *
457458 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
458459 * @param[in] handle The handle of the attribute to be read.
459460 * @param[in] offset Offset into the attribute value to be read.
@@ -468,16 +469,16 @@ SD_RPC_API uint32_t sd_ble_gattc_read(adapter_t *adapter, uint16_t conn_handle,
468469
469470/**@brief Initiate a GATT Read Multiple Characteristic Values procedure.
470471 *
471- * @details This function initiates a GATT Read Multiple Characteristic Values procedure.
472+ * @details This function initiates a GATT Read Multiple Characteristic Values procedure.
472473 *
473474 * @events
474475 * @event{@ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP}
475476 * @endevents
476- *
477+ *
477478 * @mscs
478479 * @mmsc{@ref BLE_GATTC_READ_MULT_MSC}
479480 * @endmscs
480- *
481+ *
481482 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
482483 * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read.
483484 * @param[in] handle_count The number of handles in p_handles.
@@ -493,24 +494,24 @@ SD_RPC_API uint32_t sd_ble_gattc_char_values_read(adapter_t *adapter, uint16_t c
493494
494495/**@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure.
495496 *
496- * @details This function can perform all write procedures described in GATT.
497+ * @details This function can perform all write procedures described in GATT.
497498 *
498- * @note It is important to note that a write without response will <b>consume an application buffer</b>, and will therefore
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
500- * standard client internal buffer and thus will only generate a @ref BLE_GATTC_EVT_WRITE_RSP event as soon as the write response
499+ * @note It is important to note that a write without response will <b>consume an application buffer</b>, and will therefore
500+ * 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
501+ * standard client internal buffer and thus will only generate a @ref BLE_GATTC_EVT_WRITE_RSP event as soon as the write response
501502 * has been received from the peer. Please see the documentation of @ref sd_ble_tx_packet_count_get for more details.
502503 *
503504 * @events
504505 * @event{@ref BLE_GATTC_EVT_WRITE_RSP, Generated when using write request or queued writes.}
505506 * @endevents
506- *
507+ *
507508 * @mscs
508509 * @mmsc{@ref BLE_GATTC_VALUE_WRITE_MSC}
509510 * @mmsc{@ref BLE_GATTC_VALUE_LONG_WRITE_MSC}
510511 * @mmsc{@ref BLE_GATTC_VALUE_RELIABLE_WRITE_MSC}
511512 * @mmsc{@ref BLE_COMMON_APP_BUFF_MSC}
512513 * @endmscs
513- *
514+ *
514515 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
515516 * @param[in] p_write_params A pointer to a write parameters structure.
516517 *
@@ -527,11 +528,11 @@ SD_RPC_API uint32_t sd_ble_gattc_write(adapter_t *adapter, uint16_t conn_handle,
527528
528529
529530/**@brief Send a Handle Value Confirmation to the GATT Server.
530- *
531+ *
531532 * @mscs
532533 * @mmsc{@ref BLE_GATTC_HVI_MSC}
533534 * @endmscs
534- *
535+ *
535536 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
536537 * @param[in] handle The handle of the attribute in the indication.
537538 *
0 commit comments