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

Improve CAN Interface #3555

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sheepmax
Copy link

@sheepmax sheepmax commented Nov 21, 2024

BRS is off by default for extended frame construction, so building a frame with BRS enabled is not trivial without adding the embedded_can crate.

This PR does the following:

  • Add a wrapper for embedded_can::Id, so they can be constructed with Embassy style errors and without external packages.
  • Make the interface of the CAN Header struct homogeneous with the rest of the module.

@sheepmax sheepmax force-pushed the can-frame-constructors branch from 92649c8 to 490829a Compare November 21, 2024 12:34
@sheepmax sheepmax changed the title Add CAN ID wrapper Improve CAN Interface Nov 22, 2024
@Dirbaio
Copy link
Member

Dirbaio commented Dec 2, 2024

I'm not sure what's the advantage of the Id wrapper. Could you explain?

If the issue is you need to depend on embedded-can to do something, it should be fixable by reexporting more things (pub use embedded_can::somethingsomething)

@sheepmax
Copy link
Author

sheepmax commented Dec 2, 2024

The other advantage is turning an option-type error into something more familiar to Embassy errors. This may also be the bases for future refactoring as it provides a more complete API to build on. I don't see anything wrong with a reexport either, but it certainly doesn't feel clean.

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.

3 participants