From 6d53456c923f68911f2fde42da23ff2f6aa0a672 Mon Sep 17 00:00:00 2001 From: chrysn Date: Tue, 2 Jul 2024 22:46:15 +0200 Subject: [PATCH 1/3] fix(examples/coap): Minor lint fixes --- examples/coap/src/main.rs | 3 +-- examples/coap/src/udp_nal/mod.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/coap/src/main.rs b/examples/coap/src/main.rs index 72a041dcd..9d7fb89af 100644 --- a/examples/coap/src/main.rs +++ b/examples/coap/src/main.rs @@ -6,7 +6,6 @@ use riot_rs::{debug::log::*, network}; use embassy_net::udp::{PacketMetadata, UdpSocket}; -use embedded_nal_coap::TransportError; // Moving work from https://github.com/embassy-rs/embassy/pull/2519 in here for the time being mod udp_nal; @@ -95,7 +94,7 @@ where R, ); - let mut handler = coap_message_demos::full_application_tree(log) + let handler = coap_message_demos::full_application_tree(log) .at( &["stdout"], coap_scroll_ring_server::BufferHandler::new(&buffer), diff --git a/examples/coap/src/udp_nal/mod.rs b/examples/coap/src/udp_nal/mod.rs index ec27a43bf..6c9478314 100644 --- a/examples/coap/src/udp_nal/mod.rs +++ b/examples/coap/src/udp_nal/mod.rs @@ -76,7 +76,7 @@ impl<'a> ConnectedUdp<'a> { /// unconnected. pub async fn connect(socket: udp::UdpSocket<'a>, /*, ... */) -> Result { // This is really just a copy of the provided `embedded_nal::udp::UdpStack::connect` method - todo!() + todo!("use {:p}", &socket) } } From 23238f433b1009dfc8ff467b9c4b4a137cfe0a50 Mon Sep 17 00:00:00 2001 From: chrysn Date: Thu, 24 Oct 2024 15:40:32 +0200 Subject: [PATCH 2/3] fix(examples/coap): Propagate IP version features --- examples/coap/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/coap/Cargo.toml b/examples/coap/Cargo.toml index 62820a62d..375430a06 100644 --- a/examples/coap/Cargo.toml +++ b/examples/coap/Cargo.toml @@ -45,5 +45,5 @@ scroll-ring = "0.1.1" [features] default = ["proto-ipv4"] # shame # actually embedded-nal features, we have to match them here while developing udp_nal in here -proto-ipv4 = [] -proto-ipv6 = [] +proto-ipv4 = ["embassy-net/proto-ipv4"] +proto-ipv6 = ["embassy-net/proto-ipv6"] From 862a829a5b8f1eed84d3f5c343910b19284af7f3 Mon Sep 17 00:00:00 2001 From: chrysn Date: Wed, 3 Jul 2024 13:43:06 +0200 Subject: [PATCH 3/3] fix(examples/coap): Restore building with IPv6 enabled --- examples/coap/src/udp_nal/util.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/coap/src/udp_nal/util.rs b/examples/coap/src/udp_nal/util.rs index 0f5824c9d..09edf7122 100644 --- a/examples/coap/src/udp_nal/util.rs +++ b/examples/coap/src/udp_nal/util.rs @@ -38,7 +38,8 @@ pub(super) fn sockaddr_smol2nal(endpoint: IpEndpoint) -> nal::SocketAddr { } #[cfg(feature = "proto-ipv6")] IpAddress::Ipv6(addr) => { - embedded_nal_async::SocketAddrV6::new(addr.0.into(), endpoint.port).into() + // FIXME: Where is smoltcp's zone identifier? + embedded_nal_async::SocketAddrV6::new(addr.0.into(), endpoint.port, 0, 0).into() } } }