-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# edge-std-nal-async | ||
|
||
[![CI](https://github.com/ivmarkov/edge-net/actions/workflows/ci.yml/badge.svg)](https://github.com/ivmarkov/edge-net/actions/workflows/ci.yml) | ||
![crates.io](https://img.shields.io/crates/v/edge-net.svg) | ||
[![Documentation](https://docs.rs/edge-net/badge.svg)](https://docs.rs/edge-net) | ||
|
||
A stop-gap STD implementation of [embedded-nal-async](https://github.com/rust-embedded-community/embedded-nal/tree/master/embedded-nal-async), *including the extra traits defined in [embedded-nal-async-xtra](../embedded-nal-async-xtra)*. | ||
|
||
The implementation is based on the minimalistic [async-io](https://github.com/smol-rs/async-io) crate - from the [smol](https://github.com/smol-rs/smol) async echosystem - and thus works out of the box on a variety of operating systems, including [Espressif's ESP IDF](https://github.com/espressif/esp-idf). | ||
|
||
## Plan Forward | ||
|
||
Once the traits are upstreamed, the hope is that the "other" - and a bit more known - STD-based embedded-nal-async implementation - [std-embedded-nal-async](https://gitlab.com/chrysn/std-embedded-nal/-/tree/master/std-embedded-nal-async?ref_type=heads) will implement those. | ||
|
||
There is also an [open PR](https://gitlab.com/chrysn/std-embedded-nal/-/merge_requests/6) against `std-embedded-nal-async` to remove its dependency on [async-std](https://github.com/async-rs/async-std) and switch to [async-io](https://github.com/smol-rs/async-io). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# embedded-nal-async-xtra | ||
|
||
[![CI](https://github.com/ivmarkov/edge-net/actions/workflows/ci.yml/badge.svg)](https://github.com/ivmarkov/edge-net/actions/workflows/ci.yml) | ||
![crates.io](https://img.shields.io/crates/v/edge-net.svg) | ||
[![Documentation](https://docs.rs/edge-net/badge.svg)](https://docs.rs/edge-net) | ||
|
||
A placeholder for a bunch of traits which hopefully will be upstreamed into [embedded-nal-async](https://github.com/rust-embedded-community/embedded-nal/tree/master/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](../edge-mdns) - needs UDP multicast capabilities | ||
* [edge-dhcp](../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](../edge-http) - (full server only) needs a way to bind to a server-side TCP socket | ||
|
||
## TCP traits | ||
|
||
* [TcpListen](src/stack/tcp.rs) | ||
* Server-side TCP socket similar in spirit to STD's `std::net::TcpListener::bind` bind method | ||
* [TcpAccept](src/stack/tcp.rs) | ||
* Server-side TCP socket similar in spirit to STD's `std::net::TcpListener` struct | ||
|
||
## UDP traits | ||
* [Multicast](src/stack/multicast.rs) | ||
* Extra trait for UDP sockets allowing subscription to multicast groups | ||
* [UnconnectedUdpWithMac](src/stack/udp.rs) | ||
* 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](src/stack/raw.rs) | ||
* Similar in spirit to `UdpStack`, yet allowing sending/receiving complete IPv4 and IPv6 frames, rather than just UDP packets | ||
* [RawSocket](src/stack/raw.rs) | ||
* The socket type for `RawStack`. Similar in spirit to `UnconnectedUdp` |