Created
January 3, 2014 23:07
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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