PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
gatt.h File Reference
#include <pbl/bluetooth/types.h>
#include <pbl/bluetooth/gatt_discovery.h>
#include <pbl/bluetooth/hci_types.h>
#include <comm/ble/gap_le_connection.h>

Data Structures

struct  pbl_bt_gatt_device_connection_event
 A GATT connection was established. More...
 
struct  pbl_bt_gatt_device_disconnection_event
 A GATT connection was terminated. More...
 
struct  pbl_bt_gatt_device_buffer_empty_event
 The transmit buffers to a peer became available again. More...
 
struct  pbl_bt_gatt_server_notif_indic_event
 A notification or indication was received from a peer's GATT server. More...
 
struct  pbl_bt_gatt_device_mtu_update_event
 The ATT MTU of a connection changed. More...
 
struct  pbl_bt_gatt_server_changed_confirmation_event
 A peer confirmed a Service Changed indication. More...
 
struct  pbl_bt_gatt_server_read_subscription_event
 A peer read the Service Changed CCCD. More...
 
struct  pbl_bt_gatt_client_op_response_hdr
 Common header of GATT client operation responses. More...
 
struct  pbl_bt_gatt_client_op_read_response
 Response to pbl_bt_gatt_read(). More...
 
struct  pbl_bt_gatt_client_op_write_response
 Response to pbl_bt_gatt_write(). More...
 

Macros

#define PBL_BT_GATT_SERVICE_UUID   ((uint16_t)0x1801)
 16-bit UUID of the Generic Attribute service.
 
#define PBL_BT_GATT_SERVICE_CHANGED_CHARACTERISTIC_UUID   ((uint16_t)0x2A05)
 16-bit UUID of the Service Changed characteristic.
 
#define PBL_BT_GATT_CCCD_UUID   ((uint16_t)0x2902)
 16-bit UUID of the Client Characteristic Configuration Descriptor.
 

Enumerations

enum  pbl_bt_gatt_client_op_response_type { PBL_BT_GATT_CLIENT_OP_RESPONSE_READ , PBL_BT_GATT_CLIENT_OP_RESPONSE_WRITE }
 Type of a GATT client operation response. More...
 

Functions

void pbl_bt_gatt_respond_read_subscription (uint32_t transaction_id, uint16_t response_code)
 Answer a read of the Service Changed CCCD.
 
void pbl_bt_gatt_send_changed_indication (const struct pbl_bt_device_internal *device, const struct pbl_bt_att_handle_range *data)
 Indicate a change of the local GATT database to a peer.
 
enum pbl_bt_errno pbl_bt_gatt_write_without_response (GAPLEConnection *connection, const uint8_t *value, size_t value_length, uint16_t att_handle)
 Write a characteristic value without response.
 
enum pbl_bt_errno pbl_bt_gatt_write (GAPLEConnection *connection, const uint8_t *value, size_t value_length, uint16_t att_handle, void *context)
 Write an attribute value.
 
enum pbl_bt_errno pbl_bt_gatt_read (GAPLEConnection *connection, uint16_t att_handle, void *context)
 Read an attribute value.
 
void pbl_bt_cb_gatt_handle_connect (const struct pbl_bt_gatt_device_connection_event *event)
 Called when a GATT connection is established.
 
void pbl_bt_cb_gatt_handle_disconnect (const struct pbl_bt_gatt_device_disconnection_event *event)
 Called when a GATT connection is terminated.
 
void pbl_bt_cb_gatt_handle_buffer_empty (const struct pbl_bt_gatt_device_buffer_empty_event *event)
 Called when the transmit buffers became available again.
 
void pbl_bt_cb_gatt_handle_mtu_update (const struct pbl_bt_gatt_device_mtu_update_event *event)
 Called when the ATT MTU of a connection changed.
 
void pbl_bt_cb_gatt_handle_notification (const struct pbl_bt_gatt_server_notif_indic_event *event)
 Called when a notification is received.
 
void pbl_bt_cb_gatt_handle_indication (const struct pbl_bt_gatt_server_notif_indic_event *event)
 Called when an indication is received.
 
void pbl_bt_cb_gatt_service_changed_server_confirmation (const struct pbl_bt_gatt_server_changed_confirmation_event *event)
 Called when a peer confirmed a Service Changed indication.
 
void pbl_bt_cb_gatt_service_changed_server_subscribe (const struct pbl_bt_gatt_server_subscribe_event *event)
 Called when a peer (un)subscribed to Service Changed indications.
 
void pbl_bt_cb_gatt_service_changed_server_read_subscription (const struct pbl_bt_gatt_server_read_subscription_event *event)
 Called when a peer read the Service Changed CCCD.
 
void pbl_bt_cb_gatt_client_discovery_handle_service_changed (GAPLEConnection *connection, uint16_t handle)
 Called after subscribing to a peer's Service Changed indications.
 
void pbl_bt_cb_gatt_client_operations_handle_response (struct pbl_bt_gatt_client_op_response_hdr *event)
 Called with the result of pbl_bt_gatt_read() or pbl_bt_gatt_write().