789: Embassy net improvements r=lulf a=lulf

I found these useful while implementing the TcpClient traits for embedded-nal-async:

https://github.com/drogue-iot/drogue-device/blob/shared-tcp-stack/device/src/drivers/tcp/smoltcp.rs

Once e-n-a PR is merged, I might add the above client to embassy-net if you think it makes sense.

Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
This commit is contained in:
bors[bot] 2022-06-01 18:09:51 +00:00 committed by GitHub
commit dbff4779eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -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"]

View File

@ -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};

View File

@ -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