Skip to content

Commit

Permalink
fix(examples/coap): Various fixes (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn authored Oct 24, 2024
2 parents f1f73ee + 862a829 commit fb10fa9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/coap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 1 addition & 2 deletions examples/coap/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion examples/coap/src/udp_nal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<'a> ConnectedUdp<'a> {
/// unconnected.
pub async fn connect(socket: udp::UdpSocket<'a>, /*, ... */) -> Result<Self, udp::BindError> {
// This is really just a copy of the provided `embedded_nal::udp::UdpStack::connect` method
todo!()
todo!("use {:p}", &socket)
}
}

Expand Down
3 changes: 2 additions & 1 deletion examples/coap/src/udp_nal/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
Expand Down

0 comments on commit fb10fa9

Please sign in to comment.