Skip to content

CAN: raw ID getter function #669

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robamu
Copy link

@robamu robamu commented May 13, 2025

No description provided.

@robamu robamu requested a review from a team as a code owner May 13, 2025 08:04
@robamu robamu changed the title raw ID getter function CAN: raw ID getter function May 13, 2025
@timokroeger
Copy link
Contributor

What is your use case for this? This has come up before (#428).

As described in the linked PR I’m not a big fan of the proposed API as it makes mixing Standard and Extended IDs easy, something that usually is not intended.

@robamu
Copy link
Author

robamu commented May 13, 2025

I just wanted to retrieve the raw ID for quick debugging/printing purposes (after I could not simpy print it with defmt). I did not care about the Standard ID / Extended ID distinction in that case, and I found it weird/unintuitive that I had to unmatch the value.
Basically, it is just an API that I expected to be there.

After going through the mentioned thread for a bit, I can see the point of intentionally making the mixup harder.
The possible mixup of standard and extended ID is something that could be mentioned inside the documentation as well, but I guess this becomes a question about how to design the API and whether to expose methods like this which might increase convenience, but also introduce bugs when not used with care. I have not worked with more complex CAN buses yet with both standard and extended frames (just getting started) where this might become an issue.

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.

2 participants