noble-winrt icon indicating copy to clipboard operation
noble-winrt copied to clipboard

turning windows BT off and on results in no scanning.

Open pursual opened this issue 4 years ago • 0 comments

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
  }
});

pursual avatar Sep 25 '20 04:09 pursual