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

How to invalidate characteristics cache given that Service Changed is not implemented yet? #592

Open
zachmoshe opened this issue Aug 30, 2022 · 2 comments

Comments

@zachmoshe
Copy link

I look for the supported way to cause Chrome (or any browser) to invalidate the services and characteristic cache it holds on my device (still under development so I play with the services quite frequently). As far as I understand, the Service Changed characteristic is the bluetooth way to go, but it seems (here) that it's not implemented yet in any of the browsers.

Is there any other supported (and implemented) API to make the browser rediscover services?
If not - is there any cache folder that I can delete? (I assume that would be browser specific, I'm referring to Chrome here, but I guess any answer will be useful for some of the future readers)

@dlech
Copy link
Contributor

dlech commented Aug 30, 2022

The browser doesn't cache the services, it is all done in the OS Bluetooth stack, so clearing the cache is OS-specific.

If the services don't actually change at runtime, I would suggest using the Database Hash characteristic (0x2B2A) instead of Services Changed characteristic or using a random Bluetooth address so that the OS cache is avoided altogether.

@zachmoshe
Copy link
Author

Thanks! I wasn't aware of that.
IIUC I can just set a random value for the Database Hash Characteristic every time, right?

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