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

Enable services changed on Generic Attribute service #405

Open
chadrockey opened this issue Jan 27, 2024 · 1 comment
Open

Enable services changed on Generic Attribute service #405

chadrockey opened this issue Jan 27, 2024 · 1 comment

Comments

@chadrockey
Copy link
Contributor

My iOS development device is constantly caching the gatt services and characteristics and won't forget them for 24 to 48 hours. Even with a restart and bluetooth off/on, it's so sticky and really slows development sometimes.

Is there a way to advertise the services changed characteristic on the Generic Attribute service?

The Generic Attribute service is 0x1801 (00001801-0000-1000-8000-00805F9B34FB), but when I try to register this service, I get the following:

bluezero.GATT - WARNING - Failed to register application: org.bluez.Error.Failed: Failed to create entry in database

The Services Changed characteristic is 0x2A05 and is a notify characteristic.

If we find a way to do this, I'll make a PR so that it can be a quick toggle from high level code such as:

my_peripheral.enable_services_changed()

@ukBaz
Copy link
Owner

ukBaz commented Jan 27, 2024

It is a while since I've looked in to the details of this, but I seem to remember that it was not very straight forward as the BlueZ daemon wanted to handle some of this. There are also other characteristics like 0x2B2A which is the Database Hash characteristic.

I've not done much with iOS, but I have seen the problem of devices being cached. Deleting devices will normally remove them from the cache. Restarting the Bluetooth daemon is also something I did frequently to ensure a clean environment during development.

If you do want to pursue getting this working then you will need to look for more detail on what is failing. For example, starting the bluetoothd in debug mode. Or at the output from btmon.
I suspect this is a question for the BlueZ Slack. Once it is known how to do it with the BlueZ API, we can then look at how to make it work with the abstraction that Bluezero tries to put in place.

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