This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to determine if central fails to connect to peripheral

I am using a central S130 softdevice in an nRF51822. I connect to a peripheral using sd_ble_gap_connect(&m_peripheral_address, &m_scan_param, &m_connection_param). If it is able to establish a connection to the peripheral, everything proceeds as expected. However, if for some reason, it can't connect (e.g. the peripheral has moved out of range), sd_ble_gap_connect still returns NRF_SUCCESS, and I see no events that indicate that the connection failed, even after an extended period of time. My connection parameters are min_conn_interval = 6, max_conn_interval = 24, slave_latency = 0 and conn_sup_timeout = 400.

Is there any mechanism for communicating back that a connection couldn't be made? Thanks!

Related