Skip to content

Instantly share code, notes, and snippets.

@mlusiak
Created April 20, 2017 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlusiak/6becf8d194fe92f40a665a668b060fd8 to your computer and use it in GitHub Desktop.
Save mlusiak/6becf8d194fe92f40a665a668b060fd8 to your computer and use it in GitHub Desktop.
var beacon = require('beacon-pie');
console.log("Wait for the UART to initialize");
setTimeout(function() {
    console.log("UART should be ready by now");
    // setting first advertiser with power 4db, 400ms interval, Local Name "Test"
    beacon.setAdvertisingPacket(1, 4, 400, "Test");
    // same settings for 2nd advetiser, with bigger granularity
    beacon.enableAdvertiser(2) 
    beacon.setBroadcastingPower(2, 4);
    beacon.setBroadcastingInterval(2, 400);
    beacon.setLocalName(2, "Test");
}, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment