import { Beacon } from 'beacon';
"Create" an iBeacon
var uuid = 'e2c56db5dffb48d2b060d0f5a71096e0';
var major = 0; // 0 - 65535
var minor = 0; // 0 - 65535
var measuredPower = -59; // -128 - 127 (measured RSSI at 1 meter)
Beacon.startAdvertising(uuid, major, minor, measuredPower);
Stop your iBeacon
Beacon.stopAdvertising();
var uuid = 'e2c56db5dffb48d2b060d0f5a71096e0';
var major = 0; // 0 - 65535
var minor = 0; // 0 - 65535
Beacon.startScanning([uuid], [major], [minor]);
Examples
Beacon.startScanning(); // scan for any beacons
Beacon.startScanning(uuid); // scan for beacons with a particular uuid
Beacon.startScanning(uuid, major); // scan for beacons with a particular uuid and major
Beacon.startScanning(uuid, major, minor); // scan for beacons with a particular uuid. major, and minor
Beacon.stopScanning();
Bleacon.on('discover', function(bleacon) {
// ...
});
Bleacon.on('telemetrydata', function(telemetrydata) {
// ...
});