UNPKG

@abandonware/bleno

Version:

A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals

22 lines (16 loc) 492 B
const bleno = require('./index'); console.log('bleno - iBeacon'); bleno.on('stateChange', function(state) { console.log('on -> stateChange: ' + state); if (state === 'poweredOn') { bleno.startAdvertisingIBeacon('e2c56db5dffb48d2b060d0f5a71096e0', 0, 0, -59); } else { bleno.stopAdvertising(); } }); bleno.on('advertisingStart', function() { console.log('on -> advertisingStart'); }); bleno.on('advertisingStop', function() { console.log('on -> advertisingStop'); });