noble-winrt
noble-winrt copied to clipboard
turning windows BT off and on results in no scanning.
workaround is to add a setTimeout delay like this in your JS code:
noble.on('stateChange', (state) => {
console.log('BLE stateChange:', state);
if (state === 'poweredOn') {
setTimeout(() => {
//start scanning here.
}, 300);
}
if (state === 'poweredOff') {
// stop scanning, etc
}
});