Skip to content

Commit

Permalink
More readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Jan 20, 2024
1 parent 3a4a497 commit 1d15d84
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
16 changes: 16 additions & 0 deletions edge-std-nal-async/README.md
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).

35 changes: 35 additions & 0 deletions embedded-nal-async-xtra/README.md
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`

0 comments on commit 1d15d84

Please sign in to comment.