aboutsummaryrefslogtreecommitdiff
path: root/examples/std
diff options
context:
space:
mode:
Diffstat (limited to 'examples/std')
-rw-r--r--examples/std/Cargo.toml1
-rw-r--r--examples/std/src/tuntap.rs12
2 files changed, 7 insertions, 6 deletions
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml
index 649e39747..45b2a4a4f 100644
--- a/examples/std/Cargo.toml
+++ b/examples/std/Cargo.toml
@@ -9,6 +9,7 @@ embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["lo
9embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "std", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "std", "nightly", "integrated-timers"] }
10embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["log", "std", "nightly"] } 10embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["log", "std", "nightly"] }
11embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "tcp", "udp", "dhcpv4"] } 11embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "tcp", "udp", "dhcpv4"] }
12embassy-net-driver = { version = "0.1.0", path = "../../embassy-net-driver" }
12embedded-io = { version = "0.4.0", features = ["async", "std", "futures"] } 13embedded-io = { version = "0.4.0", features = ["async", "std", "futures"] }
13critical-section = { version = "1.1", features = ["std"] } 14critical-section = { version = "1.1", features = ["std"] }
14 15
diff --git a/examples/std/src/tuntap.rs b/examples/std/src/tuntap.rs
index bb3e194cc..d918a2e62 100644
--- a/examples/std/src/tuntap.rs
+++ b/examples/std/src/tuntap.rs
@@ -4,7 +4,7 @@ use std::os::unix::io::{AsRawFd, RawFd};
4use std::task::Context; 4use std::task::Context;
5 5
6use async_io::Async; 6use async_io::Async;
7use embassy_net::device::{self, Device, DeviceCapabilities, LinkState}; 7use embassy_net_driver::{self, Capabilities, Driver, LinkState};
8use log::*; 8use log::*;
9 9
10pub const SIOCGIFMTU: libc::c_ulong = 0x8921; 10pub const SIOCGIFMTU: libc::c_ulong = 0x8921;
@@ -137,7 +137,7 @@ impl TunTapDevice {
137 } 137 }
138} 138}
139 139
140impl Device for TunTapDevice { 140impl Driver for TunTapDevice {
141 type RxToken<'a> = RxToken where Self: 'a; 141 type RxToken<'a> = RxToken where Self: 'a;
142 type TxToken<'a> = TxToken<'a> where Self: 'a; 142 type TxToken<'a> = TxToken<'a> where Self: 'a;
143 143
@@ -170,8 +170,8 @@ impl Device for TunTapDevice {
170 }) 170 })
171 } 171 }
172 172
173 fn capabilities(&self) -> DeviceCapabilities { 173 fn capabilities(&self) -> Capabilities {
174 let mut caps = DeviceCapabilities::default(); 174 let mut caps = Capabilities::default();
175 caps.max_transmission_unit = self.device.get_ref().mtu; 175 caps.max_transmission_unit = self.device.get_ref().mtu;
176 caps 176 caps
177 } 177 }
@@ -190,7 +190,7 @@ pub struct RxToken {
190 buffer: Vec<u8>, 190 buffer: Vec<u8>,
191} 191}
192 192
193impl device::RxToken for RxToken { 193impl embassy_net_driver::RxToken for RxToken {
194 fn consume<R, F>(mut self, f: F) -> R 194 fn consume<R, F>(mut self, f: F) -> R
195 where 195 where
196 F: FnOnce(&mut [u8]) -> R, 196 F: FnOnce(&mut [u8]) -> R,
@@ -204,7 +204,7 @@ pub struct TxToken<'a> {
204 device: &'a mut Async<TunTap>, 204 device: &'a mut Async<TunTap>,
205} 205}
206 206
207impl<'a> device::TxToken for TxToken<'a> { 207impl<'a> embassy_net_driver::TxToken for TxToken<'a> {
208 fn consume<R, F>(self, len: usize, f: F) -> R 208 fn consume<R, F>(self, len: usize, f: F) -> R
209 where 209 where
210 F: FnOnce(&mut [u8]) -> R, 210 F: FnOnce(&mut [u8]) -> R,