Target is not to have the real distance. It is something simpler.
Target is to check whether another device is very very close. True or false. Let's say 10 or 15 cms is close so our check is true and any device further away fails the check and it is false.
My first approach was to use api's method fetchUuidsWithSdp()
but it failed!
Latency seemed the same whether the devices where a couple of cms away or at the other end of a large room!
Any solution even without bluetooth is acceptable. For instance, I am totally unfamiliar with the wifi direct p2p protocol. Maybe there could be something in there useful to have a rough estimation of distance.
Edit: I am reading about Received Signal Strength Indicator(RSSI). This could be used for our particular case, a rough estimation of distance between devices. But maybe there could be something to combine in order to improve the accuracy.
Edit: I put Ralgha's answer to the test. I did established a connection and had a minor protocol to ping-pong among devices.
When ping-ponged with 1 byte average latency was 22.6000 msec when very close and 22.6087 msec when on the other corner of the room.
When ping-ponged with 1024 bytes average latency was 40.3173 msec when very close and even smaller, 32.3138 msec, when on the other corner of the room.
After all, indeed, latency does not carry any information about distance!
Thanks!
Beacon technology generally estimates the distance between devices using the received signal strength (RSSI). Localization of Bluetooth devices is done by combining the distance estimate to several beacons, mounted at fixed and known locations, using triangulation with at least 3 anchors.
The signal strength depends on distance and Broadcasting Power value. Bluetooth works with broadcasting signals and that broadcasting power value is around 2–4 dBm — and due to that, the signal RSSI strength will be around -26 (a few inches) to -100 (40–50 m distance).
The 'WifiNanScan app lets you measure distance with a precision of about one metre with phones up to 15 metres apart. Google has launched a new WifiNanScan app for developers on the Google Play store.
You can measure distance with sound.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With