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

Android discovery refresh #340

Merged
merged 2 commits into from
Sep 10, 2016

Conversation

dibari
Copy link
Contributor

@dibari dibari commented Sep 1, 2016

Android appears to cache discovered services (and subsequently characteristics and descriptors) at the system level. I found even removing and re-installing an app will not clear the cache. As such, I've added a boolean flag to the discover service, which when true calls an Android function to force re-discovery of the services.

A potential issue - some deeper googling indicates that some vendors remove this method from the bluetooth library. Perhaps they implement their own equivalent? In this case, it seems the function may not work on all android devices.

@randdusing
Copy link
Owner

I'll try this out later today or tomorrow. There's a couple nitpicky style changes I'll make, but the code looks functional. I have 3 Android devices I can try it out one

@randdusing randdusing merged commit b7ef5f7 into randdusing:master Sep 10, 2016
@randdusing
Copy link
Owner

Merged, made a few changes and will be available with next release.

@alexhisen
Copy link

FYI, at least on Samsung Galaxy S7 with Android 7, setting clearCache: true results in discover() never calling callbacks and it just stays in 'discovering' state indefinitely (until you try connect() 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

Successfully merging this pull request may close these issues.

3 participants