8 releases (4 breaking)
0.5.1 | Jun 22, 2024 |
---|---|
0.5.0 | Apr 22, 2024 |
0.4.1 | Aug 22, 2023 |
0.4.0 | Jul 21, 2023 |
0.1.0 | Feb 17, 2021 |
#1435 in Network programming
673 downloads per month
Used in 3 crates
36KB
651 lines
smoltcp Network Abstraction Layer (NAL)
An embedded-nal
implementation for smoltcp
.
This repository provides an implementation of a TCP- and UDP-capable network stack that can be used
for any library that leverages the embedded-nal
.
This crate also supports DHCP management internally if DHCP via smoltcp is used.
lib.rs
:
A [embedded_nal]-compatible network stack for [smoltcp]
Usage
To use this library, first instantiate the smoltcp::iface::Interface and add sockets to it. Once sockets have been added, pass the interface to [NetworkStack::new()].
Sharing the Stack
If you have multiple users of the network stack, you can use the shared::NetworkManager by
enabling the shared-stack
feature. Note that this implementation does not employ any mutually
exclusive access mechanism. For information on how to use this manager, refer to
shared_bus::AtomicCheckMutex's documentation.
When sharing the stack, it is the users responsibility to ensure that access to the network stack is mutually exclusive. For example, this can be done when using RTIC by storing all of the resources that use the network stack in a single resource.
Dependencies
~3.5MB
~72K SLoC