Microchip® Advanced Software Framework

att_db.h File Reference
#include <stdint.h>
#include "bluetooth.h"
#include "btstack_linked_list.h"

Data Structures

struct  att_connection
 
struct  att_service_handler
 

Macros

#define ATT_ERROR_DATA_MISMATCH   0x7e
 
#define ATT_ERROR_HCI_DISCONNECT_RECEIVED   0x1f
 
#define ATT_ERROR_TIMEOUT   0x7F
 

Typedefs

typedef struct att_connection att_connection_t
 
typedef uint16_t(* att_read_callback_t )(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 
typedef struct att_service_handler att_service_handler_t
 
typedef int(* att_write_callback_t )(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 

Functions

void att_clear_transaction_queue (att_connection_t *att_connection)
 
void att_dump_attributes (void)
 
uint16_t att_handle_request (att_connection_t *att_connection, uint8_t *request_buffer, uint16_t request_len, uint8_t *response_buffer)
 
uint16_t att_prepare_handle_value_indication (att_connection_t *att_connection, uint16_t attribute_handle, uint8_t *value, uint16_t value_len, uint8_t *response_buffer)
 
uint16_t att_prepare_handle_value_notification (att_connection_t *att_connection, uint16_t attribute_handle, uint8_t *value, uint16_t value_len, uint8_t *response_buffer)
 
uint16_t att_read_callback_handle_blob (const uint8_t *blob, uint16_t blob_size, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 
uint16_t att_read_callback_handle_byte (uint8_t value, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 
uint16_t att_read_callback_handle_little_endian_16 (uint16_t value, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 
uint16_t att_read_callback_handle_little_endian_32 (uint32_t value, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 
void att_register_service_handler (att_service_handler_t *handler)
 register read/write callbacks for specific handle range More...
 
void att_set_db (uint8_t const *db)
 
void att_set_read_callback (att_read_callback_t callback)
 
void att_set_write_callback (att_write_callback_t callback)
 
uint16_t att_uuid_for_handle (uint16_t attribute_handle)
 
uint16_t gatt_server_get_client_configuration_handle_for_characteristic_with_uuid16 (uint16_t start_handle, uint16_t end_handle, uint16_t uuid16)
 
int gatt_server_get_get_handle_range_for_service_with_uuid16 (uint16_t uuid16, uint16_t *start_handle, uint16_t *end_handle)
 
uint16_t gatt_server_get_value_handle_for_characteristic_with_uuid16 (uint16_t start_handle, uint16_t end_handle, uint16_t uuid16)
 

#define ATT_ERROR_DATA_MISMATCH   0x7e
#define ATT_ERROR_HCI_DISCONNECT_RECEIVED   0x1f
#define ATT_ERROR_TIMEOUT   0x7F

typedef uint16_t(* att_read_callback_t)(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
typedef int(* att_write_callback_t)(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)

void att_clear_transaction_queue ( att_connection_t att_connection)
uint16_t att_prepare_handle_value_indication ( att_connection_t att_connection,
uint16_t  attribute_handle,
uint8_t *  value,
uint16_t  value_len,
uint8_t *  response_buffer 
)
uint16_t att_prepare_handle_value_notification ( att_connection_t att_connection,
uint16_t  attribute_handle,
uint8_t *  value,
uint16_t  value_len,
uint8_t *  response_buffer 
)
uint16_t att_read_callback_handle_blob ( const uint8_t *  blob,
uint16_t  blob_size,
uint16_t  offset,
uint8_t *  buffer,
uint16_t  buffer_size 
)
uint16_t att_read_callback_handle_byte ( uint8_t  value,
uint16_t  offset,
uint8_t *  buffer,
uint16_t  buffer_size 
)
uint16_t att_read_callback_handle_little_endian_16 ( uint16_t  value,
uint16_t  offset,
uint8_t *  buffer,
uint16_t  buffer_size 
)
uint16_t att_read_callback_handle_little_endian_32 ( uint32_t  value,
uint16_t  offset,
uint8_t *  buffer,
uint16_t  buffer_size 
)
void att_register_service_handler ( att_service_handler_t handler)
void att_set_db ( uint8_t const *  db)

References att_db.

Referenced by att_server_init().

void att_set_read_callback ( att_read_callback_t  callback)

References att_read_callback, and callback.

Referenced by att_server_init().

void att_set_write_callback ( att_write_callback_t  callback)

References att_write_callback, and callback.

Referenced by att_server_init().

uint16_t att_uuid_for_handle ( uint16_t  attribute_handle)
uint16_t gatt_server_get_client_configuration_handle_for_characteristic_with_uuid16 ( uint16_t  start_handle,
uint16_t  end_handle,
uint16_t  uuid16 
)
uint16_t gatt_server_get_value_handle_for_characteristic_with_uuid16 ( uint16_t  start_handle,
uint16_t  end_handle,
uint16_t  uuid16 
)