Skip to content

Instantly share code, notes, and snippets.

@toru-takahashi
Created February 5, 2014 11:14
Show Gist options
  • Save toru-takahashi/8821414 to your computer and use it in GitHub Desktop.
Save toru-takahashi/8821414 to your computer and use it in GitHub Desktop.
var Bleacon = require('bleacon');
Bleacon.startScanning();
var logger = require('fluent-logger');
logger.configure('td.ibeacon_db', {host: 'localhost', port: 24224});
Bleacon.on('discover', function(bleacon) {
console.log(bleacon);
logger.emit('ibeacon_table', {
uuid: bleacon.uuid,
major: bleacon.major,
minor: bleacon.minor,
measuredPower: bleacon.measuredPower,
rssi: bleacon.rssi,
accuracy: bleacon.accuracy,
proximity: bleacon.proximity
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment