-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Tests/candev: Initial version with native support #13360
Conversation
aa2d271
to
909a52a
Compare
909a52a
to
eaef186
Compare
Now that #13342 is merged, we can continue with this one. I noticed that in the meantime some changes to Makefile.dep were made in #13089. For some reason, Github made a bunch of people code-owner for my new additions (did I cause this? Or is this normal?) It automatically assigned you all as reviewer now. |
Pausing for #13456 |
fd8a076
to
154bab5
Compare
Another rebase is needed. |
154bab5
to
c6c2723
Compare
@smlng Care to share your thoughts? This app should be something similar to what you tried to make a few years ago if I'm not mistaken. |
I've tested this PR and was able to send and receive CAN frames through your test-app. Both standard and extended frame format with different dlc lengths are working as described. |
@wosym @vincent-d what are the plans for #6276? Should we take up testing or do you plan to obsolete in a new PR? |
@tcschmidt the reason this PR is here, is because I wanted to get vincent-d's old PR finally merged. |
I've encountered some problems when receiving extended CAN frames. When the ID is larger than a specific amount, the received ID differs for the _can_event_callback() and the _receive(). |
@wosym I've tested again and now everything is working correctly. 👍 |
f975b3e
to
3186e71
Compare
3186e71
to
c485317
Compare
c485317
to
8eaa65a
Compare
The comments have all been addressed, please squash. |
in other apps we might not want to automatically select the auto_init
This test app bypasses candll and uses the candev abstraction directly. This has the limitation that you can only use one can driver and one can device, which is in most use cases sufficient.
8eaa65a
to
a7880ab
Compare
@benpicco Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, tested by @JannesVolkens
Contribution description
Adds a candev test app that can be used to control can-devices through the candev-abstraction, but without using the can-DLL.
Currently, only native is supported (because we thought it made sense to make a PR with only native first, so the main concepts can be tested, reviewed and commented on), but code that adds the MCP2515 driver (see #6276) to this test-app has already been written and tested, and will be made into a PR soon, along with the driver-code of this old PR.
Testing procedure
send
command will send a CAN message to vcan0. It should become visible in candump. Optionally you can pass some bytes (in decimal notation) as arguments (e.g.send 12 34 56
). If no arguments are supplied, three default bytes will be sent.cansend vcan0 001#AABB
) or with cangen (e.g.cangen vcan0 -v -n 1
).receive
. (an optional argument n can be passed to receive multiple can-messages). If there are no CAN-messages in the buffer whenreceive
is called, it will block until a message is received.Issues/PRs references
Depends on #13342 --> bugfix is required in order for this candev app to work.