I am developing an app that uses both a central and a peripheral device using Nordic SDK 8.1. I was working off the hrm example code and wanted to move all the scanning methods to their own file to clean up the project. After doing that I get the following error on the central device when I try to connect to the peripheral: Connection Request Failed, reason 7
What does this error mean and how can I fix it?
I think the specific line of code that is breaking it is this:
err_code = sd_ble_gap_scan_stop();
if (err_code != NRF_SUCCESS)
{
printf("[APPL]: Scan stop failed, reason %d\r\n", err_code);
}
err_code = bsp_indication_set(BSP_INDICATE_IDLE);
APP_ERROR_CHECK(err_code);
m_scan_param.selective = 0;
// Initiate connection.
err_code = sd_ble_gap_connect(&p_gap_evt->params.adv_report.peer_addr,
&m_scan_param,
&m_connection_param);
m_whitelist_temporarily_disabled = false;
if (err_code != NRF_SUCCESS)
{
printf("[APPL]: Connection Request Failed, reason %d\r\n", err_code);
}