Functions | |
void | ble_conn_state_init (void) |
Function for initializing or resetting the module. More... | |
void | ble_conn_state_on_ble_evt (ble_evt_t *p_ble_evt) |
Function for providing BLE SoftDevice events to the connection state module. More... | |
bool | ble_conn_state_valid (uint16_t conn_handle) |
Function for querying whether a connection handle represents a valid connection. More... | |
uint8_t | ble_conn_state_role (uint16_t conn_handle) |
Function for querying the role of the local device in a connection. More... | |
ble_conn_state_status_t | ble_conn_state_status (uint16_t conn_handle) |
Function for querying the status of a connection. More... | |
bool | ble_conn_state_encrypted (uint16_t conn_handle) |
Function for querying whether a connection is encrypted. More... | |
bool | ble_conn_state_mitm_protected (uint16_t conn_handle) |
Function for querying whether a connection encryption is protected from Man in the Middle attacks. More... | |
uint32_t | ble_conn_state_n_connections (void) |
Function for querying the total number of connections. More... | |
uint32_t | ble_conn_state_n_centrals (void) |
Function for querying the total number of connections in which the role of the local device is BLE_GAP_ROLE_CENTRAL. More... | |
uint32_t | ble_conn_state_n_peripherals (void) |
Function for querying the total number of connections in which the role of the local device is BLE_GAP_ROLE_PERIPH. More... | |
sdk_mapped_flags_key_list_t | ble_conn_state_conn_handles (void) |
Function for obtaining a list of all connection handles for which the module has a record. More... | |
sdk_mapped_flags_key_list_t | ble_conn_state_central_handles (void) |
Function for obtaining a list of connection handles in which the role of the local device is BLE_GAP_ROLE_CENTRAL. More... | |
sdk_mapped_flags_key_list_t | ble_conn_state_periph_handles (void) |
Function for obtaining the handle for the connection in which the role of the local device is BLE_GAP_ROLE_PERIPH. More... | |
ble_conn_state_user_flag_id_t | ble_conn_state_user_flag_acquire (void) |
Function for obtaining exclusive access to one of the user flag collections. More... | |
bool | ble_conn_state_user_flag_get (uint16_t conn_handle, ble_conn_state_user_flag_id_t flag_id) |
Function for reading the value of a user flag. More... | |
void | ble_conn_state_user_flag_set (uint16_t conn_handle, ble_conn_state_user_flag_id_t flag_id, bool value) |
Function for setting the value of a user flag. More... | |
sdk_mapped_flags_t | ble_conn_state_user_flag_collection (ble_conn_state_user_flag_id_t flag_id) |
Function for getting the state of a user flag for all connection handles. More... | |
sdk_mapped_flags_key_list_t ble_conn_state_central_handles | ( | void | ) |
Function for obtaining a list of connection handles in which the role of the local device is BLE_GAP_ROLE_CENTRAL.
This function takes into account connections whose state is BLE_CONN_STATUS_DISCONNECTED.
sdk_mapped_flags_key_list_t ble_conn_state_conn_handles | ( | void | ) |
Function for obtaining a list of all connection handles for which the module has a record.
This function takes into account connections whose state is BLE_CONN_STATUS_DISCONNECTED.
bool ble_conn_state_encrypted | ( | uint16_t | conn_handle | ) |
Function for querying whether a connection is encrypted.
[in] | conn_handle | Handle of connection to get the encryption state for. |
true | If the connection is encrypted. |
false | If the connection is not encrypted or conn_handle is invalid. |
void ble_conn_state_init | ( | void | ) |
Function for initializing or resetting the module.
This function sets all states to their default, removing all records of connection handles.
bool ble_conn_state_mitm_protected | ( | uint16_t | conn_handle | ) |
Function for querying whether a connection encryption is protected from Man in the Middle attacks.
[in] | conn_handle | Handle of connection to get the MITM state for. |
true | If the connection is encrypted with MITM protection. |
false | If the connection is not encrypted, or encryption is not MITM protected, or conn_handle is invalid. |
uint32_t ble_conn_state_n_centrals | ( | void | ) |
Function for querying the total number of connections in which the role of the local device is BLE_GAP_ROLE_CENTRAL.
uint32_t ble_conn_state_n_connections | ( | void | ) |
Function for querying the total number of connections.
uint32_t ble_conn_state_n_peripherals | ( | void | ) |
Function for querying the total number of connections in which the role of the local device is BLE_GAP_ROLE_PERIPH.
void ble_conn_state_on_ble_evt | ( | ble_evt_t * | p_ble_evt | ) |
Function for providing BLE SoftDevice events to the connection state module.
[in] | p_ble_evt | The SoftDevice event. |
sdk_mapped_flags_key_list_t ble_conn_state_periph_handles | ( | void | ) |
Function for obtaining the handle for the connection in which the role of the local device is BLE_GAP_ROLE_PERIPH.
This function takes into account connections whose state is BLE_CONN_STATUS_DISCONNECTED.
uint8_t ble_conn_state_role | ( | uint16_t | conn_handle | ) |
Function for querying the role of the local device in a connection.
[in] | conn_handle | Handle of the connection to get the role for. |
ble_conn_state_status_t ble_conn_state_status | ( | uint16_t | conn_handle | ) |
Function for querying the status of a connection.
[in] | conn_handle | Handle of the connection. |
ble_conn_state_user_flag_id_t ble_conn_state_user_flag_acquire | ( | void | ) |
Function for obtaining exclusive access to one of the user flag collections.
The acquired collection contains one flag for each connection. These flags can be set and read individually for each connection.
The state of user flags will not be modified by the connection state module, except to set it to 0 for a connection when that connection is invalidated.
sdk_mapped_flags_t ble_conn_state_user_flag_collection | ( | ble_conn_state_user_flag_id_t | flag_id | ) |
Function for getting the state of a user flag for all connection handles.
The returned collection can be used with the Mapped flags API. The returned collection is a copy, so modifying it has no effect on the conn_state module.
[in] | flag_id | Which flag to get states for. |
bool ble_conn_state_user_flag_get | ( | uint16_t | conn_handle, |
ble_conn_state_user_flag_id_t | flag_id | ||
) |
Function for reading the value of a user flag.
[in] | conn_handle | Handle of connection to get the flag state for. |
[in] | flag_id | Which flag to get the state for. |
void ble_conn_state_user_flag_set | ( | uint16_t | conn_handle, |
ble_conn_state_user_flag_id_t | flag_id, | ||
bool | value | ||
) |
Function for setting the value of a user flag.
[in] | conn_handle | Handle of connection to set the flag state for. |
[in] | flag_id | Which flag to set the state for. |
[in] | value | Value to set the flag state to. |
bool ble_conn_state_valid | ( | uint16_t | conn_handle | ) |
Function for querying whether a connection handle represents a valid connection.
A connection might be valid and have a BLE_CONN_STATUS_DISCONNECTED status. Those connections are invalidated after a new connection occurs.
[in] | conn_handle | Handle of the connection. |
true | If conn_handle represents a valid connection, thus a connection for which we have a record. |
false | If conn_handle is BLE_GAP_ROLE_INVALID, or if it has never been recorded. |