Just a quick note on the BLE advertising code above - I didn't spot it at first.
Looks like NRF.setScan(function(d) { is being used. I'd strongly recommend just using NRF.requestDevice as this basically implements the 'stop after 1 packet received' internally, and will behave much better in areas where you'be got loads of BLE devices advertising
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.
Just a quick note on the BLE advertising code above - I didn't spot it at first.
Looks like
NRF.setScan(function(d) {
is being used. I'd strongly recommend just usingNRF.requestDevice
as this basically implements the 'stop after 1 packet received' internally, and will behave much better in areas where you'be got loads of BLE devices advertising