From 39cffdd123015da72ad99feebafa4d28d4e1b79c Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 1 Jun 2022 13:48:09 +0200 Subject: [PATCH 1/2] Add reexport for ipv6 types with proto-ipv6 --- embassy-net/Cargo.toml | 1 + embassy-net/src/lib.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml index 4692c01cb..87982a726 100644 --- a/embassy-net/Cargo.toml +++ b/embassy-net/Cargo.toml @@ -22,6 +22,7 @@ defmt = ["dep:defmt", "smoltcp/defmt"] tcp = ["smoltcp/socket-tcp"] dns = ["smoltcp/socket-dns"] dhcpv4 = ["medium-ethernet", "smoltcp/socket-dhcpv4"] +proto-ipv6 = ["smoltcp/proto-ipv6"] medium-ethernet = ["smoltcp/medium-ethernet"] medium-ip = ["smoltcp/medium-ip"] diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index 7b5f29f16..243dfda88 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs @@ -23,3 +23,6 @@ pub use smoltcp::time::Instant as SmolInstant; #[cfg(feature = "medium-ethernet")] pub use smoltcp::wire::{EthernetAddress, HardwareAddress}; pub use smoltcp::wire::{IpAddress, IpCidr, Ipv4Address, Ipv4Cidr}; + +#[cfg(feature = "proto-ipv6")] +pub use smoltcp::wire::{Ipv6Address, Ipv6Cidr}; From 8b676e65ade55b740062dcd534088196fb275dad Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 1 Jun 2022 13:48:28 +0200 Subject: [PATCH 2/2] Add embedded-io implementation of ConnectError --- embassy-net/src/tcp.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs index 2d81e66bd..35ecf1b0c 100644 --- a/embassy-net/src/tcp.rs +++ b/embassy-net/src/tcp.rs @@ -259,6 +259,12 @@ impl<'d> TcpIo<'d> { } } +impl embedded_io::Error for ConnectError { + fn kind(&self) -> embedded_io::ErrorKind { + embedded_io::ErrorKind::Other + } +} + impl embedded_io::Error for Error { fn kind(&self) -> embedded_io::ErrorKind { embedded_io::ErrorKind::Other