I am building a system that periodically emits a beacon (ADV_NONCONN_IND) at the same time as scanning the central role using S132 v7.2.0.
Regarding the subject, when I checked the past Q&A, I recognized it as follows.
- The devices cannot scan and advertise at the same time. When adv role overlaps scan role, it round robins.
- The scan timing is defined by setting ble_gap_scan_params_t::.interval and .window in nrf_ble_scan_init(), and scanning is performed for the period of .window every .interval from the time of nrf_ble_scan_start().
- The advertise timing is defined by setting ble_gap_adv_params_t::.interval with sd_ble_gap_adv_set_configure(), and is sent at intervals of .interval from the time of ble_advertising_start().
For example, if you set scan_interval=1000ms, scan_window=1000ms(100% scanning), adv_interval=100ms and set scan_start and advertising_start at the same time, scan and adv (9-10 times) will be performed every 1000ms.
Also, if you set scan_interval=100ms, scan_window=50ms(50% scanning), adv_interval=100ms, alternately repeat adv with 100ms interval (9-12 times) and adv with 200ms interval (4-5 times), maybe 200ms It is considered that scanning is performed in between.
The goal is to send a stable 100ms advertising beacon and scan in the free timeslot.
As a trial, setting scan_interval=50ms, scan_window=40ms (80% scan), adv_interval=100ms resulted in a stable advertisement every 100ms.
What is the scan window at this time?
How do I adjust these parameters for the timeslot scheduling rules?
Also, it would be nice to be able to visually check the scan window using a sniffer, is there a better way? It would be nice if the scan window state could be output on/off at the port.
best regard.
