Skip to content

bluetooth: remove hardcoded generic attribute service. #7675

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

Closed

Conversation

andrewleech
Copy link
Contributor

Allows it be be defined & managed in python code if needed, eg with micropython/micropython-lib#439

Allows it be be defined & managed in python code if needed.
@dpgeorge
Copy link
Member

I'm all in favour of removing and simplifying code. But what kind of impact does this have on existing code?

@jimmo
Copy link
Member

jimmo commented Sep 10, 2021

It seems like micropython/micropython-lib#439 is trying to work around the fact that NimBLE's built-in implementation of the default GATT service is missing this (seemingly very important) feature. I don't really understand why a phone would cache the services for a server that doesn't support this characteristic, but can't do anything about that as far as I can tell.

I'd much prefer to fix this in NimBLE and make the default thing "just work" -- i.e. add the database hash attribute to https://github.com/apache/mynewt-nimble/blob/master/nimble/host/services/gatt/src/ble_svc_gatt.c

I notice that btstack already has database hash calculation functions, so at least btstack won't be too tricky. https://github.com/bluekitchen/btstack/blob/master/src/ble/att_db_util.c#L363

@andrewleech
Copy link
Contributor Author

andrewleech commented Sep 10, 2021

Yeah we really could add the hash support to nimble itself, that's going to be cleaner of the hash works in C, we can still query that from micropython to compare to a stored hash in pairing db to use as trigger to indicate on service changed (that's still going to need to be managed by application at pairing layer)

Marceau has got a pure Python AES CMAC hash working, but we'll need to switch to a suitable C implementation if we want to add it to nimble properly.

And we'll need a fork of nimble...

@jimmo
Copy link
Member

jimmo commented Sep 10, 2021

NimBLE already has AES-128 CMAC.

@andrewleech
Copy link
Contributor Author

Sounds like I really overcomplicated things by trying to avoid editing nimble by doing this all in python...

@andrewleech
Copy link
Contributor Author

Deprecated in favour of #7877

@andrewleech andrewleech closed this Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extmod Relates to extmod/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants