#embedded-nal-async #traits #tcp-socket #async-trait #udp-socket #networking #tcp-server

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

#854 in Embedded development


Used in edge-std-nal-async

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