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

HID Device.get_last_received_report() broken behavior #6764

Closed
maximkulkin opened this issue Aug 15, 2022 · 0 comments · Fixed by #6767
Closed

HID Device.get_last_received_report() broken behavior #6764

maximkulkin opened this issue Aug 15, 2022 · 0 comments · Fixed by #6767
Milestone

Comments

@maximkulkin
Copy link

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

@dhalbert dhalbert added the usb label Aug 15, 2022
@dhalbert dhalbert added this to the 8.0.0 milestone Aug 15, 2022
@maximkulkin maximkulkin changed the title HID get_latest_ HID Device.get_last_received_report broken behavior Aug 16, 2022
@maximkulkin maximkulkin changed the title HID Device.get_last_received_report broken behavior HID Device.get_last_received_report() broken behavior Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants