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

ATT Read by Type Request does not return Characteristic Descriptors #326

Open
mringwal opened this issue Oct 8, 2023 · 0 comments
Open

Comments

@mringwal
Copy link

mringwal commented Oct 8, 2023

ATTClass::readByTypeReq has three code blocks:

  • one for reading Characteristic Declaration
  • a second for reading CCCD in theory, but which is never executed
  • a third one for reading Characteristic Value

The first two blocks are entered if attribute->type() == readByTypeReq->uuid. As attribute->type() is an enum, only UUIDs 2800 (BLETypeService), 2803 (BLETypeCharacteristic) work as expected. For any Characteristic Descriptor, e.g. CCCD 2902, the attribute->type() is 2900 (BLETypeDescriptor), so a query for 2902 is not handled although a CCCD is define.

As a consequence a "Write CCCD / Enable Notifications by BTstack" fails with Attribute not Found Error, as the Read By Type Req with UUID 2902 is not handled correctly / fails.

Maybe starting with a switch on attribute->type() and handling all three types might be a better way to implement this.
I'm happy to explain in more detail if someone wants to fix this implementation.

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

1 participant