aboutsummaryrefslogtreecommitdiff
path: root/embassy-net-examples/src
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-03-02 21:20:00 +0100
committerDario Nieuwenhuis <[email protected]>2021-03-02 21:20:00 +0100
commit9bee576fd241f019c363919b0c29551c6b8ee4b2 (patch)
tree96bfb71546ab96b02cb5c26d6b754793e4bd64e9 /embassy-net-examples/src
parentf100383b3c094830fee4e54956795388bd5edec1 (diff)
Update embassy
Diffstat (limited to 'embassy-net-examples/src')
-rw-r--r--embassy-net-examples/src/main.rs5
-rw-r--r--embassy-net-examples/src/tuntap.rs8
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
3use embassy::executor::{Spawner, task}; 3use embassy::executor::{task, Spawner};
4use embassy::io::{AsyncBufReadExt, AsyncWriteExt}; 4use embassy::io::AsyncWriteExt;
5use embassy::time::{Duration, Timer};
6use embassy::util::Forever; 5use embassy::util::Forever;
7use embassy_net::*; 6use embassy_net::*;
8use embassy_std::Executor; 7use 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 @@
1use async_io::Async; 1use async_io::Async;
2use embassy::util::WakerRegistration; 2use embassy::util::WakerRegistration;
3use libc; 3use libc;
4use log::*;
4use smoltcp::wire::EthernetFrame; 5use smoltcp::wire::EthernetFrame;
5use std::io; 6use std::io;
6use std::io::{Read, Write}; 7use std::io::{Read, Write};
7use std::os::unix::io::{AsRawFd, RawFd}; 8use std::os::unix::io::{AsRawFd, RawFd};
8use log::*;
9 9
10pub const SIOCGIFMTU: libc::c_ulong = 0x8921; 10pub const SIOCGIFMTU: libc::c_ulong = 0x8921;
11pub const SIOCGIFINDEX: libc::c_ulong = 0x8933; 11pub const SIOCGIFINDEX: libc::c_ulong = 0x8933;
@@ -142,8 +142,8 @@ impl TunTapDevice {
142 } 142 }
143} 143}
144 144
145use embassy_net::{LinkState, DeviceCapabilities, Packet, PacketBox, PacketBuf};
146use core::task::Waker; 145use core::task::Waker;
146use embassy_net::{DeviceCapabilities, LinkState, Packet, PacketBox, PacketBuf};
147 147
148impl crate::Device for TunTapDevice { 148impl 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}