#traits #tcp-socket #async-trait #udp-socket #networking #tcp-server #sockets

no-std embedded-nal-async-xtra

Hosts a bunch of traits which are not yet available in the embedded-nal-async crate

2 unstable releases

0.2.0 Feb 1, 2024
0.1.0 Jan 27, 2024

#1731 in Embedded development

Download history 15/week @ 2024-01-22 40/week @ 2024-01-29 41/week @ 2024-02-19 22/week @ 2024-02-26 5/week @ 2024-03-04 8/week @ 2024-03-11 7/week @ 2024-03-25 45/week @ 2024-04-01 33/week @ 2024-04-15

85 downloads per month
Used in 6 crates

MIT/Apache

9KB
154 lines

embedded-nal-async-xtra

CI crates.io Documentation

Hosts a bunch of traits which hopefully will be upstreamed into embedded-nal-async soon - in one shape or another.

Justification

These traits are necessary to unlock the full functionality of some crates in edge-net. Namely:

  • edge-mdns - needs UDP multicast capabilities
  • edge-dhcp - needs raw ethernet socket capabilities or at least sending/receiving UDP packets to/from peers identified by their MAC addresses rather than by their IP addresses
  • edge-http - (full server only) needs a way to bind to a server-side TCP socket

TCP traits

  • TcpListen
    • Server-side TCP socket similar in spirit to STD's std::net::TcpListener::bind bind method
  • TcpAccept
    • Server-side TCP socket similar in spirit to STD's std::net::TcpListener struct

UDP traits

  • Multicast
    • Extra trait for UDP sockets allowing subscription to multicast groups
  • UnconnectedUdpWithMac
    • Extra trait for unconnected UDP sockets allowing broadcasting packets to specific Ethernet MACs
    • Additionally - when receiving packets - this trait provides the sender's MAC in addition to its socket address

Traits for sending/receiving raw ethernet payloads (a.k.a. raw sockets)

  • RawStack
    • Similar in spirit to UdpStack, yet allowing sending/receiving complete IPv4 and IPv6 frames, rather than just UDP packets
  • RawSocket
    • The socket type for RawStack. Similar in spirit to UnconnectedUdp

Dependencies

~265KB