Skip to content

Conversation

@rickwierenga
Copy link
Member

Summary

  • Add size parameter to USB.read() and USB._read_packet() to allow reading a specific number of bytes
  • Fix decode calls to use errors="backslashreplace" for robustness with binary data
  • Update USBValidator to support the new size parameter

Extracted from #797 (Tecan Infinite plate reader backend).

Test plan

  • Verified import works

🤖 Generated with Claude Code

Allow specifying a maximum number of bytes to read via the `size`
parameter on `read()` and `_read_packet()`. This is useful for
protocols that need to read a specific number of bytes rather than
reading until no more packets arrive.

Also fix decode calls to use errors="backslashreplace" for robustness
with binary data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rickwierenga rickwierenga merged commit e6d0fe2 into main Jan 21, 2026
10 checks passed
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.

2 participants