Skip to content

Instantly share code, notes, and snippets.

@sammachin
Created January 7, 2014 12:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sammachin/8298386 to your computer and use it in GitHub Desktop.
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.
#! /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
Copy link
Author

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