Hi,
I'm developing nRF51 proximity based device using nRF51822 that acts as BLE peripheral. It advertises continuously using connectable indirect mode. User has Android smartphone with dedicated application. When user comes closer to the device than some given distance (i.e. 2 meters) smartphone app should connect to it and exchange some data. Distance measurement is based on RSSI.
Problem is that in Android during BLE scan most phones report each device only once if it's using connectable advertisements. Only for beacons (non connectable, indirect slow advertisement) RSSI is reported for each advert. packet. I want to be able to measure RSSI of multiple advertising packets and be able to connect to the device.
What I've tried so far:
- searching Android documentation for a way to modify default behavior of BLE scanner. I've found it for iOS but not for Android.
- various modifications to Android scan process (i.e. starting BLE scan for 1s, aborting it and restarting after short delay) - this works for some devices but ranging data are very unreliable and I get very little advertising packets compared to beacon and continuous scan.
- change advertisement parameters of nRF51 to those used by SDK beacon example while keeping BLE services set up. Ranging works fine but during connection attempt board reboots.
Last idea I have is to set up nRF51 to advertise as 2 devices - beacon and connectable device at the same time. Is it possible and if yes could you point me to some example code / documentation of how to do it?
Alternatively - is there other way to achieve my goal - forcing Android to report given device multiple times in single BLE scan while retaining ability to connect to it?