Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
noble.on('stateChange', function (state) {
if (state === 'poweredOn') {
// Note, tritag *does not* advertise it's service uuid, only eddystone/summon
noble.startScanning(SUMMON_SERVICE_UUIDS, true);
console.log('Started scanning.');
}
});
await new Promise((resolve, reject) => {
noble.startScanning([ROOT_SERVICE_UUID], true, error => {
if (error) {
return reject(error);
}
return resolve();
});
});
await wait(timeout);
function scan(state){
if (state === 'poweredOn') {
noble.startScanning();
console.log("Started scanning");
} else {
noble.stopScanning();
console.log("Is Bluetooth on?");
}
}
function scan(state){
if (state === 'poweredOn') {
noble.startScanning();
console.log("Started scanning");
} else {
noble.stopScanning();
console.log("Is Bluetooth on?");
}
}
function scan(state){
if (state === 'poweredOn') {
noble.startScanning();
console.log("Started scanning");
} else {
noble.stopScanning();
console.log("Is Bluetooth on?");
}
}
function scan(state){
if (state === 'poweredOn') {
noble.startScanning();
console.log("Started scanning");
} else {
noble.stopScanning();
console.log("Is Bluetooth on?");
}
}
function scan(state){
if (state === 'poweredOn') {
noble.startScanning();
console.log("Started scanning");
} else {
noble.stopScanning();
console.log("Is Bluetooth on?");
}
}
BLEScanner.prototype._startScanning = function (state) {
if (state === 'poweredOn') {
noble.startScanning([], true);
}
else {
noble.stopScanning();
}
};
noble.on('stateChange', state => {
if (state === 'poweredOn') {
noble.startScanning(['181d'], true);
} else {
noble.stopScanning();
}
});
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
log.info('Starting scan', {location:location});
noble.startScanning([uribeaconUUID], true);
}
});