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

BLE Scanning (central) vs Adverising (Peripheral)

Hi guys,

I am working with a central battery powered so, I am controlling the RF activity calling scan_start() or sd_ble_gap_scan_start() and disabling the RF activity with sd_ble_gap_scan_stop() after 20ms

My scan_interval and scan_window have the following values and have equals values to have the radio activity 100%:

SCAN_INTERVAL= 6.25ms  
SCAN_WINDOW = 6.25ms 

My question is how influence the SCAN_WINDOW and SCAN_INTERVAL values inside the the a RF activity enabled by scan_start() if the Central RF activity time is lower or greater than the advertising time 20ms or some else

Will it make my central less responsive? if the Scan window/interval are greater than the Advertising time

Thanks

Parents
  • Hello Mufasa1

    The scan interval sets the time between two scans, and the time window sets how long the device should scan during said interval. Advertisement happens on three different channels, and every time a scan starts it scans one of those channels. The next time it starts a scan, it scans the next channel etc.

    By setting both the interval and window to 6.25 ms, your device is continuously scanning, with the exception of a minor interval between scans when it changes channel. It will keep scanning one channel for 6.25 ms, before it moves on to the next. With 20ms before you stop the advertisement you will manage to scan all three channels.

    As long as the advertiser uses all three advertisement channels it will advertise on all three channels, once every advertisement intverval. If you are continuously scanning one of the channels, you should be able to pick up the advertisement the moment it happens.

    In relation to reducing power consumption it might be more beneficial to simply use the scan interval and scan window at appropriate settings, and allow the chip to sleep between scans.

    You can read more on the scanner timings on page 63 in the Softdevice documentation here.

    Information on scanning and advertisement in general can be found on the blog here.

    Best regards

    Jørn Frøysa

Reply
  • Hello Mufasa1

    The scan interval sets the time between two scans, and the time window sets how long the device should scan during said interval. Advertisement happens on three different channels, and every time a scan starts it scans one of those channels. The next time it starts a scan, it scans the next channel etc.

    By setting both the interval and window to 6.25 ms, your device is continuously scanning, with the exception of a minor interval between scans when it changes channel. It will keep scanning one channel for 6.25 ms, before it moves on to the next. With 20ms before you stop the advertisement you will manage to scan all three channels.

    As long as the advertiser uses all three advertisement channels it will advertise on all three channels, once every advertisement intverval. If you are continuously scanning one of the channels, you should be able to pick up the advertisement the moment it happens.

    In relation to reducing power consumption it might be more beneficial to simply use the scan interval and scan window at appropriate settings, and allow the chip to sleep between scans.

    You can read more on the scanner timings on page 63 in the Softdevice documentation here.

    Information on scanning and advertisement in general can be found on the blog here.

    Best regards

    Jørn Frøysa

Children
Related