-
Notifications
You must be signed in to change notification settings - Fork 34
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
Can bus suppport? #32
Comments
Hi, is there an existing generic trait crate for CAN bus (I vaguely remember seeing one at some point)? If yes, it would of course be great to also support it here. You're welcome to send a PR :) |
That's great to hear! I've got a theoretically working implementation that I plan to test tomorrow if the work day is slow. One issue I know of now is that embedded-hal-mock doesn't currently support can. If not having tests is an issue, it doesn't look like like it should be too hard to add can support there too. |
Of course tests would be great but in this case I don't think we're missing too much without the tests here... |
After some more testing it seems non-trivial to add support for can bus because while embedded-hal does have a generic trait for it, the hal crates that implement it (stm32f1xx-hal at least, as that's the only one I'm currently able to test) also depend on bxcan and the bxcan::Can trait would also need to be implemented. There's also a more fundamental issue of how to handle can frames received for other device drivers while the bus is being used another device driver. I can think of a few ways to handle that, but are probably out of scope for this crate.
|
Fair warning, my experience with CAN is very limited... I think I see the problem. Arbitrating So I agree that I.e. client code can create an arbitrary number of sockets with different filters and the routing layer does the right thing with incoming frames (any maybe even set the hardware filter to the union of all socket's filters where possible). What comes to mind is the What do you think? |
Is there anything that would prevent adding support for can bus? If not and this would be a welcome addition I'll plan to start working on it as it would be useful in my own project(s).
The text was updated successfully, but these errors were encountered: