Skip to content

Instantly share code, notes, and snippets.

@sandeepmistry
Created February 12, 2014 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandeepmistry/8947414 to your computer and use it in GitHub Desktop.
Save sandeepmistry/8947414 to your computer and use it in GitHub Desktop.
node.js script to mimic the iBeacons at Mobile World Congress 2014 - http://mwc.mobisfera.com
var bleno = require('bleno');
var uuid = 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'.replace(/-/g, '');
var major = 21047;
var minorStart = 0;
var minorEnd = 5;
var measuredPower = -59;
console.log("MWC Scavenger Hunt");
var minor = minorStart;
setInterval(function() {
bleno.stopAdvertising();
if (minor > minorEnd) {
process.exit(0);
}
console.log('minor = ' + minor);
bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower);
minor++;
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment