ble/gatt_client: improve API documentation

This commit is contained in:
Milanka Ringwald 2022-11-18 11:10:32 +01:00
parent b2468039bd
commit 79188ed7e9

View File

@ -249,7 +249,8 @@ void gatt_client_init(void);
void gatt_client_set_required_security_level(gap_security_level_t level);
/**
* @brief MTU is available after the first query has completed. If status is equal to ERROR_CODE_SUCCESS, it returns the real value, otherwise the default value ATT_DEFAULT_MTU (see bluetooth.h).
* @brief MTU is available after the first query has completed. If status is equal to ERROR_CODE_SUCCESS, it returns the real value,
* otherwise the default value ATT_DEFAULT_MTU (see bluetooth.h).
* @param con_handle
* @param mtu
* @return status BTSTACK_MEMORY_ALLOC_FAILED if no GATT client for con_handle is found
@ -259,13 +260,15 @@ void gatt_client_set_required_security_level(gap_security_level_t level);
uint8_t gatt_client_get_mtu(hci_con_handle_t con_handle, uint16_t * mtu);
/**
* @brief Sets whether a MTU Exchange Request shall be automatically send before the first attribute read request is send. Default is enabled.
* @brief Sets whether a MTU Exchange Request shall be automatically send before the
* first attribute read request is send. Default is enabled.
* @param enabled
*/
void gatt_client_mtu_enable_auto_negotiation(uint8_t enabled);
/**
* @brief Sends a MTU Exchange Request, this allows for the client to exchange MTU when gatt_client_mtu_enable_auto_negotiation is disabled.
* @brief Sends a MTU Exchange Request, this allows for the client to exchange MTU
* when gatt_client_mtu_enable_auto_negotiation is disabled.
* @param callback
* @param con_handle
*/
@ -279,7 +282,9 @@ void gatt_client_send_mtu_negotiation(btstack_packet_handler_t callback, hci_con
int gatt_client_is_ready(hci_con_handle_t con_handle);
/**
* @brief Discovers all primary services. For each found service, an le_service_event_t with type set to GATT_EVENT_SERVICE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t, with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief Discovers all primary services.
* For each found service a GATT_EVENT_SERVICE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @return status BTSTACK_MEMORY_ALLOC_FAILED, if no GATT client for con_handle is found
@ -289,7 +294,9 @@ int gatt_client_is_ready(hci_con_handle_t con_handle);
uint8_t gatt_client_discover_primary_services(btstack_packet_handler_t callback, hci_con_handle_t con_handle);
/**
* @brief Discovers all secondary services. For each found service, an le_service_event_t with type set to GATT_EVENT_SERVICE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t, with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief Discovers all secondary services.
* For each found service a GATT_EVENT_SERVICE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @return status BTSTACK_MEMORY_ALLOC_FAILED, if no GATT client for con_handle is found
@ -299,7 +306,9 @@ uint8_t gatt_client_discover_primary_services(btstack_packet_handler_t callback,
uint8_t gatt_client_discover_secondary_services(btstack_packet_handler_t callback, hci_con_handle_t con_handle);
/**
* @brief Discovers a specific primary service given its UUID. This service may exist multiple times. For each found service, an le_service_event_t with type set to GATT_EVENT_SERVICE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t, with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief Discovers a specific primary service given its UUID. This service may exist multiple times.
* For each found service a GATT_EVENT_SERVICE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @param uuid16
@ -310,7 +319,9 @@ uint8_t gatt_client_discover_secondary_services(btstack_packet_handler_t callbac
uint8_t gatt_client_discover_primary_services_by_uuid16(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t uuid16);
/**
* @brief Discovers a specific primary service given its UUID. This service may exist multiple times. For each found service, an le_service_event_t with type set to GATT_EVENT_SERVICE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t, with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief Discovers a specific primary service given its UUID. This service may exist multiple times.
* For each found service a GATT_EVENT_SERVICE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @param uuid128
@ -321,7 +332,13 @@ uint8_t gatt_client_discover_primary_services_by_uuid16(btstack_packet_handler_t
uint8_t gatt_client_discover_primary_services_by_uuid128(btstack_packet_handler_t callback, hci_con_handle_t con_handle, const uint8_t * uuid128);
/**
* @brief Finds included services within the specified service. For each found included service, an le_service_event_t with type set to GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery. Information about included service type (primary/secondary) can be retrieved either by sending an ATT find information request for the returned start group handle (returning the handle and the UUID for primary or secondary service) or by comparing the service to the list of all primary services.
* @brief Finds included services within the specified service.
* For each found included service a GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* Information about included service type (primary/secondary) can be retrieved either by sending
* an ATT find information request for the returned start group handle
* (returning the handle and the UUID for primary or secondary service) or by comparing the service
* to the list of all primary services.
* @param callback
* @param con_handle
* @param service
@ -332,7 +349,9 @@ uint8_t gatt_client_discover_primary_services_by_uuid128(btstack_packet_handler_
uint8_t gatt_client_find_included_services_for_service(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_service_t * service);
/**
* @brief Discovers all characteristics within the specified service. For each found characteristic, an le_characteristics_event_t with type set to GATT_EVENT_CHARACTERISTIC_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief Discovers all characteristics within the specified service.
* For each found characteristic a GATT_EVENT_CHARACTERISTIC_QUERY_RESULT event will be emited.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @param service
@ -343,7 +362,11 @@ uint8_t gatt_client_find_included_services_for_service(btstack_packet_handler_t
uint8_t gatt_client_discover_characteristics_for_service(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_service_t * service);
/**
* @brief The following four functions are used to discover all characteristics within the specified service or handle range, and return those that match the given UUID. For each found characteristic, an le_characteristic_event_t with type set to GATT_EVENT_CHARACTERISTIC_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief The following four functions are used to discover all characteristics within
* the specified service or handle range, and return those that match the given UUID.
*
* For each found characteristic a GATT_EVENT_CHARACTERISTIC_QUERY_RESULT event will emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @param start_handle
@ -356,7 +379,10 @@ uint8_t gatt_client_discover_characteristics_for_service(btstack_packet_handler_
uint8_t gatt_client_discover_characteristics_for_handle_range_by_uuid16(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid16);
/**
* @brief The following four functions are used to discover all characteristics within the specified service or handle range, and return those that match the given UUID. For each found characteristic, an le_characteristic_event_t with type set to GATT_EVENT_CHARACTERISTIC_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief The following four functions are used to discover all characteristics within the
* specified service or handle range, and return those that match the given UUID.
* For each found characteristic a GATT_EVENT_CHARACTERISTIC_QUERY_RESULT event will emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @param start_handle
@ -369,7 +395,10 @@ uint8_t gatt_client_discover_characteristics_for_handle_range_by_uuid16(btstack_
uint8_t gatt_client_discover_characteristics_for_handle_range_by_uuid128(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t start_handle, uint16_t end_handle, const uint8_t * uuid128);
/**
* @brief The following four functions are used to discover all characteristics within the specified service or handle range, and return those that match the given UUID. For each found characteristic, an le_characteristic_event_t with type set to GATT_EVENT_CHARACTERISTIC_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief The following four functions are used to discover all characteristics within the
* specified service or handle range, and return those that match the given UUID.
* For each found characteristic a GATT_EVENT_CHARACTERISTIC_QUERY_RESULT event will emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @param service
@ -381,7 +410,10 @@ uint8_t gatt_client_discover_characteristics_for_handle_range_by_uuid128(btstack
uint8_t gatt_client_discover_characteristics_for_service_by_uuid16(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_service_t * service, uint16_t uuid16);
/**
* @brief The following four functions are used to discover all characteristics within the specified service or handle range, and return those that match the given UUID. For each found characteristic, an le_characteristic_event_t with type set to GATT_EVENT_CHARACTERISTIC_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief The following four functions are used to discover all characteristics within the
* specified service or handle range, and return those that match the given UUID.
* For each found characteristic a GATT_EVENT_CHARACTERISTIC_QUERY_RESULT event will emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @param service
@ -393,7 +425,10 @@ uint8_t gatt_client_discover_characteristics_for_service_by_uuid16(btstack_packe
uint8_t gatt_client_discover_characteristics_for_service_by_uuid128(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_service_t * service, const uint8_t * uuid128);
/**
* @brief Discovers attribute handle and UUID of a characteristic descriptor within the specified characteristic. For each found descriptor, an le_characteristic_descriptor_event_t with type set to GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of discovery.
* @brief Discovers attribute handle and UUID of a characteristic descriptor within the specified characteristic.
* For each found descriptor a GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT event will be emitted.
*
* The GATT_EVENT_QUERY_COMPLETE event marks the end of discovery.
* @param callback
* @param con_handle
* @param characteristic
@ -404,7 +439,9 @@ uint8_t gatt_client_discover_characteristics_for_service_by_uuid128(btstack_pack
uint8_t gatt_client_discover_characteristic_descriptors(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic);
/**
* @brief Reads the characteristic value using the characteristic's value handle. If the characteristic value is found, an le_characteristic_value_event_t with type set to GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the characteristic value using the characteristic's value handle.
* If the characteristic value is found a GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param characteristic
@ -415,7 +452,9 @@ uint8_t gatt_client_discover_characteristic_descriptors(btstack_packet_handler_t
uint8_t gatt_client_read_value_of_characteristic(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic);
/**
* @brief Reads the characteristic value using the characteristic's value handle. If the characteristic value is found, an le_characteristic_value_event_t with type set to GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the characteristic value using the characteristic's value handle.
* If the characteristic value is found a GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param value_handle
@ -426,7 +465,9 @@ uint8_t gatt_client_read_value_of_characteristic(btstack_packet_handler_t callba
uint8_t gatt_client_read_value_of_characteristic_using_value_handle(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle);
/**
* @brief Reads the characteric value of all characteristics with the uuid. For each found, an le_characteristic_value_event_t with type set to GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the characteric value of all characteristics with the uuid.
* For each characteristic value found a GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param start_handle
@ -439,7 +480,9 @@ uint8_t gatt_client_read_value_of_characteristic_using_value_handle(btstack_pack
uint8_t gatt_client_read_value_of_characteristics_by_uuid16(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid16);
/**
* @brief Reads the characteric value of all characteristics with the uuid. For each found, an le_characteristic_value_event_t with type set to GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the characteric value of all characteristics with the uuid.
* For each characteristic value found a GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param start_handle
@ -452,7 +495,10 @@ uint8_t gatt_client_read_value_of_characteristics_by_uuid16(btstack_packet_handl
uint8_t gatt_client_read_value_of_characteristics_by_uuid128(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t start_handle, uint16_t end_handle, const uint8_t * uuid128);
/**
* @brief Reads the long characteristic value using the characteristic's value handle. The value will be returned in several blobs. For each blob, an le_characteristic_value_event_t with type set to GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT and updated value offset will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, mark the end of read.
* @brief Reads the long characteristic value using the characteristic's value handle.
* The value will be returned in several blobs.
* For each blob, a GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT event with updated value offset will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param characteristic
@ -463,7 +509,10 @@ uint8_t gatt_client_read_value_of_characteristics_by_uuid128(btstack_packet_hand
uint8_t gatt_client_read_long_value_of_characteristic(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic);
/**
* @brief Reads the long characteristic value using the characteristic's value handle. The value will be returned in several blobs. For each blob, an le_characteristic_value_event_t with type set to GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT and updated value offset will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, mark the end of read.
* @brief Reads the long characteristic value using the characteristic's value handle.
* The value will be returned in several blobs.
* For each blob, a GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT event with updated value offset will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param value_handle
@ -474,7 +523,10 @@ uint8_t gatt_client_read_long_value_of_characteristic(btstack_packet_handler_t c
uint8_t gatt_client_read_long_value_of_characteristic_using_value_handle(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle);
/**
* @brief Reads the long characteristic value using the characteristic's value handle. The value will be returned in several blobs. For each blob, an le_characteristic_value_event_t with type set to GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT and updated value offset will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, mark the end of read.
* @brief Reads the long characteristic value using the characteristic's value handle.
* The value will be returned in several blobs.
* For each blob, a GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT event with updated value offset will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param value_handle
@ -486,16 +538,22 @@ uint8_t gatt_client_read_long_value_of_characteristic_using_value_handle(btstack
uint8_t gatt_client_read_long_value_of_characteristic_using_value_handle_with_offset(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle, uint16_t offset);
/*
* @brief Read multiple characteristic values
* @brief Read multiple characteristic values.
* The all results are emitted via single GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT event,
* followed by the GATT_EVENT_QUERY_COMPLETE event, which marks the end of read.
* @param callback
* @param con_handle
* @param num_value_handles
* @param value_handles list of handles
* @return status BTSTACK_MEMORY_ALLOC_FAILED, if no GATT client for con_handle is found
* GATT_CLIENT_IN_WRONG_STATE , if GATT client is not ready
* ERROR_CODE_SUCCESS , if query is successfully registered
*/
uint8_t gatt_client_read_multiple_characteristic_values(btstack_packet_handler_t callback, hci_con_handle_t con_handle, int num_value_handles, uint16_t * value_handles);
/**
* @brief Writes the characteristic value using the characteristic's value handle without an acknowledgment that the write was successfully performed.
* @brief Writes the characteristic value using the characteristic's value handle without
* an acknowledgment that the write was successfully performed.
* @param con_handle
* @param value_handle
* @param value_length
@ -508,8 +566,10 @@ uint8_t gatt_client_read_multiple_characteristic_values(btstack_packet_handler_t
uint8_t gatt_client_write_value_of_characteristic_without_response(hci_con_handle_t con_handle, uint16_t value_handle, uint16_t value_length, uint8_t * value);
/**
* @brief Writes the authenticated characteristic value using the characteristic's value handle without an acknowledgment that the write was successfully performed.
* @note GATT_EVENT_QUERY_COMPLETE is emitted with 0 for success or ATT_ERROR_BONDING_INFORMATION_MISSING if there is no bonding information stored
* @brief Writes the authenticated characteristic value using the characteristic's value handle
* without an acknowledgment that the write was successfully performed.
* @note GATT_EVENT_QUERY_COMPLETE is emitted with ATT_ERROR_SUCCESS for success,
* or ATT_ERROR_BONDING_INFORMATION_MISSING if there is no bonding information stored.
* @param callback
* @param con_handle
* @param value_handle
@ -538,7 +598,9 @@ uint8_t gatt_client_signed_write_without_response(btstack_packet_handler_t callb
uint8_t gatt_client_write_value_of_characteristic(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle, uint16_t value_length, uint8_t * value);
/**
* @brief Writes the characteristic value using the characteristic's value handle. The GATT_EVENT_QUERY_COMPLETE event marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @brief Writes the characteristic value using the characteristic's value handle.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write.
* The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param value_handle
@ -551,7 +613,9 @@ uint8_t gatt_client_write_value_of_characteristic(btstack_packet_handler_t callb
uint8_t gatt_client_write_long_value_of_characteristic(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle, uint16_t value_length, uint8_t * value);
/**
* @brief Writes the characteristic value using the characteristic's value handle. The GATT_EVENT_QUERY_COMPLETE event marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @brief Writes the characteristic value using the characteristic's value handle.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write.
* The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param value_handle
@ -565,7 +629,10 @@ uint8_t gatt_client_write_long_value_of_characteristic(btstack_packet_handler_t
uint8_t gatt_client_write_long_value_of_characteristic_with_offset(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle, uint16_t offset, uint16_t value_length, uint8_t * value);
/**
* @brief Writes of the long characteristic value using the characteristic's value handle. It uses server response to validate that the write was correctly received. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @brief Writes of the long characteristic value using the characteristic's value handle.
* It uses server response to validate that the write was correctly received.
* The GATT_EVENT_QUERY_COMPLETE EVENT marks the end of write.
* The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param value_handle
@ -578,7 +645,9 @@ uint8_t gatt_client_write_long_value_of_characteristic_with_offset(btstack_packe
uint8_t gatt_client_reliable_write_long_value_of_characteristic(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle, uint16_t value_length, uint8_t * value);
/**
* @brief Reads the characteristic descriptor using its handle. If the characteristic descriptor is found, an le_characteristic_descriptor_event_t with type set to GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the characteristic descriptor using its handle.
* If the characteristic descriptor is found, a GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param descriptor
@ -589,7 +658,9 @@ uint8_t gatt_client_reliable_write_long_value_of_characteristic(btstack_packet_h
uint8_t gatt_client_read_characteristic_descriptor(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_descriptor_t * descriptor);
/**
* @brief Reads the characteristic descriptor using its handle. If the characteristic descriptor is found, an le_characteristic_descriptor_event_t with type set to GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the characteristic descriptor using its handle.
* If the characteristic descriptor is found, a GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param descriptor
@ -600,7 +671,9 @@ uint8_t gatt_client_read_characteristic_descriptor(btstack_packet_handler_t call
uint8_t gatt_client_read_characteristic_descriptor_using_descriptor_handle(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t descriptor_handle);
/**
* @brief Reads the long characteristic descriptor using its handle. It will be returned in several blobs. For each blob, an le_characteristic_descriptor_event_t with type set to GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the long characteristic descriptor using its handle. It will be returned in several blobs.
* For each blob, a GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param descriptor
@ -611,7 +684,9 @@ uint8_t gatt_client_read_characteristic_descriptor_using_descriptor_handle(btsta
uint8_t gatt_client_read_long_characteristic_descriptor(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_descriptor_t * descriptor);
/**
* @brief Reads the long characteristic descriptor using its handle. It will be returned in several blobs. For each blob, an le_characteristic_descriptor_event_t with type set to GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the long characteristic descriptor using its handle. It will be returned in several blobs.
* For each blob, a GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param descriptor_handle
@ -622,7 +697,9 @@ uint8_t gatt_client_read_long_characteristic_descriptor(btstack_packet_handler_t
uint8_t gatt_client_read_long_characteristic_descriptor_using_descriptor_handle(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t descriptor_handle);
/**
* @brief Reads the long characteristic descriptor using its handle. It will be returned in several blobs. For each blob, an le_characteristic_descriptor_event_t with type set to GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT will be generated and passed to the registered callback. The gatt_complete_event_t with type set to GATT_EVENT_QUERY_COMPLETE, marks the end of read.
* @brief Reads the long characteristic descriptor using its handle. It will be returned in several blobs.
* For each blob, a GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT event will be emitted.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of read.
* @param callback
* @param con_handle
* @param descriptor_handle
@ -634,7 +711,9 @@ uint8_t gatt_client_read_long_characteristic_descriptor_using_descriptor_handle(
uint8_t gatt_client_read_long_characteristic_descriptor_using_descriptor_handle_with_offset(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t descriptor_handle, uint16_t offset);
/**
* @brief Writes the characteristic descriptor using its handle. The GATT_EVENT_QUERY_COMPLETE event marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @brief Writes the characteristic descriptor using its handle.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write.
* The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param descriptor
@ -647,7 +726,9 @@ uint8_t gatt_client_read_long_characteristic_descriptor_using_descriptor_handle_
uint8_t gatt_client_write_characteristic_descriptor(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_descriptor_t * descriptor, uint16_t value_length, uint8_t * value);
/**
* @brief Writes the characteristic descriptor using its handle. The GATT_EVENT_QUERY_COMPLETE event marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @brief Writes the characteristic descriptor using its handle.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write.
* The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param descriptor_handle
@ -660,7 +741,9 @@ uint8_t gatt_client_write_characteristic_descriptor(btstack_packet_handler_t cal
uint8_t gatt_client_write_characteristic_descriptor_using_descriptor_handle(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t descriptor_handle, uint16_t value_length, uint8_t * value);
/**
* @brief Writes the characteristic descriptor using its handle. The GATT_EVENT_QUERY_COMPLETE event marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @brief Writes the characteristic descriptor using its handle.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write.
* The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param descriptor
@ -673,7 +756,9 @@ uint8_t gatt_client_write_characteristic_descriptor_using_descriptor_handle(btst
uint8_t gatt_client_write_long_characteristic_descriptor(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_descriptor_t * descriptor, uint16_t value_length, uint8_t * value);
/**
* @brief Writes the characteristic descriptor using its handle. The GATT_EVENT_QUERY_COMPLETE event marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @brief Writes the characteristic descriptor using its handle.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write.
* The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param descriptor_handle
@ -686,7 +771,9 @@ uint8_t gatt_client_write_long_characteristic_descriptor(btstack_packet_handler_
uint8_t gatt_client_write_long_characteristic_descriptor_using_descriptor_handle(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t descriptor_handle, uint16_t value_length, uint8_t * value);
/**
* @brief Writes the characteristic descriptor using its handle. The GATT_EVENT_QUERY_COMPLETE event marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @brief Writes the characteristic descriptor using its handle.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write.
* The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param descriptor_handle
@ -700,10 +787,12 @@ uint8_t gatt_client_write_long_characteristic_descriptor_using_descriptor_handle
uint8_t gatt_client_write_long_characteristic_descriptor_using_descriptor_handle_with_offset(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t descriptor_handle, uint16_t offset, uint16_t value_length, uint8_t * value);
/**
* @brief Writes the client characteristic configuration of the specified characteristic. It is used to subscribe for notifications or indications of the characteristic value.
* For notifications or indications specify: GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION resp. GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_INDICATION as configuration value.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write. The write is successfully performed, if the event's att_status field is set to ATT_ERROR_SUCCESS
* (see bluetooth.h for ATT_ERROR codes).
* @brief Writes the client characteristic configuration of the specified characteristic.
* It is used to subscribe for notifications or indications of the characteristic value.
* For notifications or indications specify: GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION
* resp. GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_INDICATION as configuration value.
* The GATT_EVENT_QUERY_COMPLETE event marks the end of write.
* The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes).
* @param callback
* @param con_handle
* @param characteristic
@ -718,7 +807,8 @@ uint8_t gatt_client_write_long_characteristic_descriptor_using_descriptor_handle
uint8_t gatt_client_write_client_characteristic_configuration(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic, uint16_t configuration);
/**
* @brief Register for notifications and indications of a characteristic enabled by gatt_client_write_client_characteristic_configuration
* @brief Register for notifications and indications of a characteristic enabled by
* the gatt_client_write_client_characteristic_configuration function.
* @param notification struct used to store registration
* @param callback
* @param con_handle or GATT_CLIENT_ANY_CONNECTION to receive updates from all connected devices
@ -727,13 +817,15 @@ uint8_t gatt_client_write_client_characteristic_configuration(btstack_packet_han
void gatt_client_listen_for_characteristic_value_updates(gatt_client_notification_t * notification, btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic);
/**
* @brief Stop listening to characteristic value updates registered with gatt_client_listen_for_characteristic_value_updates
* @brief Stop listening to characteristic value updates registered with
* the gatt_client_listen_for_characteristic_value_updates function.
* @param notification struct used in gatt_client_listen_for_characteristic_value_updates
*/
void gatt_client_stop_listening_for_characteristic_value_updates(gatt_client_notification_t * notification);
/**
* @brief Requests GATT_EVENT_CAN_WRITE_WITHOUT_RESPONSE that guarantees a single successful gatt_client_write_value_of_characteristic_without_response
* @brief Requests GATT_EVENT_CAN_WRITE_WITHOUT_RESPONSE that guarantees
* a single successful gatt_client_write_value_of_characteristic_without_response call.
* @param callback
* @param con_handle
* @return status
@ -741,7 +833,8 @@ void gatt_client_stop_listening_for_characteristic_value_updates(gatt_client_not
uint8_t gatt_client_request_can_write_without_response_event(btstack_packet_handler_t callback, hci_con_handle_t con_handle);
/**
* @brief Transactional write. It can be called as many times as it is needed to write the characteristics within the same transaction. Call gatt_client_execute_write to commit the transaction.
* @brief Transactional write. It can be called as many times as it is needed to write the characteristics within the same transaction.
* Call the gatt_client_execute_write function to commit the transaction.
* @param callback
* @param con_handle
* @param attribute_handle