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.
I took the liberty of throwing most of the code and logic out and re-implementing the bare minimum. This works fine for me on unstable debian with an agilent MSGO-x 3014A. Not tested on any other platform or with any other hardware.
This change drops the 150MB scratch buffer and rather convoluted logic for chunked reading and doing 1-byte
read()
s for reading responses. It still allows the user to specify the max read chunk size to work around usbtmc issues with some devices. The default chunk size is still 2032, this can be reduced for buggy devices or increased to reduce system call overhead.There was a "TODO" in the previous version noting that timeouts were not yet implemented. If this is a requirement I can add this as well, let me know.