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

state / stateChange behavior [Android] #23

Open
Cody-G-G opened this issue Dec 2, 2016 · 1 comment
Open

state / stateChange behavior [Android] #23

Cody-G-G opened this issue Dec 2, 2016 · 1 comment

Comments

@Cody-G-G
Copy link

Cody-G-G commented Dec 2, 2016

I am a bit confused as to how state / stateChange work...I initially assumed that a stateChange event would be automatically emitted when the user enables / disables bluetooth, but this doesn't seem to be the case. I then thought I should check whether bluetooth is on or off (whenever I need it), and change the state + emit event myself (" noble.state = 'poweredOn; noble.emit('stateChange', 'poweredOn' "), but even though this changes the noble.state to whatever I want it to, when I try and scan for devices, the scan actually starts but doesn't actually find anything (even though there are devices to be found).

In short: if I start the app with bluetooth off, I don't seem to be able to find devices even though I subsequently enable bluetooth, change noble state to 'poweredOn', and emit the appropriate 'stateChange' event.

I would greatly appreciate anyone shedding some light on this, and whether this behavior is normal (but I'm doing it wrong), or is it a bug?

@Cody-G-G Cody-G-G changed the title state / stateChange [Android] state / stateChange behavior [Android] Dec 3, 2016
@nielsswinkels
Copy link

I have the same issue, that there is no stateChange event when you enable/disable bluetooth on android. I would say that's a bug?

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

2 participants