#include "hci.h"
Data Structures | |
struct | gatt_client |
struct | gatt_client_characteristic_descriptor_t |
struct | gatt_client_characteristic_t |
struct | gatt_client_notification |
struct | gatt_client_service_t |
Typedefs | |
typedef struct gatt_client_notification | gatt_client_notification_t |
typedef struct gatt_client | gatt_client_t |
typedef struct gatt_client_notification gatt_client_notification_t |
typedef struct gatt_client gatt_client_t |
enum gatt_client_mtu_t |
enum gatt_client_state_t |
uint8_t gatt_client_cancel_write | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle | ||
) |
-> gatt complete event
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_CANCEL_PREPARED_WRITE, and provide_context_for_conn_handle_and_start_timer().
void gatt_client_deserialize_characteristic | ( | const uint8_t * | packet, |
int | offset, | ||
gatt_client_characteristic_t * | characteristic | ||
) |
References big_endian_read_32(), gatt_client_characteristic_t::end_handle, little_endian_read_16(), gatt_client_characteristic_t::properties, reverse_128(), gatt_client_characteristic_t::start_handle, gatt_client_characteristic_t::uuid128, gatt_client_characteristic_t::uuid16, uuid_has_bluetooth_prefix(), and gatt_client_characteristic_t::value_handle.
void gatt_client_deserialize_characteristic_descriptor | ( | const uint8_t * | packet, |
int | offset, | ||
gatt_client_characteristic_descriptor_t * | descriptor | ||
) |
void gatt_client_deserialize_service | ( | const uint8_t * | packet, |
int | offset, | ||
gatt_client_service_t * | service | ||
) |
uint8_t gatt_client_discover_characteristic_descriptors | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
gatt_client_characteristic_t * | characteristic | ||
) |
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.
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, emit_gatt_complete_event(), gatt_client::end_group_handle, gatt_client_characteristic_t::end_handle, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, and gatt_client_characteristic_t::value_handle.
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, | ||
uint8_t * | uuid | ||
) |
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::characteristic_start_handle, gatt_client::end_group_handle, gatt_client::filter_with_uuid, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_CHARACTERISTIC_WITH_UUID_QUERY, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, gatt_client::uuid128, and gatt_client::uuid16.
Referenced by gatt_client_discover_characteristics_for_service_by_uuid128().
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 | ||
) |
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.
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::characteristic_start_handle, gatt_client::end_group_handle, gatt_client::filter_with_uuid, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_CHARACTERISTIC_WITH_UUID_QUERY, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, gatt_client::uuid128, gatt_client::uuid16, and uuid_add_bluetooth_prefix().
Referenced by gatt_client_discover_characteristics_for_service_by_uuid16().
uint8_t gatt_client_discover_characteristics_for_service | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
gatt_client_service_t * | service | ||
) |
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.
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::characteristic_start_handle, gatt_client::end_group_handle, gatt_client_service_t::end_group_handle, gatt_client::filter_with_uuid, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_ALL_CHARACTERISTICS_OF_SERVICE_QUERY, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, and gatt_client_service_t::start_group_handle.
Referenced by handle_hci_event().
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, | ||
uint8_t * | uuid128 | ||
) |
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 | ||
) |
uint8_t gatt_client_discover_primary_services | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle | ||
) |
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.
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::end_group_handle, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_SERVICE_QUERY, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, and gatt_client::uuid16.
uint8_t gatt_client_discover_primary_services_by_uuid128 | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
const uint8_t * | uuid | ||
) |
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::end_group_handle, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_SERVICE_WITH_UUID_QUERY, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, gatt_client::uuid128, and gatt_client::uuid16.
Referenced by handle_hci_event().
uint8_t gatt_client_discover_primary_services_by_uuid16 | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
uint16_t | uuid16 | ||
) |
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.
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::end_group_handle, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_SERVICE_WITH_UUID_QUERY, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, gatt_client::uuid128, gatt_client::uuid16, and uuid_add_bluetooth_prefix().
uint8_t gatt_client_execute_write | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle | ||
) |
-> gatt complete event
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_EXECUTE_PREPARED_WRITE, and provide_context_for_conn_handle_and_start_timer().
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 | ||
) |
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.
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::end_group_handle, gatt_client_service_t::end_group_handle, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_INCLUDED_SERVICE_QUERY, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, and gatt_client_service_t::start_group_handle.
uint8_t gatt_client_get_mtu | ( | hci_con_handle_t | con_handle, |
uint16_t * | mtu | ||
) |
MTU is available after the first query has completed.
If status is equal to 0, it returns the real value, otherwise the default value of 23.
References ATT_DEFAULT_MTU, GATT_CLIENT_IN_WRONG_STATE, gatt_client::mtu, MTU_EXCHANGED, gatt_client::mtu_state, and provide_context_for_conn_handle().
void gatt_client_init | ( | void | ) |
int gatt_client_is_ready | ( | hci_con_handle_t | con_handle | ) |
Returns if the GATT client is ready to receive a query.
It is used with daemon.
References is_ready(), and provide_context_for_conn_handle().
void gatt_client_listen_for_characteristic_value_updates | ( | gatt_client_notification_t * | notification, |
btstack_packet_handler_t | packet_handler, | ||
hci_con_handle_t | con_handle, | ||
gatt_client_characteristic_t * | characteristic | ||
) |
Register for notifications and indications of a characteristic enabled by gatt_client_write_client_characteristic_configuration.
notification | struct used to store registration |
packet_handler | |
con_handle | |
characteristic |
References gatt_client_notification::attribute_handle, btstack_linked_list_add(), gatt_client_notification::callback, con_handle, gatt_client_notification::con_handle, packet_handler, and gatt_client_characteristic_t::value_handle.
Referenced by handle_hci_event().
uint8_t gatt_client_prepare_write | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
uint16_t | attribute_handle, | ||
uint16_t | offset, | ||
uint16_t | length, | ||
uint8_t * | data | ||
) |
-> gatt complete event
References gatt_client::attribute_handle, gatt_client::attribute_length, gatt_client::attribute_offset, gatt_client::attribute_value, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_PREPARE_WRITE_SINGLE, and provide_context_for_conn_handle_and_start_timer().
void gatt_client_pts_suppress_mtu_exchange | ( | void | ) |
References pts_suppress_mtu_exchange.
uint8_t gatt_client_read_characteristic_descriptor | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
gatt_client_characteristic_descriptor_t * | descriptor | ||
) |
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.
References gatt_client_read_characteristic_descriptor_using_descriptor_handle(), and gatt_client_characteristic_descriptor_t::handle.
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 | ||
) |
References gatt_client::attribute_handle, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_READ_CHARACTERISTIC_DESCRIPTOR_QUERY, and provide_context_for_conn_handle_and_start_timer().
Referenced by gatt_client_read_characteristic_descriptor().
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 | ||
) |
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.
References gatt_client_read_long_characteristic_descriptor_using_descriptor_handle(), and gatt_client_characteristic_descriptor_t::handle.
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 | ||
) |
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 | ||
) |
References gatt_client::attribute_handle, gatt_client::attribute_offset, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_READ_BLOB_CHARACTERISTIC_DESCRIPTOR_QUERY, and provide_context_for_conn_handle_and_start_timer().
Referenced by gatt_client_read_long_characteristic_descriptor_using_descriptor_handle().
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 | ||
) |
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_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.
References gatt_client_read_long_value_of_characteristic_using_value_handle(), and gatt_client_characteristic_t::value_handle.
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 | characteristic_value_handle | ||
) |
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 | characteristic_value_handle, | ||
uint16_t | offset | ||
) |
References gatt_client::attribute_handle, gatt_client::attribute_offset, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_READ_BLOB_QUERY, and provide_context_for_conn_handle_and_start_timer().
Referenced by gatt_client_read_long_value_of_characteristic_using_value_handle().
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 | ||
) |
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_READ_MULTIPLE_REQUEST, provide_context_for_conn_handle_and_start_timer(), gatt_client::read_multiple_handle_count, and gatt_client::read_multiple_handles.
uint8_t gatt_client_read_value_of_characteristic | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
gatt_client_characteristic_t * | characteristic | ||
) |
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.
References gatt_client_read_value_of_characteristic_using_value_handle(), and gatt_client_characteristic_t::value_handle.
uint8_t gatt_client_read_value_of_characteristic_using_value_handle | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
uint16_t | characteristic_value_handle | ||
) |
References gatt_client::attribute_handle, gatt_client::attribute_offset, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_READ_CHARACTERISTIC_VALUE_QUERY, and provide_context_for_conn_handle_and_start_timer().
Referenced by gatt_client_read_value_of_characteristic().
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, | ||
uint8_t * | uuid128 | ||
) |
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::end_group_handle, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_READ_BY_TYPE_REQUEST, provide_context_for_conn_handle_and_start_timer(), gatt_client::query_end_handle, gatt_client::query_start_handle, gatt_client::start_group_handle, gatt_client::uuid128, and gatt_client::uuid16.
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 | ||
) |
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.
References BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::end_group_handle, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_READ_BY_TYPE_REQUEST, provide_context_for_conn_handle_and_start_timer(), gatt_client::query_end_handle, gatt_client::query_start_handle, gatt_client::start_group_handle, gatt_client::uuid128, gatt_client::uuid16, and uuid_add_bluetooth_prefix().
uint8_t gatt_client_reliable_write_long_value_of_characteristic | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
uint16_t | characteristic_value_handle, | ||
uint16_t | length, | ||
uint8_t * | data | ||
) |
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 status field is set to 0.
References gatt_client::attribute_handle, gatt_client::attribute_length, gatt_client::attribute_offset, gatt_client::attribute_value, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_PREPARE_RELIABLE_WRITE, and provide_context_for_conn_handle_and_start_timer().
uint8_t gatt_client_signed_write_without_response | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
uint16_t | handle, | ||
uint16_t | message_len, | ||
uint8_t * | message | ||
) |
Writes the authenticated characteristic value using the characteristic's value handle without an acknowledgment that the write was successfully performed.
void gatt_client_stop_listening_for_characteristic_value_updates | ( | gatt_client_notification_t * | notification | ) |
Stop listening to characteristic value updates registered with gatt_client_listen_for_characteristic_value_updates.
notification | struct used in gatt_client_listen_for_characteristic_value_updates |
References btstack_linked_list_remove().
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 | length, | ||
uint8_t * | data | ||
) |
Writes the characteristic descriptor using its handle.
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 status field is set to 0.
References gatt_client_write_characteristic_descriptor_using_descriptor_handle(), and gatt_client_characteristic_descriptor_t::handle.
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 | length, | ||
uint8_t * | data | ||
) |
References gatt_client::attribute_handle, gatt_client::attribute_length, gatt_client::attribute_offset, gatt_client::attribute_value, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_WRITE_CHARACTERISTIC_DESCRIPTOR, and provide_context_for_conn_handle_and_start_timer().
Referenced by gatt_client_write_characteristic_descriptor().
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 | ||
) |
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.
References ATT_PROPERTY_INDICATE, ATT_PROPERTY_NOTIFY, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, gatt_client::client_characteristic_configuration_value, gatt_client::end_group_handle, gatt_client_characteristic_t::end_handle, GATT_CLIENT_CHARACTERISTIC_INDICATION_NOT_SUPPORTED, GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_INDICATION, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), little_endian_store_16(), log_info, P_W2_SEND_READ_CLIENT_CHARACTERISTIC_CONFIGURATION_QUERY, gatt_client_characteristic_t::properties, provide_context_for_conn_handle_and_start_timer(), gatt_client::start_group_handle, and gatt_client_characteristic_t::value_handle.
Referenced by handle_hci_event().
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 | length, | ||
uint8_t * | data | ||
) |
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 | length, | ||
uint8_t * | data | ||
) |
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 | length, | ||
uint8_t * | data | ||
) |
References gatt_client::attribute_handle, gatt_client::attribute_length, gatt_client::attribute_offset, gatt_client::attribute_value, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_PREPARE_WRITE_CHARACTERISTIC_DESCRIPTOR, and provide_context_for_conn_handle_and_start_timer().
Referenced by gatt_client_write_long_characteristic_descriptor_using_descriptor_handle().
uint8_t gatt_client_write_long_value_of_characteristic | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
uint16_t | characteristic_value_handle, | ||
uint16_t | length, | ||
uint8_t * | data | ||
) |
uint8_t gatt_client_write_long_value_of_characteristic_with_offset | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
uint16_t | characteristic_value_handle, | ||
uint16_t | offset, | ||
uint16_t | length, | ||
uint8_t * | data | ||
) |
References gatt_client::attribute_handle, gatt_client::attribute_length, gatt_client::attribute_offset, gatt_client::attribute_value, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_PREPARE_WRITE, and provide_context_for_conn_handle_and_start_timer().
Referenced by gatt_client_write_long_value_of_characteristic().
uint8_t gatt_client_write_value_of_characteristic | ( | btstack_packet_handler_t | callback, |
hci_con_handle_t | con_handle, | ||
uint16_t | characteristic_value_handle, | ||
uint16_t | length, | ||
uint8_t * | data | ||
) |
Writes the characteristic value using the characteristic's value handle.
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 status field is set to 0.
References gatt_client::attribute_handle, gatt_client::attribute_length, gatt_client::attribute_value, BTSTACK_MEMORY_ALLOC_FAILED, callback, gatt_client::callback, GATT_CLIENT_IN_WRONG_STATE, gatt_client_run(), gatt_client::gatt_client_state, is_ready(), P_W2_SEND_WRITE_CHARACTERISTIC_VALUE, and provide_context_for_conn_handle_and_start_timer().
Referenced by handle_hci_event().
uint8_t gatt_client_write_value_of_characteristic_without_response | ( | hci_con_handle_t | con_handle, |
uint16_t | characteristic_value_handle, | ||
uint16_t | length, | ||
uint8_t * | data | ||
) |
Writes the characteristic value using the characteristic's value handle without an acknowledgment that the write was successfully performed.
References att_dispatch_client_can_send_now(), ATT_WRITE_COMMAND, att_write_request(), BTSTACK_MEMORY_ALLOC_FAILED, gatt_client::con_handle, GATT_CLIENT_BUSY, GATT_CLIENT_IN_WRONG_STATE, GATT_CLIENT_VALUE_TOO_LONG, is_ready(), peripheral_mtu(), and provide_context_for_conn_handle().