Skip to content
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

Use PyBytes and not Unicode strings for IEC958 values #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tormodvolden
Copy link

@tormodvolden tormodvolden commented Aug 16, 2024

Suggested fix for #13.

  • the first commit is not strictly related but also needed to avoid hctltest1.py crashing with my audio devices, where some have info.count = 0. Let me know if more information is needed. I don't know if this is expected or if a warning should be issued.

  • I went for PyBytes instead of PyByteArray

  • for setting values, if the provided PyBytes value is shorter than the value, it will be zero-padded.

    • if it is too long, it will be silently truncated
  • following the existing code style, no empty lines were inserted, but this could help readability

  • the third commit is not for fixing the crash, but for fixing set_tuple() to actually do anything for IEC958

  • I haven't changed the reference counting, which seems wrong to me in the original code as well. This would be a different issue.

The IEC958 structure was prepared, but not actually written.

Signed-off-by: Tormod Volden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant