So, just to be clear - you'd like to scan for iBeacons, and then have the Puck itself advertise the ID of any beacon that was found?
Scanning itself uses quite a lot of power (12mA compared to 0.02mA normally), but the good news is you don't have to do it for long (maybe 2 seconds).
NRF.findDevices automatically scans for a certain length of time and aggregates all the beacons that are found - unless you're somewhere that's got 100s of beacons within range then this is the one you want.
NRF.setScan scans continuously and calls a function every time an advertising packet is received.
Let me know if I'm right about the kind of thing you want above and I'll post up some code.
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.
Hi,
So, just to be clear - you'd like to scan for iBeacons, and then have the Puck itself advertise the ID of any beacon that was found?
Scanning itself uses quite a lot of power (12mA compared to 0.02mA normally), but the good news is you don't have to do it for long (maybe 2 seconds).
NRF.findDevices
automatically scans for a certain length of time and aggregates all the beacons that are found - unless you're somewhere that's got 100s of beacons within range then this is the one you want.NRF.setScan
scans continuously and calls a function every time an advertising packet is received.Let me know if I'm right about the kind of thing you want above and I'll post up some code.