Skip to content

BEKK-IoT/beacon-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beacon API

import { Beacon } from 'beacon';

Start advertising

"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 advertising

Stop your iBeacon

Beacon.stopAdvertising();

Start scanning

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

Stop scanning

Beacon.stopScanning();

Events

Discover

Bleacon.on('discover', function(bleacon) {
    // ...
});

Telemetry data

Bleacon.on('telemetrydata', function(telemetrydata) {
    // ...
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published