Created
January 7, 2014 12:07
-
-
Save sammachin/8298386 to your computer and use it in GitHub Desktop.
Hack the CES Scavenger hunt ;-) You'll need a recent mac with BT4.0 running mavericks, and a copy of bleacon (npm install bleacon) start the scavenger hunt, then run this script and sit back.
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
#! /usr/bin/env node | |
var Bleacon = require('bleacon'); | |
var uuid = '842AF9C408F511E39282F23C91AEC05E'; | |
var major = 65000; | |
var measuredPower = -59; | |
function myLoop(){ | |
setTimeout(function () { | |
Bleacon.stopAdvertising(); | |
minor ++ | |
Bleacon.startAdvertising(uuid, major, minor, measuredPower); | |
console.log("Sending Beacon" + minor) | |
if (minor < 65010){ | |
myLoop() | |
} | |
else{ | |
console.log("Complete"); | |
Bleacon.stopAdvertising(); | |
} | |
}, 5000) | |
} | |
//First Beacon | |
var minor = 65001; // 0 - 65535 | |
Bleacon.startAdvertising(uuid, major, minor, measuredPower); | |
console.log("Sending Beacon" + minor); | |
//Loop through rest of beacons | |
myLoop(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See http://www.youtube.com/watch?v=EBog4dZtb2U for a video of it in action