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

BLE scan timeout always in multiple of second

Hi there,

I'm developing applications with nRF52840, SoftDevice 6.1.1. Normally the scan timeout is in step of 10 ms. But whichever the value I set between seconds, e.g., 500ms, 1500ms, the actual scan timeout is 1 seconds, 2 seconds and etc.

This is the code snippet:

LOG_DEBUG(TRACE, "| interval(ms)   window(ms)   timeout(ms) |");
LOG_DEBUG(TRACE, "  %.3f        %.3f      %d", bleGapScanParams.interval*0.625, bleGapScanParams.window*0.625, bleGapScanParams.timeout*10);
int ret = sd_ble_gap_scan_start(&bleGapScanParams, &bleScanData_);


  

This is the log with timestamp:

    0000000435 TRACE:   interval(ms)   window(ms)   timeout(ms)

    0000000445 TRACE:   5.000             2.500             300

    0000001446 TRACE:   BLE GAP event: Scanning timeout (This is printed in the SoftDevice events interrupt handler)

Any hint would be really appreciated!

Parents Reply
  • Hi,

    No, this is a puzzle. I do not believe it is an issue with the SoftDevice itself. I have played around with a central example from SDK 15.3, using S140 version 6.0.1 and using that I have no problem settings can timeouts that are other than whole seconds. Also, this is not an issue I have seen before. I am tempted to believe that it is somehow related to your code.

    Did just suddenly see this issue, or did you see it just recently after some modifications? Could there be a memory corruption of some sort (just a shot in the dark)?

Children
Related