smoltcp: bump to 0.7.0
This commit is contained in:
parent
0df7680d60
commit
1d6b32c320
|
@ -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 }
|
||||
|
|
12
src/nal.rs
12
src/nal.rs
|
@ -21,35 +21,33 @@ pub enum NetworkError {
|
|||
}
|
||||
|
||||
pub type NetworkInterface<SPI, NSS, Delay> = net::iface::EthernetInterface<
|
||||
'static,
|
||||
'static,
|
||||
'static,
|
||||
crate::smoltcp_phy::SmoltcpDevice<
|
||||
crate::SpiEth<SPI, NSS, Delay>
|
||||
>,
|
||||
>;
|
||||
|
||||
pub struct NetworkStack<'a, 'b, 'c, SPI, NSS, Delay>
|
||||
pub struct NetworkStack<'a, SPI, NSS, Delay>
|
||||
where
|
||||
SPI: 'static + Transfer<u8>,
|
||||
NSS: 'static + OutputPin,
|
||||
Delay: 'static + DelayUs<u16>
|
||||
{
|
||||
network_interface: RefCell<NetworkInterface<SPI, NSS, Delay>>,
|
||||
sockets: RefCell<net::socket::SocketSet<'a, 'b, 'c>>,
|
||||
sockets: RefCell<net::socket::SocketSet<'a>>,
|
||||
next_port: RefCell<u16>,
|
||||
unused_handles: RefCell<Vec<net::socket::SocketHandle, consts::U16>>,
|
||||
time_ms: RefCell<u32>,
|
||||
last_update_instant: RefCell<Option<Instant>>,
|
||||
}
|
||||
|
||||
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<u8>,
|
||||
NSS: OutputPin,
|
||||
Delay: DelayUs<u16>
|
||||
{
|
||||
pub fn new(interface: NetworkInterface<SPI, NSS, Delay>, sockets: net::socket::SocketSet<'a, 'b, 'c>) -> Self {
|
||||
pub fn new(interface: NetworkInterface<SPI, NSS, Delay>, sockets: net::socket::SocketSet<'a>) -> Self {
|
||||
let mut unused_handles: Vec<net::socket::SocketHandle, consts::U16> = 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<u8>,
|
||||
NSS: OutputPin,
|
||||
|
|
Loading…
Reference in New Issue