Soletta™ Framework
|
Routines to handle Bluetooth GATT protocol. More...
#include <sol-bluetooth.h>
Go to the source code of this file.
Data Structures | |
struct | sol_gatt_attr |
Representation of a GATT Attribute. More... | |
Macros | |
#define | SOL_GATT_ATTR_INVALID { .type = SOL_GATT_ATTR_TYPE_INVALID } |
Terminates the list of attributes. More... | |
#define | SOL_GATT_CHARACTERISTIC_UUID_16(_uuid, _flags,...) |
Helper to the construction of a GATT Characteristic with 16-bit UUID. More... | |
#define | SOL_GATT_DESCRIPTOR_UUID_16(_uuid, _flags,...) |
Helper to the construction of a GATT Descriptor with 16-bit UUID. More... | |
#define | SOL_GATT_SERVICE_UUID_16(service_uuid) |
Helper to the construction of a GATT Service with 16-bit UUID. More... | |
Typedefs | |
typedef struct sol_gatt_attr | sol_gatt_attr |
Representation of a GATT Attribute. More... | |
typedef struct sol_gatt_pending | sol_gatt_pending |
Represents a pending request. More... | |
Functions | |
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. More... | |
int | sol_gatt_indicate (struct sol_bt_conn *conn, const struct sol_gatt_attr *attr) |
Sends an indication to the device represented by conn. More... | |
int | sol_gatt_notify (struct sol_bt_conn *conn, const struct sol_gatt_attr *attr) |
Sends a notificatiion to the device represented by conn. More... | |
const struct sol_gatt_attr * | sol_gatt_pending_get_attr (const struct sol_gatt_pending *op) |
Returns the attribute referenced by a pending operation. More... | |
int | sol_gatt_pending_reply (struct sol_gatt_pending *pending, int error, struct sol_buffer *buf) |
Returns a response to an asynchronous operation. More... | |
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. More... | |
int | sol_gatt_register_attributes (struct sol_gatt_attr *attrs) |
Registers attributes into the GATT database. More... | |
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. More... | |
int | sol_gatt_unregister_attributes (struct sol_gatt_attr *attrs) |
Unregisters attributes from the GATT database. More... | |
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. More... | |
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. More... | |
Routines to handle Bluetooth GATT protocol.
The Bluetooth Generic Attribute Protocol (GATT) is a lightweight protocol on top of another protocol named ATT (Attribute Protocol), that defines the attribute has a type (UUID), a value, and is indentified by a handle.
The API is based on the BlueZ D-Bus GATT API,