ble_gatt_client
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
gatt-client.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Macros

#define BT_GATT_UUID_SIZE   16
 

Typedefs

typedef void(* bt_gatt_client_destroy_func_t )(void *user_data)
 
typedef void(* bt_gatt_client_callback_t )(bool success, uint8_t att_ecode, void *user_data)
 
typedef void(* bt_gatt_client_debug_func_t )(const char *str, void *user_data)
 
typedef void(* bt_gatt_client_read_callback_t )(bool success, uint8_t att_ecode, const uint8_t *value, uint16_t length, void *user_data)
 
typedef void(* bt_gatt_client_write_long_callback_t )(bool success, bool reliable_error, uint8_t att_ecode, void *user_data)
 
typedef void(* bt_gatt_client_notify_callback_t )(uint16_t value_handle, const uint8_t *value, uint16_t length, void *user_data)
 
typedef void(* bt_gatt_client_register_callback_t )(uint16_t att_ecode, void *user_data)
 
typedef void(* bt_gatt_client_service_changed_callback_t )(uint16_t start_handle, uint16_t end_handle, void *user_data)
 

Functions

struct bt_gatt_clientbt_gatt_client_new (struct gatt_db *db, struct bt_att *att, uint16_t mtu)
 
struct bt_gatt_clientbt_gatt_client_ref (struct bt_gatt_client *client)
 
void bt_gatt_client_unref (struct bt_gatt_client *client)
 
bool bt_gatt_client_is_ready (struct bt_gatt_client *client)
 
bool bt_gatt_client_set_ready_handler (struct bt_gatt_client *client, bt_gatt_client_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
bool bt_gatt_client_set_service_changed (struct bt_gatt_client *client, bt_gatt_client_service_changed_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
bool bt_gatt_client_set_debug (struct bt_gatt_client *client, bt_gatt_client_debug_func_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
uint16_t bt_gatt_client_get_mtu (struct bt_gatt_client *client)
 
struct gatt_dbbt_gatt_client_get_db (struct bt_gatt_client *client)
 
bool bt_gatt_client_cancel (struct bt_gatt_client *client, unsigned int id)
 
bool bt_gatt_client_cancel_all (struct bt_gatt_client *client)
 
unsigned int bt_gatt_client_read_value (struct bt_gatt_client *client, uint16_t value_handle, bt_gatt_client_read_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
unsigned int bt_gatt_client_read_long_value (struct bt_gatt_client *client, uint16_t value_handle, uint16_t offset, bt_gatt_client_read_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
unsigned int bt_gatt_client_read_multiple (struct bt_gatt_client *client, uint16_t *handles, uint8_t num_handles, bt_gatt_client_read_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
unsigned int bt_gatt_client_write_without_response (struct bt_gatt_client *client, uint16_t value_handle, bool signed_write, const uint8_t *value, uint16_t length)
 
unsigned int bt_gatt_client_write_value (struct bt_gatt_client *client, uint16_t value_handle, const uint8_t *value, uint16_t length, bt_gatt_client_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
unsigned int bt_gatt_client_write_long_value (struct bt_gatt_client *client, bool reliable, uint16_t value_handle, uint16_t offset, const uint8_t *value, uint16_t length, bt_gatt_client_write_long_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
unsigned int bt_gatt_client_prepare_write (struct bt_gatt_client *client, unsigned int id, uint16_t value_handle, uint16_t offset, const uint8_t *value, uint16_t length, bt_gatt_client_write_long_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
unsigned int bt_gatt_client_write_execute (struct bt_gatt_client *client, unsigned int id, bt_gatt_client_callback_t callback, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
unsigned int bt_gatt_client_register_notify (struct bt_gatt_client *client, uint16_t chrc_value_handle, bt_gatt_client_register_callback_t callback, bt_gatt_client_notify_callback_t notify, void *user_data, bt_gatt_client_destroy_func_t destroy)
 
bool bt_gatt_client_unregister_notify (struct bt_gatt_client *client, unsigned int id)
 
bool bt_gatt_client_set_security (struct bt_gatt_client *client, int level)
 
int bt_gatt_client_get_security (struct bt_gatt_client *client)
 

Macro Definition Documentation

#define BT_GATT_UUID_SIZE   16

Definition at line 28 of file gatt-client.h.

Typedef Documentation

typedef void(* bt_gatt_client_callback_t)(bool success, uint8_t att_ecode, void *user_data)

Definition at line 40 of file gatt-client.h.

typedef void(* bt_gatt_client_debug_func_t)(const char *str, void *user_data)

Definition at line 42 of file gatt-client.h.

typedef void(* bt_gatt_client_destroy_func_t)(void *user_data)

Definition at line 39 of file gatt-client.h.

typedef void(* bt_gatt_client_notify_callback_t)(uint16_t value_handle, const uint8_t *value, uint16_t length, void *user_data)

Definition at line 49 of file gatt-client.h.

typedef void(* bt_gatt_client_read_callback_t)(bool success, uint8_t att_ecode, const uint8_t *value, uint16_t length, void *user_data)

Definition at line 43 of file gatt-client.h.

typedef void(* bt_gatt_client_register_callback_t)(uint16_t att_ecode, void *user_data)

Definition at line 52 of file gatt-client.h.

typedef void(* bt_gatt_client_service_changed_callback_t)(uint16_t start_handle, uint16_t end_handle, void *user_data)

Definition at line 54 of file gatt-client.h.

typedef void(* bt_gatt_client_write_long_callback_t)(bool success, bool reliable_error, uint8_t att_ecode, void *user_data)

Definition at line 46 of file gatt-client.h.

Function Documentation

bool bt_gatt_client_cancel ( struct bt_gatt_client client,
unsigned int  id 
)
struct gatt_db* bt_gatt_client_get_db ( struct bt_gatt_client client)

Definition at line 1881 of file gatt-client.c.

References bt_gatt_client::db.

uint16_t bt_gatt_client_get_mtu ( struct bt_gatt_client client)

Definition at line 1873 of file gatt-client.c.

References bt_gatt_client::att, and bt_att_get_mtu().

int bt_gatt_client_get_security ( struct bt_gatt_client client)

Definition at line 3063 of file gatt-client.c.

References bt_gatt_client::att, and bt_att_get_security().

Referenced by cmd_get_security().

unsigned int bt_gatt_client_read_multiple ( struct bt_gatt_client client,
uint16_t *  handles,
uint8_t  num_handles,
bt_gatt_client_read_callback_t  callback,
void *  user_data,
bt_gatt_client_destroy_func_t  destroy 
)
unsigned int bt_gatt_client_read_value ( struct bt_gatt_client client,
uint16_t  value_handle,
bt_gatt_client_read_callback_t  callback,
void *  user_data,
bt_gatt_client_destroy_func_t  destroy 
)
struct bt_gatt_client* bt_gatt_client_ref ( struct bt_gatt_client client)
unsigned int bt_gatt_client_register_notify ( struct bt_gatt_client client,
uint16_t  chrc_value_handle,
bt_gatt_client_register_callback_t  callback,
bt_gatt_client_notify_callback_t  notify,
void *  user_data,
bt_gatt_client_destroy_func_t  destroy 
)
bool bt_gatt_client_set_debug ( struct bt_gatt_client client,
bt_gatt_client_debug_func_t  callback,
void *  user_data,
bt_gatt_client_destroy_func_t  destroy 
)
bool bt_gatt_client_set_ready_handler ( struct bt_gatt_client client,
bt_gatt_client_callback_t  callback,
void *  user_data,
bt_gatt_client_destroy_func_t  destroy 
)
bool bt_gatt_client_set_security ( struct bt_gatt_client client,
int  level 
)

Definition at line 3055 of file gatt-client.c.

References bt_gatt_client::att, and bt_att_set_security().

Referenced by cmd_set_security().

bool bt_gatt_client_set_service_changed ( struct bt_gatt_client client,
bt_gatt_client_service_changed_callback_t  callback,
void *  user_data,
bt_gatt_client_destroy_func_t  destroy 
)
void bt_gatt_client_unref ( struct bt_gatt_client client)
bool bt_gatt_client_unregister_notify ( struct bt_gatt_client client,
unsigned int  id 
)
unsigned int bt_gatt_client_write_value ( struct bt_gatt_client client,
uint16_t  value_handle,
const uint8_t *  value,
uint16_t  length,
bt_gatt_client_callback_t  callback,
void *  user_data,
bt_gatt_client_destroy_func_t  destroy 
)
unsigned int bt_gatt_client_write_without_response ( struct bt_gatt_client client,
uint16_t  value_handle,
bool  signed_write,
const uint8_t *  value,
uint16_t  length 
)