-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in iter_bytes
#80
Comments
@MatthieuDartiailh I'm taking a look at this and I'm not sure I understand that you've said. Let me break it down to make sure I've got things right - please correct me where I'm wrong:
Sounds reasonable. If we send data that requires 10 bits to represent, clip it to 8 bits (or 5 or whatever
"should only be set": Did you mean "should only be sent"? Assuming you meant "sent", you mean we should do this:
Yeah
Do you mean this? def iter_bytes(data: bytes, max_bits: int = 8, send_end: bool = False) -> Iterator(bytes):
"""Clip values to the correct number of bits (serial may use from 5 to 8 bits).
Parameters
----------
data : The data to send
max_bits: Truncate each character to this number of least-significant bits.
send_end: If True, send the final character with all bits (do not truncate).
Otherwise, truncate the final character to max_bits.
""" I might want to rename |
The behavior is meant to match the IVI specification. I attach links to both the IVI specification and NI documentation that details the expectation both for data bits and for send end. Let me know if this clears things. https://www.ivifoundation.org/downloads/Architecture%20Specifications/vpp43_2022-05-19.pdf https://www.ni.com/docs/en-US/bundle/ni-visa/page/ni-visa/vi_attr_asrl_data_bits.html https://www.ni.com/docs/en-US/bundle/ni-visa/page/ni-visa/vi_attr_asrl_end_out.html |
Thanks for those links. It sure sounds like what I described matches with those specs. I'll whip up a PR. |
See #79 (comment)
The text was updated successfully, but these errors were encountered: