Create a gist now

Instantly share code, notes, and snippets.

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.
#! /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();
@sammachin
Owner

See http://www.youtube.com/watch?v=EBog4dZtb2U for a video of it in action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment