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

Ble scan only works the first time #138

Open
elhampour opened this issue Apr 11, 2017 · 5 comments
Open

Ble scan only works the first time #138

elhampour opened this issue Apr 11, 2017 · 5 comments

Comments

@elhampour
Copy link

I have an application. in my app i scan for ble devices. but it only works in just one way,
when my phone Bluetooth is off and i scan for ble , the plugin asks user to turn on Bluetooth , and then i finds the ble. but next time it does not work.

i mean it only finds the ble when the plugin asks user to turn on Bluetooth .

does any one know the problem ?

@storm1er
Copy link

storm1er commented Apr 12, 2017

what function do you use to search devices ?

EDIT : android 7.1, no problem with startScan

@elhampour
Copy link
Author

evothings.ble.startScan(onDeviceFound, onScanError, options)

i did test this a lot. but it only works the first time. android 5.1.1

@storm1er
Copy link

When using it 'stock', just console.log result
It call onDeviceFound like every ... 100ms or something, if there is a peripheral in sight, you get the same ph. in loop, endlessly.

@elhampour
Copy link
Author

the problem that i have , is it only works when my bl is off ,and the app automatically turns it on. after the first time i done get the any peripheral endlessly,

@storm1er
Copy link

storm1er commented May 1, 2017

Did you call 'stopScan' before 'startScan' again ?

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