Is there a function within the nRF51822 SDK to check if BLE is connected or not (or to check general BLE connection state)?
Thanks.
Hi, Nick,
Not necessary to set a flag for this purpose. You should have a connection handle for the BLE operation (e.g. m_conn_handle
), which is used in sd_ble_gap_disconnect(m_conn_handle, ...)
if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
{
/* BLE is connected. Do something. */
} else
{
/* BLE is not connected. Do something. */
}
Hi, Nick,
Not necessary to set a flag for this purpose. You should have a connection handle for the BLE operation (e.g. m_conn_handle
), which is used in sd_ble_gap_disconnect(m_conn_handle, ...)
if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
{
/* BLE is connected. Do something. */
} else
{
/* BLE is not connected. Do something. */
}