You can use NRF.sleep() to completely turn off advertising, but the issue there is it turns off everything. A ScanResponse is sent in response to a query on an Advertising packet, so if there's no advertising then it's no use at all. If you use NRF.sleep() without a way to call NRF.wake() (eg. on a button press) then it effectively turns your Puck into a paperweight until you reset it :)
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.
If you don't want to advertise Puck.js normally at all and just want Eddystone then you can just use the standard Eddystone example:
This also works too:
You can use
NRF.sleep()
to completely turn off advertising, but the issue there is it turns off everything. A ScanResponse is sent in response to a query on an Advertising packet, so if there's no advertising then it's no use at all. If you useNRF.sleep()
without a way to callNRF.wake()
(eg. on a button press) then it effectively turns your Puck into a paperweight until you reset it :)