This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

S120 scanning can not be sustained

Hi,

There are two advertise nodes, only broadcast (one packet/s) . The S120 star scan. At the beginning everything is OK,but after a while, maybe 3-5 minutes, only one advertise node can be discovered. Then, after an other 3-5 minutes, the scan return to normal.And this appearance happened periodically, seem there some buffer not be cleaned, or need reset.

For find out what the reason, 1,Already use packet sniffer to test and verify at the same time. 2,Only the most basic codes stay in program.

=========================here the codes ===================SDK 6.1================

SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, false);
err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
APP_ERROR_CHECK(err_code);
err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
APP_ERROR_CHECK(err_code);

    m_scan_param.active       = 0;            // Active scanning set.
    m_scan_param.selective    = 0;            // Selective scanning not set.
    m_scan_param.interval     = 0x00A0;     // Scan interval.
    m_scan_param.window       = 0x00A0;   // Scan window.
    m_scan_param.p_whitelist  = NULL;         // No whitelist provided.
    m_scan_param.timeout      = 0x0000;       // No timeout.

    err_code = sd_ble_gap_scan_start(&m_scan_param);
    APP_ERROR_CHECK(err_code);
Parents
  • It is a bug with the S120, you can't have the scanning window equal to the scanning interval.

    A workaround should be to decrease the scanning window slightly, please try 0x009E instead of 0x00A0.

    m_scan_param.interval     = 0x00A0;  // Scan interval.
    m_scan_param.window       = 0x009E;  // Scan window.
    

    @boyu: I don't know the details behind why it is 1.25ms, but somehow the scanner doesn't have time to restart.

    I have done some testing, and it seems that 1.25ms is enough, or minus 2 as you say. But 0x3E8 is not 1000ms, because it is 0x3E80.625ms = 10000.625ms = 625ms.

    You should use:

    m_scan_param.interval     = 0x0640;  // Scan interval.
    m_scan_param.window       = 0x063E;  // Scan window.
    
Reply
  • It is a bug with the S120, you can't have the scanning window equal to the scanning interval.

    A workaround should be to decrease the scanning window slightly, please try 0x009E instead of 0x00A0.

    m_scan_param.interval     = 0x00A0;  // Scan interval.
    m_scan_param.window       = 0x009E;  // Scan window.
    

    @boyu: I don't know the details behind why it is 1.25ms, but somehow the scanner doesn't have time to restart.

    I have done some testing, and it seems that 1.25ms is enough, or minus 2 as you say. But 0x3E8 is not 1000ms, because it is 0x3E80.625ms = 10000.625ms = 625ms.

    You should use:

    m_scan_param.interval     = 0x0640;  // Scan interval.
    m_scan_param.window       = 0x063E;  // Scan window.
    
Children
Related