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

net/udp: Add some embedded-nal-async UDP traits #2519

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

chrysn
Copy link
Contributor

@chrysn chrysn commented Feb 2, 2024

Building on smoltcp-rs/smoltcp#903, this implements some UDP traits.

It notably doesn't implement the core stack trait; as outlined in the docs, that doesn't go well with the user-allocated stack data structures. For the same problem, RIOT OS provides a Stack type that is actually kind of a Cell<Option<Socket>> and thus allows the creation of exactly one socket -- that is an option here. However, my test applications really already take a bound socket as an argument, so let's see how far this gets us without doing the ugly.

This is a draft PR both because it has waaay too many FIXMEs / todo!()s, and because it hasn't been tested so far (but it builds, so push it :-D )

When done, this closes: #2516

…ll_ functions

This is a breaking change for users of the poll_ functions. (Some might
not notice if they already pass in an IpEndpoint into poll_send_to, or
discard that item in poll_recv_from).
chrysn added a commit to chrysn-pull-requests/RIOT-rs that referenced this pull request Apr 8, 2024
Moving the code avoids a constant whack-a-mole of updating dependency
versions, and enables review within RIOT-rs before moving it back into a
branch at embassy.

Code was moved from embassy-rs/embassy#2519, I
was the original author.
chrysn added a commit to chrysn-pull-requests/RIOT-rs that referenced this pull request Apr 12, 2024
Moving the code avoids a constant whack-a-mole of updating dependency
versions, and enables review within RIOT-rs before moving it back into a
branch at embassy.

Code was moved from embassy-rs/embassy#2519, I
was the original author.
chrysn added a commit to chrysn-pull-requests/RIOT-rs that referenced this pull request Apr 19, 2024
Moving the code avoids a constant whack-a-mole of updating dependency
versions, and enables review within RIOT-rs before moving it back into a
branch at embassy.

Code was moved from embassy-rs/embassy#2519, I
was the original author.
@Frostie314159
Copy link
Contributor

Frostie314159 commented Nov 7, 2024

Hi @chrysn, is there something specific preventing this from being merged? If so, I would love to help with that, since this is a really useful feature.

@Dirbaio
Copy link
Member

Dirbaio commented Dec 3, 2024

there's a few TODOs and FIXMEs, i'd like to see them resolved before this is merged.

i've rebased this into https://github.com/embassy-rs/embassy/tree/impl-embedded-nal-async-udp-v2
however I can't put in more time to actually fix them. Anyone's welcome to pick this up if they need it.

@chrysn
Copy link
Contributor Author

chrysn commented Dec 3, 2024

Thanks for the rebase, I'll combine that in with my pending changes. I've been testing this for the last months in a limited scope – and just found out that I completely forgot to keep this PR updated. Sorry for that; got a few urgent things for the next few days, but I expect to come back to this in the next two weeks.

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.

net/UDP: Implement embedded-nal-async traits for UDP
3 participants