Removing beacon mode set with NRF.setScanResponse

Posted on
  • Hi. In the Eddystone beacon tutorial it says that we can broadcast beacon url together with other advertising by using

    NRF.setScanResponse(require("ble_eddysto­ne").get("goo.gl/B3J0Oc"));
    

    Which works fine, but I cannot find a way to turn off beacon advertising,

    NRF.setAdvertising({});
    

    doesn't seems to work, is there another command I should use? Thanks.

  • 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:

    require("ble_eddystone").advertise("goo.­gl/B3J0Oc");
    

    This also works too:

    NRF.setAdvertising([require("ble_eddysto­ne").get("goo.gl/B3J0Oc")]);
    

    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 :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Removing beacon mode set with NRF.setScanResponse

Posted by Avatar for Pi @Pi

Actions