Repository navigation
Conversation
Fix flush() writing to nonexistent attribute, fix endPointIndex unbound when endPoint is not None, add numberOfEndPoints parameter for USB devices, add defaultTimeout attribute, remove broken DebugDataCommand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Closing as redundant — PR #73 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Recovers an unpushed commit (
e9e4faf, authored 2026-03-01) that was sitting on a stale localhamamatsubranch. Cherry-picked onto a fresh branch offmaster, with the one conflict resolved (PR #74 fixed theendPointIndexunbound bug differently — kept that style since it's already on master).What this changes in
DebugPortnumberOfEndPoints=1parameter on__init__—inputBuffers/outputBuffersare now sized to the requested endpoint count rather than hard-coded to 2. Lets USB-style multi-endpoint devices useDebugPortdirectly.flush()— was writing to a nonexistentself.buffersattribute. Now properly resets eachinputBuffers[i]andoutputBuffers[i]to empty bytearrays.defaultTimeout = 500attribute added.readDataerror message — now reports\"Unable to read N bytes, only M available\"rather than a generic timeout, which is much more useful when debugging stuck reads.writeToOutputBuffer—endPointIndexparameter is now keyword-defaulted to0(was required positional).DebugDataCommand— the broken skeleton class that referenced unassigned attributes (self.data,self.replyDataLength,self.replyHexRegex). One of the items flagged in the earlier code review.Relationship to PR #74
PR #74 (latent-bug fixes, merged) included a fix for
readData/writeDataleavingendPointIndexunbound when an explicitendPointwas passed. This commit had the same fix with slightly different ternary phrasing. The cherry-pick conflict was resolved in favor of PR #74's style (since it's already on master); behavior is identical.Test plan
python3 -m pytest hardwarelibrary/tests/testCommunicationPorts.py -v— should report 84 passed, 29 skipped (hardware-gated). Already verified locally.DebugPort(numberOfEndPoints=3)and confirmflush()andbytesAvailable(endPoint=2)work.History note
The commit was authored on a local-only branch on 2026-03-01 and never pushed. Surfaced during a session refresh today and rescued before deletion. Original author: Daniel Côté (preserved via cherry-pick).
🤖 Generated with Claude Code