Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

stateChange is always poweredOn #5

Open
felixsyc opened this issue Nov 20, 2018 · 2 comments
Open

stateChange is always poweredOn #5

felixsyc opened this issue Nov 20, 2018 · 2 comments

Comments

@felixsyc
Copy link

Hi! I would like to ask if there's a way to check bluetooth state is on or off?
I try switching the windows bluetooth on and off, but it's always stay in the state of "poweredOn".
Even when i try relaunching with bluetooth state off, it's still detect as "poweredOn".

noble.on('stateChange', function(state) {
console.log(state);
if (state === 'poweredOn') {
noble.startScanning();
} else {
noble.stopScanning();
}
});

@urish
Copy link
Owner

urish commented Nov 20, 2018

This is not supported. If you want to implement it, that'd have to be implemented in BLEServer first. Then you'd need to adapt the bindings.js file accordingly.

I don't have any intent to implement it, but if you send a PR I am willing to spend the time to review it and eventually merge it.

@btetz14
Copy link

btetz14 commented Jun 25, 2019

I've made the changes needed to fix this issue to my fork of this repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants