203 #define SOL_GATT_SERVICE_UUID_16(service_uuid) \
204 { .type = SOL_GATT_ATTR_TYPE_SERVICE, \
205 .uuid = { .type = SOL_BT_UUID_TYPE_16, \
206 .val16 = (service_uuid) } }
213 #define SOL_GATT_CHARACTERISTIC_UUID_16(_uuid, _flags, ...) \
214 { .type = SOL_GATT_ATTR_TYPE_CHARACTERISTIC, \
215 .uuid = { .type = SOL_BT_UUID_TYPE_16, \
216 .val16 = (_uuid) }, \
225 #define SOL_GATT_DESCRIPTOR_UUID_16(_uuid, _flags, ...) \
226 { .type = SOL_GATT_ATTR_TYPE_DESCRIPTOR, \
227 .uuid = { .type = SOL_BT_UUID_TYPE_16, \
228 .val16 = (_uuid) }, \
237 #define SOL_GATT_ATTR_INVALID { .type = SOL_GATT_ATTR_TYPE_INVALID }
271 void (*cb)(
void *user_data,
bool success,
274 const void *user_data);
292 void (*cb)(
void *user_data,
bool success,
294 const void *user_data);
317 bool (*cb)(
void *user_data,
struct sol_bt_conn *conn,
319 const void *user_data);
336 bool (*cb)(
void *user_data,
const struct sol_gatt_attr *attr,
338 const void *user_data);
350 const void *user_data);
struct sol_http_client_connection * pending
Definition: download.c:29
enum sol_gatt_attr_type type
Definition: sol-gatt.h:152
uint16_t flags
Definition: sol-gatt.h:153
int sol_gatt_indicate(struct sol_bt_conn *conn, const struct sol_gatt_attr *attr)
Sends an indication to the device represented by conn.
sol_gatt_attr_type
Set of types of Attributes.
Definition: sol-gatt.h:56
const struct sol_gatt_attr * sol_gatt_pending_get_attr(const struct sol_gatt_pending *op)
Returns the attribute referenced by a pending operation.
Definition: sol-gatt.h:59
Allows notifications for the characteristic value.
Definition: sol-gatt.h:78
int sol_gatt_pending_reply(struct sol_gatt_pending *pending, int error, struct sol_buffer *buf)
Returns a response to an asynchronous operation.
Only allows encrypted and authenticated write operations against the characteristic value...
Definition: sol-gatt.h:98
Representation of a Bluetooth UUID.
Definition: sol-bluetooth.h:77
Allows write operation against the descriptors associated with this characteristic.
Definition: sol-gatt.h:86
Routines to handle common Bluetooth communications.
Definition: sol-gatt.h:58
Allows the descriptor value to be read.
Definition: sol-gatt.h:106
struct sol_bt_conn sol_bt_conn
Represents an active connection to a Bluetooth device.
Definition: sol-bluetooth.h:128
Only allows encrypted and authenticated write operations against the descriptor value.
Definition: sol-gatt.h:122
struct sol_bt_uuid uuid
Definition: sol-gatt.h:151
int(* read)(struct sol_gatt_pending *op, uint16_t offset)
The response for this operation will be returned by calling sol_gatt_pending_reply() passing a valid ...
Definition: sol-gatt.h:158
int sol_gatt_notify(struct sol_bt_conn *conn, const struct sol_gatt_attr *attr)
Sends a notificatiion to the device represented by conn.
int sol_gatt_register_attributes(struct sol_gatt_attr *attrs)
Registers attributes into the GATT database.
Allows the characteristic value to be read.
Definition: sol-gatt.h:72
int sol_gatt_read_attr(struct sol_bt_conn *conn, struct sol_gatt_attr *attr, void(*cb)(void *user_data, bool success, const struct sol_gatt_attr *attr, const struct sol_buffer *buf), const void *user_data)
Reads the value from a attribute.
int sol_gatt_write_attr(struct sol_bt_conn *conn, struct sol_gatt_attr *attr, struct sol_buffer *buf, void(*cb)(void *user_data, bool success, const struct sol_gatt_attr *attr), const void *user_data)
Writes the value to a attribute.
int sol_gatt_subscribe(struct sol_bt_conn *conn, const struct sol_gatt_attr *attr, bool(*cb)(void *user_data, const struct sol_gatt_attr *attr, const struct sol_buffer *buffer), const void *user_data)
Registers a callback to be called when a notification/indication is received.
Only allows encrypted read operations against the descriptor value.
Definition: sol-gatt.h:110
Only allows encrypted read operations against the characteristic value.
Definition: sol-gatt.h:88
Definition: sol-gatt.h:57
Allows the characteristic value to be written.
Definition: sol-gatt.h:76
void * _priv
Definition: sol-gatt.h:178
int sol_gatt_unregister_attributes(struct sol_gatt_attr *attrs)
Unregisters attributes from the GATT database.
Allows the reliable write procedure against the characteristic value.
Definition: sol-gatt.h:84
int sol_gatt_unsubscribe(bool(*cb)(void *user_data, const struct sol_gatt_attr *attr, const struct sol_buffer *buffer), const void *user_data)
Unregisters from receiving notifications indications.
Representation of a GATT Attribute.
Definition: sol-gatt.h:150
static struct sol_gatt_attr attrs[]
Definition: heartbeat.c:57
int(* write)(struct sol_gatt_pending *op, struct sol_buffer *buf, uint16_t offset)
The response for this operation will be returned by calling sol_gatt_pending_reply(), the buf parameter will be ignored.
Definition: sol-gatt.h:172
Allows the descriptor value to be written.
Definition: sol-gatt.h:108
struct sol_gatt_pending sol_gatt_pending
Represents a pending request.
Definition: sol-gatt.h:135
Only allows encrypted and authenticated read operations against the characteristic value...
Definition: sol-gatt.h:94
sol_gatt_chr_flags
Set of flags for Charateristic attributes.
Definition: sol-gatt.h:68
Allows the write without response procedure against the characteristic value.
Definition: sol-gatt.h:74
int sol_gatt_discover(struct sol_bt_conn *conn, enum sol_gatt_attr_type type, const struct sol_gatt_attr *parent, const struct sol_bt_uuid *uuid, bool(*cb)(void *user_data, struct sol_bt_conn *conn, const struct sol_gatt_attr *attr), const void *user_data)
Discover attributes by type, restricted by UUID and parent attribute.
Allows the authenticated signed write procedure against the characteristic value. ...
Definition: sol-gatt.h:82
Only allows encrypted write operations against the descriptor value.
Definition: sol-gatt.h:112
Allows indications for the characteristic value.
Definition: sol-gatt.h:80
Only allows encrypted and authenticated read operations against the descriptor value.
Definition: sol-gatt.h:117
struct sol_gatt_attr sol_gatt_attr
Representation of a GATT Attribute.
Definition: sol-gatt.h:60
A sol_buffer is a dynamic array, that can be resized if needed.
Definition: sol-buffer.h:130
Only allows encrypted write operations against the characteristic value.
Definition: sol-gatt.h:90
When set allows the characteristic value to be broadcast.
Definition: sol-gatt.h:70
sol_gatt_desc_flags
Set of flags for Descriptor attributes.
Definition: sol-gatt.h:104
void * user_data
Definition: sol-gatt.h:176