← index #15627Issue #13611
Off-topic · high · value 0.481
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 · ISSUE

Pico-W OSError: [Errno 114] EALREADY

closedby redhead-popened 2024-02-07updated 2024-02-09
bug

MicroPython v1.22.1 on 2024-01-05; Raspberry Pi Pico W with RP2040

This error occurs as part of a BLE central implementation. I'm using the BLE class direct rather than the aioble library.

Following scanning and a successful _IRQ_PERIPHERAL_CONNECT event, service discovery is initiated. During service discovery the attribute tree is navigated recording service handles, characteristic handles and descriptor handles. This includes recording handles for the CCC descriptor for characteristics with Notify enabled (UUID = 0x2902). Following service discovery MTUs are exchanged. The CCC descriptors then have 1 written to them, to enable notifications to be reported by the server. The first of these generates an _IRQ_GATTC_WRITE_DONE with a result of 0 (OK). The second write causes the OSError 114.

This failure is specific to the Pico-W with the Infineon radio. The code works as expected without the OSError on both an ESP32 and an Arduino Nano RP2040 Connect (Nina W102 uBlox radio). I've also tried it with two different peripheral implementations - micropython on the RP2040 Connect and c++/ARM mbed Bluetooth library on an Arduino Nano BLE. The failure happens consistently with both peripheral implementations.

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