Hello
The scanner causes the code to freeze when a debugger is not connected.
We are developing a system where one of our units is to run on the nRF52832. During development of the application we ran in to a problem after porting to SDK15 from 14.2 (and also from SoftDevice 5.0.0 to 6.0.0.
We are advertising and scanning for advertising packet data in intervals less than a second, every five seconds. With the new SoftDevice API, and the possibility for longer advertising packets we need to "continue" the scanner after recieving an advertisement packet using sd_ble_gap_scan_start(NULL, adv_report_buffer). This is done by the ble_event_handler as shown below:
static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
ret_code_t err_code = 0;
ble_gap_evt_t const * p_gap_evt = &p_ble_evt->evt.gap_evt;
switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_ADV_REPORT:
{
adv_parse(&p_gap_evt->params.adv_report);
sd_ble_gap_scan_start(NULL,&m_scan_buffer);
APP_ERROR_CHECK(err_code);
}break; // BLE_GAP_EVT_ADV_REPORT
case BLE_GAP_EVT_TIMEOUT:
{
if (p_gap_evt->params.timeout.src == BLE_GAP_TIMEOUT_SRC_SCAN)
{
sd_ble_gap_scan_stop();
APP_ERROR_CHECK(err_code);
}
} break;
default:
break;
}
}