You are reading a single comment by @Gordon and its replies.
Click here to read the full conversation.
-
Thanks for your responce, but this is
Uncaught Error: Field or method "name" does not already exist, and can't create it on Number at line 5 col 14 if (dev.name == "DiamondBeacon") found = true;
and when I use the simple example no name is displayed.. I want to scan with id(Mac address).
NRF.findDevices(print)
You can use
NRF.findDevices
to check for the beacons advertising around you can can then do things based on that: http://www.espruino.com/Reference#l_NRF_findDevicesEg.
However actually checking for surrounding beacons takes a lot of power, so you don't want to do it often, or for long. The example above does 1 second every 5 minutes, which is still quite a lot. If you were doing this to save power you're probably best off not bothering and just advertising regardless.