From 1d6b32c320baccdba2abfc5a30afd664a7d33a5b Mon Sep 17 00:00:00 2001 From: occheung Date: Fri, 22 Jan 2021 10:21:07 +0800 Subject: [PATCH] smoltcp: bump to 0.7.0 --- Cargo.toml | 2 +- src/nal.rs | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 270be88..093acb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ license = "BSD-2-Clause" volatile-register = "0.2" aligned = "0.3" embedded-hal = "0.2" -smoltcp = { version = "0.6.0", default-features = false, features = ["proto-ipv4", "proto-ipv6", "socket-icmp", "socket-udp", "socket-tcp", "log", "verbose", "ethernet"], optional = true } +smoltcp = { version = "0.7.0", default-features = false, features = ["proto-ipv4", "proto-ipv6", "socket-icmp", "socket-udp", "socket-tcp", "log", "verbose", "ethernet"], optional = true } # Optional dependencies for building examples stm32f4xx-hal = { version = "0.8", optional = true } cortex-m = { version = "0.5", optional = true } diff --git a/src/nal.rs b/src/nal.rs index 7312cb0..0204037 100644 --- a/src/nal.rs +++ b/src/nal.rs @@ -21,35 +21,33 @@ pub enum NetworkError { } pub type NetworkInterface = net::iface::EthernetInterface< - 'static, - 'static, 'static, crate::smoltcp_phy::SmoltcpDevice< crate::SpiEth >, >; -pub struct NetworkStack<'a, 'b, 'c, SPI, NSS, Delay> +pub struct NetworkStack<'a, SPI, NSS, Delay> where SPI: 'static + Transfer, NSS: 'static + OutputPin, Delay: 'static + DelayUs { network_interface: RefCell>, - sockets: RefCell>, + sockets: RefCell>, next_port: RefCell, unused_handles: RefCell>, time_ms: RefCell, last_update_instant: RefCell>, } -impl<'a, 'b, 'c, SPI, NSS, Delay> NetworkStack<'a, 'b, 'c, SPI, NSS, Delay> +impl<'a, SPI, NSS, Delay> NetworkStack<'a, SPI, NSS, Delay> where SPI: Transfer, NSS: OutputPin, Delay: DelayUs { - pub fn new(interface: NetworkInterface, sockets: net::socket::SocketSet<'a, 'b, 'c>) -> Self { + pub fn new(interface: NetworkInterface, sockets: net::socket::SocketSet<'a>) -> Self { let mut unused_handles: Vec = Vec::new(); for socket in sockets.iter() { unused_handles.push(socket.handle()).unwrap(); @@ -115,7 +113,7 @@ where } } -impl<'a, 'b, 'c, SPI, NSS, Delay> nal::TcpStack for NetworkStack<'a, 'b, 'c, SPI, NSS, Delay> +impl<'a, SPI, NSS, Delay> nal::TcpStack for NetworkStack<'a, SPI, NSS, Delay> where SPI: Transfer, NSS: OutputPin,