I modified the ble_app_att_mtu_throughput example to scan and advertise simultaneously. I want to have two nRF52’s that can read each other’s advertisements and pull out the rssi information to detect proximity to one another.
The problem is, it doesn’t seem that either board picks up the other’s advertisements in their respective event handler. The boards do pick up the advertisements of other nearby devices, and my nRF Connect mobile app can see both boards advertisements.
Is there any way I can get the boards to see one another?
EDIT: By event handler, I mean there is no advertising report events coming up in the ble_evt_handler.
Try the suggestions given by Kenneth in this ticket: https://devzone.nordicsemi.com/f/nordic-q-a/33826/how-to-improve-the-success-rate-of-scanning-ibeacon-stations
Thanks Simon, I'll take a look!
EDIT: Something I recently discovered is that the two boards do seem to pick up each other's advertisements in their scan event handlers, and are able to connect to one another. However, neither is picking up advertising reports from the other. Do you think this could have something to do with their scan responses?
Update: To anyone looking at this for help, I fixed the problem by handling the analysis of advertising reports not in ble_evt_handler but in scan_evt_handler. Scan events contain advertising reports too! :)
Hi kmassa5, I am working on similar project where I need to detect the proximity between two nRF52 modules by both of them. I wanted to ask how did you enable simultaneous scanning and advertising?
Did you just call `nrf_ble_scan_start()` and `ble_advertising_start()` back to back and then the SoftDevice handled the rest?.
Also, can you explain briefly (or point me to some resource) as how does simultaneous scanning and advertising work physically, I mean how are both of them time-slotted?
Sure! So I built it on top of the ble_att_mtu_throughput example which is built to scan and advertise (has scan_start and advertise_start functions). Basically you can set the advertising/scanning intervals (time between advertisements and scans) and scan window (how long out of the interval you’re scanning). There’s backend nordic code that schedules each event for you based on the info you set in sdk_config.