Skip to content

Instantly share code, notes, and snippets.

@don
Created January 3, 2014 23:07
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save don/8248454 to your computer and use it in GitHub Desktop.
Save don/8248454 to your computer and use it in GitHub Desktop.
Emulate iBeacons with NodeJS for the CES Scavenger Hunt App http://makezine.com/2014/01/03/hacking-the-ces-scavenger-hunt/
var bleno = require('bleno'),
uuid = '842AF9C408F511E39282F23C91AEC05E',
major = 65000,
minor = 65000,
measuredPower = -59;
var intervalId = setInterval(function() {
bleno.stopAdvertising();
minor++;
if (minor > 65009) {
clearInterval(intervalId);
console.log("Bye!");
return;
}
console.log(minor);
bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower);
}, 2000);
console.log("CES Scavenger Hunt");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment