Support 11-bit identifiers in the serial interface #1758
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
SocketCAN
interface), 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_id
space 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.