diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-03-02 21:20:00 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-03-02 21:20:00 +0100 |
| commit | 9bee576fd241f019c363919b0c29551c6b8ee4b2 (patch) | |
| tree | 96bfb71546ab96b02cb5c26d6b754793e4bd64e9 /embassy-net-examples/src | |
| parent | f100383b3c094830fee4e54956795388bd5edec1 (diff) | |
Update embassy
Diffstat (limited to 'embassy-net-examples/src')
| -rw-r--r-- | embassy-net-examples/src/main.rs | 5 | ||||
| -rw-r--r-- | embassy-net-examples/src/tuntap.rs | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/embassy-net-examples/src/main.rs b/embassy-net-examples/src/main.rs index bc413f1a2..dba1415b7 100644 --- a/embassy-net-examples/src/main.rs +++ b/embassy-net-examples/src/main.rs | |||
| @@ -1,8 +1,7 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | 1 | #![feature(type_alias_impl_trait)] |
| 2 | 2 | ||
| 3 | use embassy::executor::{Spawner, task}; | 3 | use embassy::executor::{task, Spawner}; |
| 4 | use embassy::io::{AsyncBufReadExt, AsyncWriteExt}; | 4 | use embassy::io::AsyncWriteExt; |
| 5 | use embassy::time::{Duration, Timer}; | ||
| 6 | use embassy::util::Forever; | 5 | use embassy::util::Forever; |
| 7 | use embassy_net::*; | 6 | use embassy_net::*; |
| 8 | use embassy_std::Executor; | 7 | use embassy_std::Executor; |
diff --git a/embassy-net-examples/src/tuntap.rs b/embassy-net-examples/src/tuntap.rs index 5c138c069..b2117e81b 100644 --- a/embassy-net-examples/src/tuntap.rs +++ b/embassy-net-examples/src/tuntap.rs | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | use async_io::Async; | 1 | use async_io::Async; |
| 2 | use embassy::util::WakerRegistration; | 2 | use embassy::util::WakerRegistration; |
| 3 | use libc; | 3 | use libc; |
| 4 | use log::*; | ||
| 4 | use smoltcp::wire::EthernetFrame; | 5 | use smoltcp::wire::EthernetFrame; |
| 5 | use std::io; | 6 | use std::io; |
| 6 | use std::io::{Read, Write}; | 7 | use std::io::{Read, Write}; |
| 7 | use std::os::unix::io::{AsRawFd, RawFd}; | 8 | use std::os::unix::io::{AsRawFd, RawFd}; |
| 8 | use log::*; | ||
| 9 | 9 | ||
| 10 | pub const SIOCGIFMTU: libc::c_ulong = 0x8921; | 10 | pub const SIOCGIFMTU: libc::c_ulong = 0x8921; |
| 11 | pub const SIOCGIFINDEX: libc::c_ulong = 0x8933; | 11 | pub const SIOCGIFINDEX: libc::c_ulong = 0x8933; |
| @@ -142,8 +142,8 @@ impl TunTapDevice { | |||
| 142 | } | 142 | } |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | use embassy_net::{LinkState, DeviceCapabilities, Packet, PacketBox, PacketBuf}; | ||
| 146 | use core::task::Waker; | 145 | use core::task::Waker; |
| 146 | use embassy_net::{DeviceCapabilities, LinkState, Packet, PacketBox, PacketBuf}; | ||
| 147 | 147 | ||
| 148 | impl crate::Device for TunTapDevice { | 148 | impl crate::Device for TunTapDevice { |
| 149 | fn is_transmit_ready(&mut self) -> bool { | 149 | fn is_transmit_ready(&mut self) -> bool { |
| @@ -197,4 +197,8 @@ impl crate::Device for TunTapDevice { | |||
| 197 | fn link_state(&mut self) -> LinkState { | 197 | fn link_state(&mut self) -> LinkState { |
| 198 | LinkState::Up | 198 | LinkState::Up |
| 199 | } | 199 | } |
| 200 | |||
| 201 | fn ethernet_address(&mut self) -> [u8; 6] { | ||
| 202 | [0x02, 0x03, 0x04, 0x05, 0x06, 0x07] | ||
| 203 | } | ||
| 200 | } | 204 | } |
