12#ifndef INFUSE_SDK_INCLUDE_INFUSE_BLUETOOTH_GATT_H_
13#define INFUSE_SDK_INCLUDE_INFUSE_BLUETOOTH_GATT_H_
15#include <zephyr/bluetooth/conn.h>
16#include <zephyr/bluetooth/addr.h>
80#define BT_CONN_AUTO_CACHE(name, num_characteristics) \
81 static struct bt_gatt_remote_char name##_storage[num_characteristics]; \
82 static struct bt_conn_auto_database_cache name = { \
83 .remote_info = name##_storage, \
int8_t bt_conn_rssi(struct bt_conn *conn)
Get last measured RSSI on a connection.
void bt_conn_rssi_log(struct bt_conn *conn, uint8_t tdf_loggers)
Start logging the RSSI of the connection.
void bt_conn_le_auto_setup(struct bt_conn *conn, struct bt_conn_auto_discovery *discovery, const struct bt_conn_auto_setup_cb *callbacks, uint8_t preferred_phy)
Setup a connection with automatic MTU exchange and characteristic discovery.
int bt_conn_disconnect_sync(struct bt_conn *conn)
Trigger a disconnection and wait for it to complete.
int bt_conn_disconnect_wait(struct bt_conn *conn, k_timeout_t timeout)
Wait for a connection to disconnect, without initiating it.
Database cache to speed up repeat connections.
Definition gatt.h:65
struct bt_gatt_remote_char * remote_info
Pointer to list of cached remote characteristics.
Definition gatt.h:69
uint8_t db_hash[16]
Cached GATT database hash value.
Definition gatt.h:67
struct k_spinlock lock
Access spinlock.
Definition gatt.h:71
Characteristics to discover on the connection.
Definition gatt.h:89
const struct bt_uuid ** characteristics
List of UUIDs to discover.
Definition gatt.h:91
struct bt_gatt_remote_char * remote_info
Pointer to list of characteristics to discover.
Definition gatt.h:95
struct bt_conn_auto_database_cache * cache
Cached characteristics from previous connections.
Definition gatt.h:93
uint8_t num_characteristics
Number of characteristics to discover.
Definition gatt.h:99
uint8_t db_hash_pending[16]
Pending database hash.
Definition gatt.h:97
Parameters for automatically setup connection.
Definition gatt.h:50
void(* conn_terminated_cb)(struct bt_conn *conn, int reason, void *user_data)
Run when connection has terminated, if bt_conn_auto_setup_cb::conn_setup_cb has previously run.
Definition gatt.h:57
void(* conn_setup_cb)(struct bt_conn *conn, int err, void *user_data)
Run when connection has been successfully setup or failed.
Definition gatt.h:52
void * user_data
User data provided to callbacks.
Definition gatt.h:59
Remote GATT Characteristic information.
Definition gatt.h:34
uint8_t properties
Characteristic properties (BT_GATT_CHRC_*)
Definition gatt.h:44
uint16_t attr_start_handle
Start handle for the characteristic.
Definition gatt.h:36
uint16_t ccc_handle
Handle for the Client Characteristic Configuration (0 if doesn't exist)
Definition gatt.h:42
uint16_t value_handle
Handle for the value attribute.
Definition gatt.h:40
uint16_t attr_end_handle
End handle for the characteristic.
Definition gatt.h:38