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

Support sending can frames over tokio canfd sockets (Resolves #57) #69

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

EliteTK
Copy link
Contributor

@EliteTK EliteTK commented Jun 4, 2024

The first patch is unrelated and is just a cleanup of a bunch of extraneous path components. I couldn't compile without removing these first.

I think this is probably an acceptable solution. This also fixes #57.

Please let me know what you think. I can probably test this on real hardware soon but the new tests pass (although they currently seem to omit actually verifying that the received frame is of the right type and content etc).

@EliteTK EliteTK force-pushed the tokio-canfd-can branch 2 times, most recently from f86f823 to 2ca84a4 Compare June 4, 2024 23:40
@EliteTK
Copy link
Contributor Author

EliteTK commented Jun 4, 2024

Actually, looks like #68 already addresses the unnecessary path component issue and #61 addresses the panic. Feel free to just merge those first and I'll drop the commits from this PR. #67 would clash with this change but I don't mind re-doing it if you were to apply it first.

Technically with #67 it would become quite easy to also make write_frame take a & like the equivalents in the other async implementations, but it would also mean a more obviously breaking change (I'm not sure if this is considered breaking as it is, technically no callers should be affected).

Anyway, let me know, this isn't particularly urgent right now.

@EliteTK EliteTK force-pushed the tokio-canfd-can branch from 2ca84a4 to 9021d0e Compare June 5, 2024 16:18
@EliteTK
Copy link
Contributor Author

EliteTK commented Jun 5, 2024

I've actually gone ahead and rebased things on top of the other PRs.

Applying this (which is now breaking) will also include #68, #61, and #67 (the authorship information is preserved so while the PRs won't get auto-closed as merged, the contributors aren't being stiffed).

But feel free to just apply those PRs individually prior to this one.

I just did this so I could develop on top of #67 and didn't step on #68 and #61's toes.

I've also added a fix for the Stream impl as well as even more tests.

@EliteTK EliteTK force-pushed the tokio-canfd-can branch from 9021d0e to 0495fda Compare June 5, 2024 18:10
This is a breaking change.

This also adds tests for all the additional cases (although no mixed
tests so far).
@EliteTK
Copy link
Contributor Author

EliteTK commented Aug 5, 2024

I've now rebased against all the accepted PRs and force pushed the new version of my commit.

@fpagliughi
Copy link
Collaborator

Nice!
I'm just arriving back from summer holiday and will start testing the stuff I recently merged on some real equipment. Then I will look to test and merge this before doing anything else. You've already had to rebase a couple times!

@EliteTK
Copy link
Contributor Author

EliteTK commented Aug 6, 2024

You've already had to rebase a couple times!

Ah, don't worry about that. I don't mind it.

@martinjaeger
Copy link

I came across the same issue with the tokio API and tested out this PR.

It works very well (thanks @EliteTK). Would really appreciate getting it merged and officially released.

@fpagliughi
Copy link
Collaborator

Yes, apologies. A new release is overdue. I'm at RustConf this week, but will get a few of these PRs landed and tested when I return, and publish a new version.

@showier-drastic
Copy link

Just a friendly ping on this PR, which is needed to send CAN frames on CAN-FD interfaces.

Copy link
Collaborator

@fpagliughi fpagliughi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry for the delay

@fpagliughi fpagliughi merged commit 44cff8b into socketcan-rs:master Dec 24, 2024
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.

Tokio-Async CanFd not capable of sending RemoteFrame?
4 participants