Skip to content

Resolve an unset data_bitrate to no operation in slcan. #1978

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

Merged

Conversation

dcasnowdon
Copy link
Contributor

@dcasnowdon dcasnowdon commented Aug 11, 2025

Summary of Changes

  • Fix the default setting for data_bitrate when it is not set.

Related Issues / Pull Requests

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Other (please describe):

Checklist

  • I have followed the contribution guide.
  • I have added or updated tests as appropriate.
  • I have added or updated documentation as appropriate.
  • I have added a news fragment for towncrier.
  • All checks and tests pass (tox).

Additional Notes

Tested on canable 2.0 hardware locally (in addition to the unit tests).

@dcasnowdon dcasnowdon marked this pull request as ready for review August 11, 2025 01:48
@zariiii9003
Copy link
Collaborator

Hi, thank you for the fix. But I'd prefer the function signature as it is, so instead you could change the _DATA_BITRATES value to None: ""

@dcasnowdon
Copy link
Contributor Author

Hi, thank you for the fix. But I'd prefer the function signature as it is, so instead you could change the _DATA_BITRATES value to None: ""

I wasn't sure whether 0 might be passed in as a no-op. Is it OK to change the interface in this way? Instead, I've changed it to add an explicit check for None in the body of the method. I can change the value in the _DATA_BITRATES table if you'd prefer.

@dcasnowdon dcasnowdon changed the title Change the default to 0, which is a no-op for data_bitrate. Resolve an unset data_bitrate to no operation in slcan. Aug 11, 2025
@zariiii9003
Copy link
Collaborator

Yes, looks good now. Could you add a little bit more information to the news fragment? I'll create a patch release afterwards

@dcasnowdon
Copy link
Contributor Author

Yes, looks good now. Could you add a little bit more information to the news fragment? I'll create a patch release afterwards

I have added a little more detail (is this what you'd like?), and I've changed it to be a fix, rather than added.

Copy link
Collaborator

@zariiii9003 zariiii9003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

@zariiii9003 zariiii9003 merged commit c0e5a8e into hardbyte:main Aug 12, 2025
32 checks passed
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.

Opening an SLCAN interface results in "Invalid Data Bitrate"
2 participants