The code should be exactly the same... You can just use setScan/requestDevice/etc and look at the rssi value in what's returned.
rssi
Or, if you've got an active connection between the two devices you can use setRSSIHandler (https://www.espruino.com/Reference#l_BluetoothRemoteGATTServer_setRSSIHandler) - with the active connection it is a lot more power efficient than constantly scanning for advertisments.
setRSSIHandler
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The code should be exactly the same... You can just use setScan/requestDevice/etc and look at the
rssi
value in what's returned.Or, if you've got an active connection between the two devices you can use
setRSSIHandler
(https://www.espruino.com/Reference#l_BluetoothRemoteGATTServer_setRSSIHandler) - with the active connection it is a lot more power efficient than constantly scanning for advertisments.