Skip to content

Instantly share code, notes, and snippets.

@eklimcz-zz
Last active July 14, 2020 17:43
Show Gist options
  • Save eklimcz-zz/b37c05b29d9ac7cdd040 to your computer and use it in GitHub Desktop.
Save eklimcz-zz/b37c05b29d9ac7cdd040 to your computer and use it in GitHub Desktop.
Noble basic scan
noble.startScanning();
noble.on(‘discover’, function(peripheral) {
var macAddress = peripheral.uuid;
var rss = peripheral.rssi;
var localName = advertisement.localName;
console.log('found device: ', macAdress, ' ', localName, ' ', rss);
}
@csotomon
Copy link

csotomon commented Aug 14, 2018

Hi, you have some code errors.

This is the fixed code

`const noble = require('noble');

noble.startScanning();

noble.on('discover', function(peripheral) {
let macAddress = peripheral.uuid;
let rssi = peripheral.rssi;
let localName = peripheral.advertisement.localName;
console.log('found device: ', macAddress, ' ', localName, ' ', rssi);
});`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment