honor EOM bit, drain multi-packet bulk-IN responses#12
Open
wardviaene wants to merge 1 commit into
Open
Conversation
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.
doReadsent a singleREQUEST_DEV_DEP_MSG_INper call and trusted the USBTMC header'stransfer_size, so devices that split a response across multiple messages withEOM=0returned only the first chunk.The Rigol DS1102Z-E hits this on
:WAV:DATA?: it caps each response at one bulk-IN packet, misreportstransfer_size, and never setsEOM=1, terminating with a ZLP instead. Previously returned 500 bytes where 1200 were expected.The fix loops on
REQUEST_DEV_DEP_MSG_INuntilEOM=1or the buffer is full, and drains any extra bulk-IN packets queued past the declaredtransfer_sizeon the first iteration, stopping on ZLP. The timeout is a safety net for devices that go silent rather than sending a ZLP.The stale bTag tolerance (isContinuationHeaderMismatch) was required to get correct reads on the DS1102Z-E — the device echoes the previous bTag in continuation responses.
Tested on Rigol DS1102Z-E, firmware
00.06.04(current latest).Drafted with Claude Opus 4.7 (xhigh effort); reviewed, tested, and verified on hardware by me.