Skip to content

Conversation

@mdiea
Copy link

@mdiea mdiea commented Mar 10, 2025

Dear ljakob,

First of all, thank you for your work on this repo. Your implementation has been extremely useful, and I truly appreciate the effort you've put into it.

While using unit_ut61eplus on Windows 10, I encountered an issue where:

  • The read() function blocks indefinitely, preventing further execution.

After investigating, I found that this behavior is caused by how HIDAPI handles Report IDs on Windows:

  1. Windows expects a Report ID as the first byte. If it's missing, hid_write() pads the buffer to 65 bytes, leading to incorrect return values.
  2. hid_read() is blocking by default in Windows, meaning it waits indefinitely if no data is available.

Proposed Solution:

  • Ensure a Report ID is always present before calling write() on Windows by prepending 0x00 if needed.
  • Enable non-blocking mode for read() to prevent infinite waits, and introduce a timeout to avoid unnecessary delays.

I have implemented and tested these fixes, and they resolve the issue without affecting functionality on Linux.

You will see that I also changed the variables CP2110_VID and CP2110_PID, as this is how my USB is numbered.

Thanks again for your work! 🚀

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant