Last active
July 14, 2020 17:43
-
-
Save eklimcz-zz/b37c05b29d9ac7cdd040 to your computer and use it in GitHub Desktop.
Noble basic scan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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);
});`