Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function onStateChanged(state) {
if (state === 'poweredOn') {
current.poweredOn = true;
console.log('Bluetooth: Powered On.');
bleno.startAdvertising(constants.NAME, serviceUUIDs);
}
else {
current.poweredOn = false;
console.log('Bluetooth: Powered Off.');
bleno.stopAdvertising();
}
}