← index #15627PR #4082
Off-topic · high · value 0.424
QUERY · ISSUE

BLE GATT descriptor set to DESCRIPTOR_READ (0x01) returns Error Code: Read Not Permitted (0x02)

openby Heerkogopened 2024-08-09updated 2024-08-10
bug

Port, board and/or hardware

esp32

MicroPython version

This issue started showing from MicroPython v1.20 onwards.
V1.23 is confirmed to still have the issue.
V1.19 is confirmed to NOT have the issue.

Reproduction

I'm using my MicroPythonBLEHID library.

On line 588, among others, I define the following HID service description:

        self.HIDS = (
            UUID(0x1812),
            (
                (UUID(0x2A4A), F_READ),
                (UUID(0x2A4B), F_READ),
                (UUID(0x2A4C), F_WRITE),
                (UUID(0x2A4D), F_READ_NOTIFY, ((UUID(0x2908), DESCRIPTOR_READ),)),
                (UUID(0x2A4E), F_READ_WRITE),
            ),
        )

Where DESCRIPTOR_READ = 0x01, as specified here.

Expected behaviour

No issues.

Observed behaviour

The value 0x01 of the report reference UUID(0x2908) returns a Rcvd Error Response - Read Not Permitted, Handle: 0x0030 (Human Interface Device: Report: Report Reference) message when intercepted with Pcap/Wireshark, causing a driver failure.

Additional Information

When I set the descriptor to 0x02, the issue is resolved. However, this is the write flag, and not read, and therefore wrong. My current version of the library uses this value to 'make it work', but this is incorrect.

Note that the issue persists even when always returning _GATTS_NO_ERROR (0x00) with every _IRQ_GATTS_READ_REQUEST.

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

nrf/ubluepy: Add support for characteristic descriptors.

closedby glennrubopened 2018-08-27updated 2021-05-18
port-nrf

This patch adds support for enabling notifications from
remote peripheral in case of Central GATT client.

Added implementation of Characteristic Descriptor objects which
are populated during service discovery (Central GATT client).
For GATT server (most likely Peripheral) the list is kept empty
for now. The list returned can be used to locate the for example
the CCCD descriptor and enabling the notifications by writing
[0x01, 0x00] to it.

Added method for retrieving the handle value of the Service,
Characteristic and Descriptor in case a python application wants
to match on handle value (typically in the python registered event
handler) where characteristic handle is passed instead of connection
handle.

In case of Central, the notification and indication events will be
propagated to the gattc handler registered in the ubluepy_peripheral.c.
Indications will be auto-replied on the return of event handler call.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied