Skip to content

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

@mringwal

Description

@mringwal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions