Skip to content

HID Device.get_last_received_report() broken behavior #6764

@maximkulkin

Description

@maximkulkin

CircuitPython version

Adafruit CircuitPython 7.2.0 on 2022-02-24; Adafruit Macropad RP2040 with rp2040

Code/REPL

REPORT_ID = 2

def process_output_reports():
    report = hid_device.get_last_received_report(REPORT_ID)
    if report is None:
        return

    # process report bytes

Behavior

Documentation states that in the absence of report the function should return None, otherwise - bytes object with report data. I assume that if there is a report, it returns it, and subsequent calls will again return None until new report is received.

Behavior observed: regardless of prior receiving a report, it always returns bytes object. First returned report contains just zeros, later - last received report data (regardless of how many times you call it). The later behavior makes it impossible to detect when a new report is actually received.

Description

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions