Fix writing with no termination character - #221
Conversation
Previously, if the write termination was the empty byte, the written message was truncated to the empty byte.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #221 +/- ##
==========================================
+ Coverage 86.64% 87.50% +0.85%
==========================================
Files 18 19 +1
Lines 1041 1104 +63
Branches 113 124 +11
==========================================
+ Hits 902 966 +64
+ Misses 104 103 -1
Partials 35 35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| b"+3.00000000E+00", | ||
| b"", | ||
| ), | ||
| # this test fails; however, no SCPI serial devices without termination |
There was a problem hiding this comment.
Thoughts on this test failing? I think it's fine if this one fails, since instruments with no write termination character implement traffic control through mechanisms like fixed message length or check-summing. There are no SCPI or IEEE 488.2 serial devices without write termination to my knowledge, so this test case does not represent any real instrument.
Previously, if the write termination was the empty byte, the written message was truncated to the empty byte.
I am fairly certain that serial (not GPIB, where end of input signal exists) instruments that are compliant with IEEE 488.2 must have a linefeed as a write termination (§ 7.5.2 of IEEE 488.2-1992(R2004)). Some non-compliant instruments also have write terminations, like modems using the Hayes AT command set. But instruments without a write termination character exist. Thorlabs motors using the APT protocol come to mind.