SmartSnippets DA1459x SDK
gatt_client.h
Go to the documentation of this file.
1 
43 #ifndef GATT_CLIENT_H
44 #define GATT_CLIENT_H
45 
50 typedef enum {
54 
58 typedef enum {
62 
63 typedef void (* gatt_client_set_event_state_completed_cb_t) (ble_client_t *gatt_client,
64  gatt_client_event_t event,
65  att_error_t status);
66 typedef void (* gatt_client_get_event_state_completed_cb_t) (ble_client_t *gatt_client,
67  gatt_client_event_t event,
68  att_error_t status, bool enabled);
69 typedef void (* gatt_client_service_changed_cb_t) (ble_client_t *gatt_client,
70  uint16_t start_handle,
71  uint16_t end_handle);
72 
73 typedef struct {
75  gatt_client_set_event_state_completed_cb_t set_event_state_completed;
77  gatt_client_get_event_state_completed_cb_t get_event_state_completed;
79  gatt_client_service_changed_cb_t service_changed;
80 } gatt_client_callbacks_t;
81 
93 ble_client_t *gatt_client_init(const gatt_client_callbacks_t *cb,
94  const ble_evt_gattc_browse_svc_t *evt);
107 ble_client_t *gatt_client_init_from_data(uint16_t conn_idx, const gatt_client_callbacks_t *cb,
108  const void *data, size_t length);
109 
121 
134  bool enable);
135 
147 
148 #endif /* GATT_CLIENT_H */
149 
ble_evt_gattc_browse_svc_t
Definition: ble_gattc.h:118
gatt_client_get_event_state
bool gatt_client_get_event_state(ble_client_t *gatt_client, gatt_client_event_t event)
Get event state.
gatt_client_get_capabilites
gatt_client_cap_t gatt_client_get_capabilites(ble_client_t *gatt_client)
Get Gatt client capabilities.
att_error_t
att_error_t
Definition: ble_att.h:64
GATT_CLIENT_CAP_SERVICE_CHANGED
Definition: gatt_client.h:60
gatt_client_init
ble_client_t * gatt_client_init(const gatt_client_callbacks_t *cb, const ble_evt_gattc_browse_svc_t *evt)
Register GATT Client instance.
ble_client
Definition: ble_client.h:154
GATT_CLIENT_EVENT_SERVICE_CHANGED_INDICATE
Definition: gatt_client.h:52
gatt_client_init_from_data
ble_client_t * gatt_client_init_from_data(uint16_t conn_idx, const gatt_client_callbacks_t *cb, const void *data, size_t length)
Initialize and register GATT Client instance from data buffer.
gatt_client_cap_t
gatt_client_cap_t
Definition: gatt_client.h:58
gatt_client_set_event_state
bool gatt_client_set_event_state(ble_client_t *gatt_client, gatt_client_event_t event, bool enable)
Set event state.
gatt_client_event_t
gatt_client_event_t
Definition: gatt_client.h:50