Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turning windows BT off and on results in no scanning. #21

Open
pursual opened this issue Sep 25, 2020 · 0 comments
Open

turning windows BT off and on results in no scanning. #21

pursual opened this issue Sep 25, 2020 · 0 comments

Comments

@pursual
Copy link

pursual commented Sep 25, 2020

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
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant