2021-05-28 23:02:38 +02:00
|
|
|
# embassy-net
|
|
|
|
|
|
|
|
embassy-net contains an async network API based on smoltcp and embassy, designed
|
|
|
|
for embedded systems.
|
|
|
|
|
|
|
|
## Running the example
|
|
|
|
|
|
|
|
First, create the tap0 interface. You only need to do this once.
|
|
|
|
|
|
|
|
```sh
|
|
|
|
sudo ip tuntap add name tap0 mode tap user $USER
|
|
|
|
sudo ip link set tap0 up
|
|
|
|
sudo ip addr add 192.168.69.100/24 dev tap0
|
|
|
|
sudo ip -6 addr add fe80::100/64 dev tap0
|
|
|
|
sudo ip -6 addr add fdaa::100/64 dev tap0
|
|
|
|
sudo ip -6 route add fe80::/64 dev tap0
|
|
|
|
sudo ip -6 route add fdaa::/64 dev tap0
|
|
|
|
```
|
|
|
|
|
2022-12-13 07:06:37 +01:00
|
|
|
Second, have something listening there. For example `nc -l 8000`
|
|
|
|
|
2021-12-06 14:59:15 +01:00
|
|
|
Then run the example located in the `examples` folder:
|
2021-05-28 23:02:38 +02:00
|
|
|
|
|
|
|
```sh
|
2021-12-06 14:59:15 +01:00
|
|
|
cd $EMBASSY_ROOT/examples/std/
|
2022-12-13 07:06:37 +01:00
|
|
|
cargo run --bin net -- --static-ip
|
2021-05-28 23:02:38 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This work is licensed under either of
|
|
|
|
|
|
|
|
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
|
|
|
|
|
|
|
at your option.
|