25#ifndef BLE_CONN_STATE_H__
26#define BLE_CONN_STATE_H__
50#define BLE_CONN_STATE_MAX_CONNECTIONS BLE_GAP_ROLE_COUNT_COMBINED_MAX
53#define BLE_CONN_STATE_USER_FLAG_INVALID CONFIG_BLE_CONN_STATE_USER_FLAG_COUNT
struct ble_conn_state_conn_handle_list ble_conn_state_central_handles(void)
Get a list of connection handles in which the role of the local device is BLE_GAP_ROLE_CENTRAL.
uint8_t ble_conn_state_role(uint16_t conn_handle)
Get the role of the local device in a connection.
int ble_conn_state_user_flag_acquire(void)
Obtain exclusive access to one of the user flag collections.
void ble_conn_state_user_flag_set(uint16_t conn_handle, uint16_t flag_index, bool value)
Set the value of a user flag.
uint16_t ble_conn_state_conn_idx(uint16_t conn_handle)
Translate a connection handle to a value that can be used as an array index.
uint32_t ble_conn_state_central_conn_count(void)
Get the total number of connections in which the role of the local device is BLE_GAP_ROLE_CENTRAL.
bool ble_conn_state_lesc(uint16_t conn_handle)
Check whether a connection was bonded using LE Secure Connections (LESC).
bool ble_conn_state_encrypted(uint16_t conn_handle)
Check whether a connection is encrypted.
void ble_conn_state_init(void)
Initialize or reset the module.
bool ble_conn_state_valid(uint16_t conn_handle)
Check whether a connection handle represents a valid connection.
uint32_t ble_conn_state_peripheral_conn_count(void)
Get the total number of connections in which the role of the local device is BLE_GAP_ROLE_PERIPH.
bool ble_conn_state_user_flag_get(uint16_t conn_handle, uint16_t flag_index)
Read the value of a user flag.
bool ble_conn_state_mitm_protected(uint16_t conn_handle)
Check whether a connection encryption is protected from Man in the Middle (MITM) attacks.
struct ble_conn_state_conn_handle_list ble_conn_state_conn_handles(void)
Get a list of all connection handles for which the module has a record.
uint32_t ble_conn_state_conn_count(void)
Get the total number of connections.
uint32_t ble_conn_state_for_each_set_user_flag(uint16_t flag_index, ble_conn_state_user_function_t user_function, void *ctx)
Run a function for each connection that has a user flag set.
struct ble_conn_state_conn_handle_list ble_conn_state_periph_handles(void)
Get the handle for the connection in which the role of the local device is BLE_GAP_ROLE_PERIPH.
uint32_t ble_conn_state_for_each_connected(ble_conn_state_user_function_t user_function, void *ctx)
Run a function for each active connection.
#define BLE_CONN_STATE_MAX_CONNECTIONS
Definition ble_conn_state.h:50
ble_conn_state_status
Connection handle statuses.
Definition ble_conn_state.h:38
@ BLE_CONN_STATUS_INVALID
Definition ble_conn_state.h:40
@ BLE_CONN_STATUS_CONNECTED
Definition ble_conn_state.h:46
@ BLE_CONN_STATUS_DISCONNECTED
Definition ble_conn_state.h:44
void(* ble_conn_state_user_function_t)(uint16_t conn_handle, void *ctx)
Function to be called when a flag ID is set.
Definition ble_conn_state.h:72
uint32_t len
Definition ble_conn_state.h:58
uint16_t conn_handles[BLE_GAP_ROLE_COUNT_COMBINED_MAX]
Definition ble_conn_state.h:60
Type used to present a list of conn_handles.
Definition ble_conn_state.h:56