Support 11-bit identifiers in the serial interface#1758
Merged
zariiii9003 merged 1 commit intohardbyte:mainfrom May 31, 2025
Merged
Support 11-bit identifiers in the serial interface#1758zariiii9003 merged 1 commit intohardbyte:mainfrom
zariiii9003 merged 1 commit intohardbyte:mainfrom
Conversation
hardbyte
approved these changes
Jun 18, 2024
Owner
hardbyte
left a comment
There was a problem hiding this comment.
Nice job, thanks for the contribution
Collaborator
|
Formatting test is failing now, but i'll follow up with another PR to add remote and error frames in the same way. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Is your feature request related to a problem? Please describe.
I'm working on a piece of software that will eventually run on a Raspberry Pi (ideally using the
SocketCANinterface), but I would like to easily test on my local computer. I have several microcontrollers, but no way to connect the CAN bus to my computer. With the CAN serial interface, I can program the microcontrollers to act as an gateway for my computer, but the serial interface doesn't support 11-bit CAN IDs. Since my project uses 11-bit CAN IDs, I'm looking to add this support.Describe the solution you'd like
I added support for 11-bit CAN IDs by placing them at the end of the
arbitration_idspace for 29-bit IDs, and using the 30th bit to enable 11-bit IDs. I thought it might be useful to others, so I tested and documented the change.Describe alternatives you've considered
I have considered making a new interface that adds more features to serial. I have also considered using the SLCAN interface, but it's honestly easier to make this change than it is to implement full SLCAN compatibility.
Additional context
I am new to this project, and I'm not sure if this is a feature that is really wanted in the upstream. If it is, feel free to make edits to this PR.