Skip to content

Instantly share code, notes, and snippets.

@mlusiak

mlusiak/test.js

Created Apr 20, 2017
Embed
What would you like to do?
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