#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack_config.h"
#include "att_dispatch.h"
#include "ad_parser.h"
#include "ble/att_db.h"
#include "ble/core.h"
#include "ble/gatt_client.h"
#include "ble/le_device_db.h"
#include "ble/sm.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "btstack_memory.h"
#include "btstack_run_loop.h"
#include "btstack_util.h"
#include "classic/sdp_util.h"
#include "hci.h"
#include "hci_cmd.h"
#include "hci_dump.h"
#include "l2cap.h"
Macros | |
#define | __BTSTACK_FILE__ "gatt_client.c" |
Functions | |
static void | att_confirmation (uint16_t peripheral_handle) |
static void | att_exchange_mtu_request (uint16_t peripheral_handle) |
static void | att_execute_write_request (uint16_t request_type, uint16_t peripheral_handle, uint8_t execute_write) |
static void | att_find_by_type_value_request (uint16_t request_type, uint16_t attribute_group_type, uint16_t peripheral_handle, uint16_t start_handle, uint16_t end_handle, uint8_t *value, uint16_t value_size) |
static void | att_find_information_request (uint16_t request_type, uint16_t peripheral_handle, uint16_t start_handle, uint16_t end_handle) |
static void | att_prepare_write_request (uint16_t request_type, uint16_t peripheral_handle, uint16_t attribute_handle, uint16_t value_offset, uint16_t blob_length, uint8_t *value) |
static void | att_read_blob_request (uint16_t request_type, uint16_t peripheral_handle, uint16_t attribute_handle, uint16_t value_offset) |
static void | att_read_by_type_or_group_request_for_uuid128 (uint16_t request_type, uint8_t *uuid128, uint16_t peripheral_handle, uint16_t start_handle, uint16_t end_handle) |
static void | att_read_by_type_or_group_request_for_uuid16 (uint16_t request_type, uint16_t uuid16, uint16_t peripheral_handle, uint16_t start_handle, uint16_t end_handle) |
static void | att_read_multiple_request (uint16_t peripheral_handle, uint16_t num_value_handles, uint16_t *value_handles) |
static void | att_read_request (uint16_t request_type, uint16_t peripheral_handle, uint16_t attribute_handle) |
static void | att_write_request (uint16_t request_type, uint16_t peripheral_handle, uint16_t attribute_handle, uint16_t value_length, uint8_t *value) |
static void | characteristic_end_found (gatt_client_t *peripheral, uint16_t end_handle) |
static void | characteristic_start_found (gatt_client_t *peripheral, uint16_t start_handle, uint8_t properties, uint16_t value_handle, uint8_t *uuid, uint16_t uuid_length) |
static void | emit_event_new (btstack_packet_handler_t callback, uint8_t *packet, uint16_t size) |
static void | emit_event_to_registered_listeners (hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t *packet, uint16_t size) |
static void | emit_gatt_all_characteristic_descriptors_result_event (gatt_client_t *peripheral, uint16_t descriptor_handle, uint8_t *uuid128) |
static void | emit_gatt_characteristic_query_result_event (gatt_client_t *peripheral, uint16_t start_handle, uint16_t value_handle, uint16_t end_handle, uint16_t properties, uint8_t *uuid128) |
static void | emit_gatt_complete_event (gatt_client_t *peripheral, uint8_t status) |
static void | emit_gatt_included_service_query_result_event (gatt_client_t *peripheral, uint16_t include_handle, uint16_t start_group_handle, uint16_t end_group_handle, uint8_t *uuid128) |
static void | emit_gatt_service_query_result_event (gatt_client_t *peripheral, uint16_t start_group_handle, uint16_t end_group_handle, uint8_t *uuid128) |
static void | gatt_client_att_packet_handler (uint8_t packet_type, uint16_t handle, uint8_t *packet, uint16_t size) |
uint8_t | gatt_client_cancel_write (btstack_packet_handler_t callback, hci_con_handle_t con_handle) |
-> gatt complete event More... | |
void | gatt_client_deserialize_characteristic (const uint8_t *packet, int offset, gatt_client_characteristic_t *characteristic) |
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. More... | |
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 *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. More... | |
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. More... | |
uint8_t | gatt_client_discover_characteristics_for_service_by_uuid128 (btstack_packet_handler_t callback, uint16_t handle, gatt_client_service_t *service, uint8_t *uuid128) |
uint8_t | gatt_client_discover_characteristics_for_service_by_uuid16 (btstack_packet_handler_t callback, uint16_t 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. More... | |
uint8_t | gatt_client_discover_primary_services_by_uuid128 (btstack_packet_handler_t callback, hci_con_handle_t con_handle, const uint8_t *uuid128) |
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. More... | |
uint8_t | gatt_client_execute_write (btstack_packet_handler_t callback, hci_con_handle_t con_handle) |
-> gatt complete event More... | |
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. More... | |
static gatt_client_t * | gatt_client_for_timer (btstack_timer_source_t *ts) |
uint8_t | gatt_client_get_mtu (hci_con_handle_t con_handle, uint16_t *mtu) |
MTU is available after the first query has completed. More... | |
static void | gatt_client_handle_transaction_complete (gatt_client_t *peripheral) |
static void | gatt_client_hci_event_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) |
void | gatt_client_init (void) |
Set up GATT client. More... | |
int | gatt_client_is_ready (hci_con_handle_t con_handle) |
Returns if the GATT client is ready to receive a query. More... | |
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. More... | |
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 More... | |
void | gatt_client_pts_suppress_mtu_exchange (void) |
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. More... | |
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) |
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. More... | |
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) |
uint8_t | gatt_client_read_long_value_of_characteristic (btstack_packet_handler_t callback, uint16_t handle, gatt_client_characteristic_t *characteristic) |
Reads the long characteristic value using the characteristic's value handle. More... | |
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) |
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) |
uint8_t | gatt_client_read_value_of_characteristic (btstack_packet_handler_t callback, uint16_t handle, gatt_client_characteristic_t *characteristic) |
Reads the characteristic value using the characteristic's value handle. More... | |
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) |
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) |
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. More... | |
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) |
Writes of the long characteristic value using the characteristic's value handle. More... | |
static void | gatt_client_report_error_if_pending (gatt_client_t *peripheral, uint8_t error_code) |
static void | gatt_client_run (void) |
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. More... | |
static void | gatt_client_timeout_handler (btstack_timer_source_t *timer) |
static void | gatt_client_timeout_start (gatt_client_t *peripheral) |
static void | gatt_client_timeout_stop (gatt_client_t *peripheral) |
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 *value) |
Writes the characteristic descriptor using its handle. More... | |
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) |
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. More... | |
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 *value) |
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) |
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) |
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 *data) |
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 *data) |
Writes the characteristic value using the characteristic's value handle. More... | |
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) |
Writes the characteristic value using the characteristic's value handle without an acknowledgment that the write was successfully performed. More... | |
static gatt_client_t * | get_gatt_client_context_for_handle (uint16_t handle) |
static uint16_t | get_last_result_handle_from_characteristics_list (uint8_t *packet, uint16_t size) |
static uint16_t | get_last_result_handle_from_included_services_list (uint8_t *packet, uint16_t size) |
static uint16_t | get_last_result_handle_from_service_list (uint8_t *packet, uint16_t size) |
static int | is_query_done (gatt_client_t *peripheral, uint16_t last_result_handle) |
static int | is_ready (gatt_client_t *context) |
static int | is_value_valid (gatt_client_t *peripheral, uint8_t *packet, uint16_t size) |
static uint16_t | peripheral_mtu (gatt_client_t *peripheral) |
static gatt_client_t * | provide_context_for_conn_handle (hci_con_handle_t con_handle) |
static gatt_client_t * | provide_context_for_conn_handle_and_start_timer (hci_con_handle_t con_handle) |
static void | report_gatt_all_characteristic_descriptors (gatt_client_t *peripheral, uint8_t *packet, uint16_t size, uint16_t pair_size) |
static void | report_gatt_characteristic_descriptor (gatt_client_t *peripheral, uint16_t descriptor_handle, uint8_t *value, uint16_t value_length, uint16_t value_offset) |
static void | report_gatt_characteristic_value (gatt_client_t *peripheral, uint16_t attribute_handle, uint8_t *value, uint16_t length) |
static void | report_gatt_characteristics (gatt_client_t *peripheral, uint8_t *packet, uint16_t size) |
static void | report_gatt_included_service_uuid128 (gatt_client_t *peripheral, uint16_t include_handle, uint8_t *uuid128) |
static void | report_gatt_included_service_uuid16 (gatt_client_t *peripheral, uint16_t include_handle, uint16_t uuid16) |
static void | report_gatt_indication (hci_con_handle_t con_handle, uint16_t value_handle, uint8_t *value, int length) |
static void | report_gatt_long_characteristic_descriptor (gatt_client_t *peripheral, uint16_t descriptor_handle, uint8_t *blob, uint16_t blob_length, uint16_t value_offset) |
static void | report_gatt_long_characteristic_value_blob (gatt_client_t *peripheral, uint16_t attribute_handle, uint8_t *blob, uint16_t blob_length, int value_offset) |
static void | report_gatt_notification (hci_con_handle_t con_handle, uint16_t value_handle, uint8_t *value, int length) |
static void | report_gatt_services (gatt_client_t *peripheral, uint8_t *packet, uint16_t size) |
static void | send_gatt_by_uuid_request (gatt_client_t *peripheral, uint16_t attribute_group_type) |
static void | send_gatt_cancel_prepared_write_request (gatt_client_t *peripheral) |
static void | send_gatt_characteristic_descriptor_request (gatt_client_t *peripheral) |
static void | send_gatt_characteristic_request (gatt_client_t *peripheral) |
static void | send_gatt_execute_write_request (gatt_client_t *peripheral) |
static void | send_gatt_included_service_request (gatt_client_t *peripheral) |
static void | send_gatt_included_service_uuid_request (gatt_client_t *peripheral) |
static void | send_gatt_prepare_write_request (gatt_client_t *peripheral) |
static void | send_gatt_read_blob_request (gatt_client_t *peripheral) |
static void | send_gatt_read_by_type_request (gatt_client_t *peripheral) |
static void | send_gatt_read_characteristic_descriptor_request (gatt_client_t *peripheral) |
static void | send_gatt_read_characteristic_value_request (gatt_client_t *peripheral) |
static void | send_gatt_read_client_characteristic_configuration_request (gatt_client_t *peripheral) |
static void | send_gatt_read_multiple_request (gatt_client_t *peripheral) |
static void | send_gatt_services_by_uuid_request (gatt_client_t *peripheral) |
static void | send_gatt_services_request (gatt_client_t *peripheral) |
static void | send_gatt_write_attribute_value_request (gatt_client_t *peripheral) |
static void | send_gatt_write_client_characteristic_configuration_request (gatt_client_t *peripheral) |
static uint8_t * | setup_characteristic_value_packet (uint8_t type, hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t *value, uint16_t length) |
static uint8_t * | setup_long_characteristic_value_packet (uint8_t type, hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t *value, uint16_t length) |
static void | trigger_next_blob_query (gatt_client_t *peripheral, gatt_client_state_t next_query_state, uint16_t received_blob_length) |
static void | trigger_next_characteristic_descriptor_query (gatt_client_t *peripheral, uint16_t last_result_handle) |
static void | trigger_next_characteristic_query (gatt_client_t *peripheral, uint16_t last_result_handle) |
static void | trigger_next_included_service_query (gatt_client_t *peripheral, uint16_t last_result_handle) |
static void | trigger_next_prepare_write_query (gatt_client_t *peripheral, gatt_client_state_t next_query_state, gatt_client_state_t done_state) |
static void | trigger_next_query (gatt_client_t *peripheral, uint16_t last_result_handle, gatt_client_state_t next_query_state) |
static void | trigger_next_read_by_type_query (gatt_client_t *peripheral, uint16_t last_result_handle) |
static void | trigger_next_service_by_uuid_query (gatt_client_t *peripheral, uint16_t last_result_handle) |
static void | trigger_next_service_query (gatt_client_t *peripheral, uint16_t last_result_handle) |
static uint16_t | write_blob_length (gatt_client_t *peripheral) |
Variables | |
static const int | characteristic_value_event_header_size = 8 |
static btstack_linked_list_t | gatt_client_connections |
static btstack_linked_list_t | gatt_client_value_listeners |
static btstack_packet_callback_registration_t | hci_event_callback_registration |
static const int | long_characteristic_value_event_header_size = 10 |
static uint8_t | pts_suppress_mtu_exchange |
#define __BTSTACK_FILE__ "gatt_client.c" |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
References L2CAP_CID_ATTRIBUTE_PROTOCOL, l2cap_get_outgoing_buffer(), l2cap_reserve_packet_buffer(), l2cap_send_prepared_connectionless(), and little_endian_store_16().
Referenced by send_gatt_characteristic_request(), send_gatt_included_service_request(), send_gatt_read_by_type_request(), send_gatt_read_client_characteristic_configuration_request(), and send_gatt_services_request().
|
static |
|
static |
References L2CAP_CID_ATTRIBUTE_PROTOCOL, l2cap_get_outgoing_buffer(), l2cap_reserve_packet_buffer(), l2cap_send_prepared_connectionless(), and little_endian_store_16().
Referenced by send_gatt_included_service_uuid_request(), send_gatt_read_characteristic_descriptor_request(), and send_gatt_read_characteristic_value_request().
|
static |
References L2CAP_CID_ATTRIBUTE_PROTOCOL, l2cap_get_outgoing_buffer(), l2cap_reserve_packet_buffer(), l2cap_send_prepared_connectionless(), and little_endian_store_16().
Referenced by gatt_client_write_value_of_characteristic_without_response(), send_gatt_write_attribute_value_request(), and send_gatt_write_client_characteristic_configuration_request().
|
static |
References gatt_client::attribute_handle, gatt_client::characteristic_properties, gatt_client::characteristic_start_handle, emit_gatt_characteristic_query_result_event(), and gatt_client::uuid128.
Referenced by gatt_client_att_packet_handler(), report_gatt_characteristics(), and trigger_next_characteristic_query().
|
static |
References gatt_client::attribute_handle, gatt_client::characteristic_properties, gatt_client::characteristic_start_handle, gatt_client::filter_with_uuid, little_endian_read_16(), reverse_128(), gatt_client::uuid128, gatt_client::uuid16, and uuid_add_bluetooth_prefix().
Referenced by report_gatt_characteristics().
|
static |
References hci_dump_packet(), and HCI_EVENT_PACKET.
Referenced by emit_gatt_all_characteristic_descriptors_result_event(), emit_gatt_characteristic_query_result_event(), emit_gatt_complete_event(), emit_gatt_included_service_query_result_event(), emit_gatt_service_query_result_event(), report_gatt_characteristic_descriptor(), report_gatt_characteristic_value(), report_gatt_long_characteristic_descriptor(), and report_gatt_long_characteristic_value_blob().
|
static |
References gatt_client_notification::attribute_handle, btstack_linked_list_iterator_has_next(), btstack_linked_list_iterator_init(), btstack_linked_list_iterator_next(), gatt_client_notification::callback, gatt_client_notification::con_handle, and HCI_EVENT_PACKET.
Referenced by report_gatt_indication(), and report_gatt_notification().
|
static |
|
static |
References gatt_client::callback, gatt_client::con_handle, emit_event_new(), GATT_EVENT_CHARACTERISTIC_QUERY_RESULT, little_endian_store_16(), and reverse_128().
Referenced by characteristic_end_found().
|
static |
References gatt_client::callback, gatt_client::con_handle, emit_event_new(), GATT_EVENT_QUERY_COMPLETE, little_endian_store_16(), and status.
Referenced by gatt_client_att_packet_handler(), gatt_client_discover_characteristic_descriptors(), gatt_client_report_error_if_pending(), gatt_client_run(), trigger_next_blob_query(), and trigger_next_query().
|
static |
|
static |
References gatt_client::callback, gatt_client::con_handle, emit_event_new(), GATT_EVENT_SERVICE_QUERY_RESULT, little_endian_store_16(), and reverse_128().
Referenced by gatt_client_att_packet_handler(), and report_gatt_services().
|
static |
References ATT_DATA_PACKET, ATT_ERROR_ATTRIBUTE_NOT_FOUND, ATT_ERROR_DATA_MISMATCH, ATT_ERROR_RESPONSE, ATT_EXCHANGE_MTU_RESPONSE, ATT_EXECUTE_WRITE_RESPONSE, ATT_FIND_BY_TYPE_VALUE_RESPONSE, ATT_FIND_INFORMATION_REPLY, ATT_HANDLE_VALUE_INDICATION, ATT_HANDLE_VALUE_NOTIFICATION, ATT_PREPARE_WRITE_RESPONSE, ATT_READ_BLOB_RESPONSE, ATT_READ_BY_GROUP_TYPE_RESPONSE, ATT_READ_BY_TYPE_RESPONSE, ATT_READ_MULTIPLE_RESPONSE, ATT_READ_RESPONSE, ATT_WRITE_RESPONSE, gatt_client::attribute_handle, gatt_client::attribute_offset, characteristic_end_found(), gatt_client::client_characteristic_configuration_handle, emit_gatt_complete_event(), emit_gatt_service_query_result_event(), gatt_client::end_group_handle, gatt_client_handle_transaction_complete(), gatt_client_report_error_if_pending(), gatt_client_run(), gatt_client::gatt_client_state, get_gatt_client_context_for_handle(), get_last_result_handle_from_characteristics_list(), get_last_result_handle_from_included_services_list(), get_last_result_handle_from_service_list(), HCI_EVENT_PACKET, is_value_valid(), L2CAP_EVENT_CAN_SEND_NOW, l2cap_max_le_mtu(), little_endian_read_16(), log_info, gatt_client::mtu, MTU_EXCHANGED, gatt_client::mtu_state, P_W2_CANCEL_PREPARED_WRITE_DATA_MISMATCH, P_W2_EXECUTE_PREPARED_WRITE, P_W2_EXECUTE_PREPARED_WRITE_CHARACTERISTIC_DESCRIPTOR, P_W2_PREPARE_RELIABLE_WRITE, P_W2_PREPARE_WRITE, P_W2_PREPARE_WRITE_CHARACTERISTIC_DESCRIPTOR, P_W2_SEND_INCLUDED_SERVICE_WITH_UUID_QUERY, P_W2_SEND_READ_BLOB_CHARACTERISTIC_DESCRIPTOR_QUERY, P_W2_SEND_READ_BLOB_QUERY, P_W2_WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION, P_W4_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT, P_W4_ALL_CHARACTERISTICS_OF_SERVICE_QUERY_RESULT, P_W4_CANCEL_PREPARED_WRITE_DATA_MISMATCH_RESULT, P_W4_CANCEL_PREPARED_WRITE_RESULT, P_W4_CHARACTERISTIC_WITH_UUID_QUERY_RESULT, P_W4_CLIENT_CHARACTERISTIC_CONFIGURATION_RESULT, P_W4_EXECUTE_PREPARED_WRITE_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_EXECUTE_PREPARED_WRITE_RESULT, P_W4_INCLUDED_SERVICE_QUERY_RESULT, P_W4_INCLUDED_SERVICE_UUID_WITH_QUERY_RESULT, P_W4_PREPARE_RELIABLE_WRITE_RESULT, P_W4_PREPARE_WRITE_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_PREPARE_WRITE_RESULT, P_W4_PREPARE_WRITE_SINGLE_RESULT, P_W4_READ_BLOB_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_READ_BLOB_RESULT, P_W4_READ_BY_TYPE_RESPONSE, P_W4_READ_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_READ_CHARACTERISTIC_VALUE_RESULT, P_W4_READ_CLIENT_CHARACTERISTIC_CONFIGURATION_QUERY_RESULT, P_W4_READ_MULTIPLE_RESPONSE, P_W4_SERVICE_QUERY_RESULT, P_W4_SERVICE_WITH_UUID_RESULT, P_W4_WRITE_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_WRITE_CHARACTERISTIC_VALUE_RESULT, provide_context_for_conn_handle(), gatt_client::query_end_handle, gatt_client::query_start_handle, report_gatt_all_characteristic_descriptors(), report_gatt_characteristic_descriptor(), report_gatt_characteristic_value(), report_gatt_characteristics(), report_gatt_included_service_uuid128(), report_gatt_included_service_uuid16(), report_gatt_indication(), report_gatt_long_characteristic_descriptor(), report_gatt_long_characteristic_value_blob(), report_gatt_notification(), report_gatt_services(), reverse_128(), gatt_client::send_confirmation, gatt_client::start_group_handle, trigger_next_blob_query(), trigger_next_characteristic_descriptor_query(), trigger_next_characteristic_query(), trigger_next_included_service_query(), trigger_next_prepare_write_query(), trigger_next_read_by_type_query(), trigger_next_service_by_uuid_query(), trigger_next_service_query(), and gatt_client::uuid128.
Referenced by gatt_client_init().
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 * | uuid128 | ||
) |
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, |
uint16_t | handle, | ||
gatt_client_service_t * | service, | ||
uint8_t * | uuid128 | ||
) |
uint8_t gatt_client_discover_characteristics_for_service_by_uuid16 | ( | btstack_packet_handler_t | callback, |
uint16_t | 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 * | 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_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.
|
static |
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().
|
static |
|
static |
References ATT_ERROR_HCI_DISCONNECT_RECEIVED, btstack_linked_list_remove(), con_handle, gatt_client_report_error_if_pending(), gatt_client_run(), get_gatt_client_context_for_handle(), HCI_EVENT_DISCONNECTION_COMPLETE, HCI_EVENT_PACKET, hci_event_packet_get_type(), little_endian_read_16(), log_info, and UNUSED.
Referenced by gatt_client_init().
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 | 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().
|
static |
References emit_gatt_complete_event(), gatt_client_handle_transaction_complete(), and is_ready().
Referenced by gatt_client_att_packet_handler(), gatt_client_hci_event_packet_handler(), and gatt_client_timeout_handler().
|
static |
References att_confirmation(), att_dispatch_client_can_send_now(), att_dispatch_client_request_can_send_now_event(), ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LENGTH, att_exchange_mtu_request(), ATT_SIGNED_WRITE_COMMAND, gatt_client::attribute_handle, gatt_client::attribute_length, gatt_client::attribute_value, gatt_client::con_handle, emit_gatt_complete_event(), gatt_client_handle_transaction_complete(), gatt_client::gatt_client_state, gatt_client::le_device_index, log_error, gatt_client::mtu_state, btstack_linked_item::next, P_READY, P_W2_CANCEL_PREPARED_WRITE, P_W2_CANCEL_PREPARED_WRITE_DATA_MISMATCH, P_W2_EXECUTE_PREPARED_WRITE, P_W2_EXECUTE_PREPARED_WRITE_CHARACTERISTIC_DESCRIPTOR, P_W2_PREPARE_RELIABLE_WRITE, P_W2_PREPARE_WRITE, P_W2_PREPARE_WRITE_CHARACTERISTIC_DESCRIPTOR, P_W2_PREPARE_WRITE_SINGLE, P_W2_SEND_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY, P_W2_SEND_ALL_CHARACTERISTICS_OF_SERVICE_QUERY, P_W2_SEND_CHARACTERISTIC_WITH_UUID_QUERY, P_W2_SEND_INCLUDED_SERVICE_QUERY, P_W2_SEND_INCLUDED_SERVICE_WITH_UUID_QUERY, P_W2_SEND_READ_BLOB_CHARACTERISTIC_DESCRIPTOR_QUERY, P_W2_SEND_READ_BLOB_QUERY, P_W2_SEND_READ_BY_TYPE_REQUEST, P_W2_SEND_READ_CHARACTERISTIC_DESCRIPTOR_QUERY, P_W2_SEND_READ_CHARACTERISTIC_VALUE_QUERY, P_W2_SEND_READ_CLIENT_CHARACTERISTIC_CONFIGURATION_QUERY, P_W2_SEND_READ_MULTIPLE_REQUEST, P_W2_SEND_SERVICE_QUERY, P_W2_SEND_SERVICE_WITH_UUID_QUERY, P_W2_SEND_SIGNED_WRITE, P_W2_SEND_WRITE_CHARACTERISTIC_DESCRIPTOR, P_W2_SEND_WRITE_CHARACTERISTIC_VALUE, P_W2_WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION, P_W4_ALL_CHARACTERISTICS_OF_SERVICE_QUERY_RESULT, P_W4_CANCEL_PREPARED_WRITE_DATA_MISMATCH_RESULT, P_W4_CANCEL_PREPARED_WRITE_RESULT, P_W4_CHARACTERISTIC_WITH_UUID_QUERY_RESULT, P_W4_CLIENT_CHARACTERISTIC_CONFIGURATION_RESULT, P_W4_CMAC_READY, P_W4_CMAC_RESULT, P_W4_EXECUTE_PREPARED_WRITE_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_EXECUTE_PREPARED_WRITE_RESULT, P_W4_INCLUDED_SERVICE_QUERY_RESULT, P_W4_INCLUDED_SERVICE_UUID_WITH_QUERY_RESULT, P_W4_PREPARE_RELIABLE_WRITE_RESULT, P_W4_PREPARE_WRITE_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_PREPARE_WRITE_RESULT, P_W4_PREPARE_WRITE_SINGLE_RESULT, P_W4_READ_BLOB_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_READ_BLOB_RESULT, P_W4_READ_BY_TYPE_RESPONSE, P_W4_READ_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_READ_CHARACTERISTIC_VALUE_RESULT, P_W4_READ_CLIENT_CHARACTERISTIC_CONFIGURATION_QUERY_RESULT, P_W4_READ_MULTIPLE_RESPONSE, P_W4_SEND_SINGED_WRITE_DONE, P_W4_SERVICE_QUERY_RESULT, P_W4_SERVICE_WITH_UUID_RESULT, P_W4_WRITE_CHARACTERISTIC_DESCRIPTOR_RESULT, P_W4_WRITE_CHARACTERISTIC_VALUE_RESULT, peripheral_mtu(), gatt_client::send_confirmation, send_gatt_cancel_prepared_write_request(), send_gatt_characteristic_descriptor_request(), send_gatt_characteristic_request(), send_gatt_execute_write_request(), send_gatt_included_service_request(), send_gatt_included_service_uuid_request(), send_gatt_prepare_write_request(), send_gatt_read_blob_request(), send_gatt_read_by_type_request(), send_gatt_read_characteristic_descriptor_request(), send_gatt_read_characteristic_value_request(), send_gatt_read_client_characteristic_configuration_request(), send_gatt_read_multiple_request(), send_gatt_services_by_uuid_request(), send_gatt_services_request(), send_gatt_write_attribute_value_request(), send_gatt_write_client_characteristic_configuration_request(), SEND_MTU_EXCHANGE, SENT_MTU_EXCHANGE, sm_cmac_ready(), and sm_cmac_signed_write_start().
Referenced by gatt_client_att_packet_handler(), gatt_client_cancel_write(), gatt_client_discover_characteristic_descriptors(), gatt_client_discover_characteristics_for_handle_range_by_uuid128(), gatt_client_discover_characteristics_for_handle_range_by_uuid16(), gatt_client_discover_characteristics_for_service(), gatt_client_discover_primary_services(), gatt_client_discover_primary_services_by_uuid128(), gatt_client_discover_primary_services_by_uuid16(), gatt_client_execute_write(), gatt_client_find_included_services_for_service(), gatt_client_hci_event_packet_handler(), gatt_client_prepare_write(), gatt_client_read_characteristic_descriptor_using_descriptor_handle(), gatt_client_read_long_characteristic_descriptor_using_descriptor_handle_with_offset(), gatt_client_read_long_value_of_characteristic_using_value_handle_with_offset(), gatt_client_read_multiple_characteristic_values(), gatt_client_read_value_of_characteristic_using_value_handle(), gatt_client_read_value_of_characteristics_by_uuid128(), gatt_client_read_value_of_characteristics_by_uuid16(), gatt_client_reliable_write_long_value_of_characteristic(), gatt_client_write_characteristic_descriptor_using_descriptor_handle(), gatt_client_write_client_characteristic_configuration(), gatt_client_write_long_characteristic_descriptor_using_descriptor_handle_with_offset(), gatt_client_write_long_value_of_characteristic_with_offset(), and gatt_client_write_value_of_characteristic().
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().
|
static |
References ATT_ERROR_TIMEOUT, gatt_client::con_handle, gatt_client_for_timer(), gatt_client_report_error_if_pending(), and log_info.
Referenced by gatt_client_timeout_start().
|
static |
References btstack_run_loop_add_timer(), btstack_run_loop_remove_timer(), btstack_run_loop_set_timer(), btstack_run_loop_set_timer_handler(), gatt_client::con_handle, gatt_client_timeout_handler(), gatt_client::gc_timeout, and log_info.
Referenced by provide_context_for_conn_handle_and_start_timer().
|
static |
References btstack_run_loop_remove_timer(), gatt_client::con_handle, gatt_client::gc_timeout, and log_info.
Referenced by gatt_client_handle_transaction_complete().
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 * | value | ||
) |
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 | value_handle, | ||
uint16_t | value_length, | ||
uint8_t * | value | ||
) |
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 * | 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 | value_handle, | ||
uint16_t | value_length, | ||
uint8_t * | value | ||
) |
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().
|
static |
References gatt_client::con_handle, btstack_linked_item::next, and NULL.
Referenced by gatt_client_att_packet_handler(), gatt_client_hci_event_packet_handler(), and provide_context_for_conn_handle().
|
static |
References little_endian_read_16().
Referenced by gatt_client_att_packet_handler().
|
static |
References little_endian_read_16().
Referenced by gatt_client_att_packet_handler().
|
static |
References little_endian_read_16().
Referenced by gatt_client_att_packet_handler().
|
static |
References gatt_client::end_group_handle.
Referenced by trigger_next_characteristic_query(), and trigger_next_query().
|
static |
References gatt_client::gatt_client_state, and P_READY.
Referenced by gatt_client_cancel_write(), gatt_client_discover_characteristic_descriptors(), gatt_client_discover_characteristics_for_handle_range_by_uuid128(), gatt_client_discover_characteristics_for_handle_range_by_uuid16(), gatt_client_discover_characteristics_for_service(), gatt_client_discover_primary_services(), gatt_client_discover_primary_services_by_uuid128(), gatt_client_discover_primary_services_by_uuid16(), gatt_client_execute_write(), gatt_client_find_included_services_for_service(), gatt_client_is_ready(), gatt_client_prepare_write(), gatt_client_read_characteristic_descriptor_using_descriptor_handle(), gatt_client_read_long_characteristic_descriptor_using_descriptor_handle_with_offset(), gatt_client_read_long_value_of_characteristic_using_value_handle_with_offset(), gatt_client_read_multiple_characteristic_values(), gatt_client_read_value_of_characteristic_using_value_handle(), gatt_client_read_value_of_characteristics_by_uuid128(), gatt_client_read_value_of_characteristics_by_uuid16(), gatt_client_reliable_write_long_value_of_characteristic(), gatt_client_report_error_if_pending(), gatt_client_write_characteristic_descriptor_using_descriptor_handle(), gatt_client_write_client_characteristic_configuration(), gatt_client_write_long_characteristic_descriptor_using_descriptor_handle_with_offset(), gatt_client_write_long_value_of_characteristic_with_offset(), gatt_client_write_value_of_characteristic(), and gatt_client_write_value_of_characteristic_without_response().
|
static |
References gatt_client::attribute_handle, gatt_client::attribute_offset, gatt_client::attribute_value, and little_endian_read_16().
Referenced by gatt_client_att_packet_handler().
|
static |
References l2cap_max_le_mtu(), log_error, and gatt_client::mtu.
Referenced by gatt_client_run(), gatt_client_write_value_of_characteristic_without_response(), trigger_next_blob_query(), and write_blob_length().
|
static |
References ATT_DEFAULT_MTU, btstack_linked_list_add(), con_handle, gatt_client::con_handle, gatt_client::gatt_client_state, get_gatt_client_context_for_handle(), gatt_client::mtu, MTU_EXCHANGED, gatt_client::mtu_state, NULL, P_READY, pts_suppress_mtu_exchange, and SEND_MTU_EXCHANGE.
Referenced by gatt_client_att_packet_handler(), gatt_client_get_mtu(), gatt_client_is_ready(), gatt_client_write_value_of_characteristic_without_response(), and provide_context_for_conn_handle_and_start_timer().
|
static |
References gatt_client_timeout_start(), NULL, and provide_context_for_conn_handle().
Referenced by gatt_client_cancel_write(), gatt_client_discover_characteristic_descriptors(), gatt_client_discover_characteristics_for_handle_range_by_uuid128(), gatt_client_discover_characteristics_for_handle_range_by_uuid16(), gatt_client_discover_characteristics_for_service(), gatt_client_discover_primary_services(), gatt_client_discover_primary_services_by_uuid128(), gatt_client_discover_primary_services_by_uuid16(), gatt_client_execute_write(), gatt_client_find_included_services_for_service(), gatt_client_prepare_write(), gatt_client_read_characteristic_descriptor_using_descriptor_handle(), gatt_client_read_long_characteristic_descriptor_using_descriptor_handle_with_offset(), gatt_client_read_long_value_of_characteristic_using_value_handle_with_offset(), gatt_client_read_multiple_characteristic_values(), gatt_client_read_value_of_characteristic_using_value_handle(), gatt_client_read_value_of_characteristics_by_uuid128(), gatt_client_read_value_of_characteristics_by_uuid16(), gatt_client_reliable_write_long_value_of_characteristic(), gatt_client_write_characteristic_descriptor_using_descriptor_handle(), gatt_client_write_client_characteristic_configuration(), gatt_client_write_long_characteristic_descriptor_using_descriptor_handle_with_offset(), gatt_client_write_long_value_of_characteristic_with_offset(), and gatt_client_write_value_of_characteristic().
|
static |
References emit_gatt_all_characteristic_descriptors_result_event(), little_endian_read_16(), reverse_128(), and uuid_add_bluetooth_prefix().
Referenced by gatt_client_att_packet_handler().
|
static |
|
static |
|
static |
References characteristic_end_found(), characteristic_start_found(), and little_endian_read_16().
Referenced by gatt_client_att_packet_handler().
|
static |
References emit_gatt_included_service_query_result_event(), gatt_client::query_end_handle, and gatt_client::query_start_handle.
Referenced by gatt_client_att_packet_handler().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
References emit_gatt_service_query_result_event(), little_endian_read_16(), reverse_128(), and uuid_add_bluetooth_prefix().
Referenced by gatt_client_att_packet_handler().
|
static |
References att_find_by_type_value_request(), ATT_FIND_BY_TYPE_VALUE_REQUEST, gatt_client::con_handle, gatt_client::end_group_handle, little_endian_store_16(), reverse_128(), gatt_client::start_group_handle, gatt_client::uuid128, and gatt_client::uuid16.
Referenced by send_gatt_services_by_uuid_request().
|
static |
References att_execute_write_request(), ATT_EXECUTE_WRITE_REQUEST, and gatt_client::con_handle.
Referenced by gatt_client_run().
|
static |
References att_find_information_request(), ATT_FIND_INFORMATION_REQUEST, gatt_client::con_handle, gatt_client::end_group_handle, and gatt_client::start_group_handle.
Referenced by gatt_client_run().
|
static |
|
static |
References att_execute_write_request(), ATT_EXECUTE_WRITE_REQUEST, and gatt_client::con_handle.
Referenced by gatt_client_run().
|
static |
|
static |
References att_read_request(), ATT_READ_REQUEST, gatt_client::con_handle, and gatt_client::query_start_handle.
Referenced by gatt_client_run().
|
static |
|
static |
References att_read_blob_request(), ATT_READ_BLOB_REQUEST, gatt_client::attribute_handle, gatt_client::attribute_offset, and gatt_client::con_handle.
Referenced by gatt_client_run().
|
static |
References att_read_by_type_or_group_request_for_uuid128(), att_read_by_type_or_group_request_for_uuid16(), ATT_READ_BY_TYPE_REQUEST, gatt_client::con_handle, gatt_client::end_group_handle, gatt_client::start_group_handle, gatt_client::uuid128, and gatt_client::uuid16.
Referenced by gatt_client_run().
|
static |
References att_read_request(), ATT_READ_REQUEST, gatt_client::attribute_handle, and gatt_client::con_handle.
Referenced by gatt_client_run().
|
static |
References att_read_request(), ATT_READ_REQUEST, gatt_client::attribute_handle, and gatt_client::con_handle.
Referenced by gatt_client_run().
|
static |
|
static |
References att_read_multiple_request(), gatt_client::con_handle, gatt_client::read_multiple_handle_count, and gatt_client::read_multiple_handles.
Referenced by gatt_client_run().
|
static |
References GATT_PRIMARY_SERVICE_UUID, and send_gatt_by_uuid_request().
Referenced by gatt_client_run().
|
static |
|
static |
References att_write_request(), ATT_WRITE_REQUEST, gatt_client::attribute_handle, gatt_client::attribute_length, gatt_client::attribute_value, and gatt_client::con_handle.
Referenced by gatt_client_run().
|
static |
|
static |
|
static |
References little_endian_store_16(), log_error, long_characteristic_value_event_header_size, and NULL.
Referenced by report_gatt_long_characteristic_descriptor(), and report_gatt_long_characteristic_value_blob().
|
inlinestatic |
|
inlinestatic |
References P_W2_SEND_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY, and trigger_next_query().
Referenced by gatt_client_att_packet_handler().
|
inlinestatic |
|
inlinestatic |
References P_W2_SEND_INCLUDED_SERVICE_QUERY, and trigger_next_query().
Referenced by gatt_client_att_packet_handler().
|
inlinestatic |
References gatt_client::attribute_offset, gatt_client::gatt_client_state, and write_blob_length().
Referenced by gatt_client_att_packet_handler().
|
static |
References emit_gatt_complete_event(), gatt_client_handle_transaction_complete(), gatt_client::gatt_client_state, is_query_done(), and gatt_client::start_group_handle.
Referenced by trigger_next_characteristic_descriptor_query(), trigger_next_characteristic_query(), trigger_next_included_service_query(), trigger_next_read_by_type_query(), trigger_next_service_by_uuid_query(), and trigger_next_service_query().
|
inlinestatic |
References P_W2_SEND_READ_BY_TYPE_REQUEST, and trigger_next_query().
Referenced by gatt_client_att_packet_handler().
|
inlinestatic |
References P_W2_SEND_SERVICE_WITH_UUID_QUERY, and trigger_next_query().
Referenced by gatt_client_att_packet_handler().
|
inlinestatic |
References P_W2_SEND_SERVICE_QUERY, and trigger_next_query().
Referenced by gatt_client_att_packet_handler().
|
static |
References gatt_client::attribute_length, gatt_client::attribute_offset, and peripheral_mtu().
Referenced by send_gatt_prepare_write_request(), and trigger_next_prepare_write_query().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Referenced by gatt_client_init(), gatt_client_pts_suppress_mtu_exchange(), and provide_context_for_conn_handle().