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

BLE central scan, receives exactly one report

Using Softdevice 132 version 6.1.0

I issue the request for scanning by calling

sd_ble_gap_scan_start() with:
ble_gap_scan_params_t scan_params = {
{
    .extended = 0,
    .report_incomplete_evts = 0,
    .active = 0,
    .filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL, // 0
    .scan_phys = BLE_GAP_PHY_AUTO, // 0
    .interval = 64, // 40 msec
    .window = 48, // 30 msec
    .timeout = 0, // forever
    .channel_mask = {0}, // zero filled
    ._vptr.scan_parameters = 0x0
};



All starts well, I get an advertising report back via BLE event: 0x1d, the connection handle is 0xffff (this makes sense, there is no connection) and a valid RSSI. There are no unexpected asserts, nor any other unexpected behavior.

But I only ever receive one report. Exactly one.
I see in ble_gap.h, this comment on line 1228:

/* @note When ble_gap_adv_report_type_t::status is not set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA,
 *       scanning will be paused. To continue scanning, call @ref sd_ble_gap_scan_start.
 */

OK - well that would explain it. So within the callback of the report I again call sd_ble_gap_scan_start() with the same settings. This time the return value is NRF_ERROR_INVALID_STATE (8) indicating that scanning is already in progress.

And yet, there are no more reports.

Any thoughts on what might be going on?

I also tried setting the scan timeout to 0xFFFFu and still no change in behavior.

Related