Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Infuse-IoT GATT APIs

Data Structures

struct  bt_gatt_remote_char
 Remote GATT Characteristic information. More...
 
struct  bt_conn_auto_setup_cb
 Parameters for automatically setup connection. More...
 
struct  bt_conn_auto_database_cache
 Database cache to speed up repeat connections. More...
 
struct  bt_conn_auto_discovery
 Characteristics to discover on the connection. More...
 

Macros

#define BT_CONN_AUTO_CACHE(name, num_characteristics)
 Create a cache variable that holds a given number of characteristics.
 

Functions

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.
 
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.
 

Detailed Description

Macro Definition Documentation

◆ BT_CONN_AUTO_CACHE

#define BT_CONN_AUTO_CACHE ( name,
num_characteristics )

#include <infuse/bluetooth/gatt.h>

Value:
static struct bt_gatt_remote_char name##_storage[num_characteristics]; \
static struct bt_conn_auto_database_cache name = { \
.remote_info = name##_storage, \
}
Database cache to speed up repeat connections.
Definition gatt.h:61
Remote GATT Characteristic information.
Definition gatt.h:33

Create a cache variable that holds a given number of characteristics.

Parameters
nameName of the created variable
num_characteristicsNumber of characteristics cache can hold

Function Documentation

◆ bt_conn_disconnect_sync()

int bt_conn_disconnect_sync ( struct bt_conn * conn)

#include <infuse/bluetooth/gatt.h>

Trigger a disconnection and wait for it to complete.

Parameters
connConnection object to disconnect
Return values
0on success
-errnoError code bt_conn_disconnect

◆ bt_conn_disconnect_wait()

int bt_conn_disconnect_wait ( struct bt_conn * conn,
k_timeout_t timeout )

#include <infuse/bluetooth/gatt.h>

Wait for a connection to disconnect, without initiating it.

Parameters
connConnection object to wait for
timeoutDuration to wait for
Return values
0on success
-errnoError code bt_conn_disconnect

◆ bt_conn_le_auto_setup()

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 )

#include <infuse/bluetooth/gatt.h>

Setup a connection with automatic MTU exchange and characteristic discovery.

This should be called immediately following bt_conn_le_create to ensure that the context is setup correctly by the time the connection establishes.

Parameters
connConnection object allocated by bt_conn_le_create
discoveryCharacteristic discovery configuration
callbacksCallbacks to call on connection/disconnection
preferred_phyBitmask of preferred PHYs to use for the connection BT_GAP_LE_PHY_*

◆ bt_conn_rssi()

int8_t bt_conn_rssi ( struct bt_conn * conn)

#include <infuse/bluetooth/gatt.h>

Get last measured RSSI on a connection.

Parameters
connBluetooth connection to query
Returns
int8_t Last measured RSSI in dBm (0 before measurement)

◆ bt_conn_rssi_log()

void bt_conn_rssi_log ( struct bt_conn * conn,
uint8_t tdf_loggers )

#include <infuse/bluetooth/gatt.h>

Start logging the RSSI of the connection.

This state only persists until the connection is lost. This function must therefore be called each time the connection is established.

Parameters
connBluetooth connection to log
tdf_loggersTDF loggers to log RSSI to