Skip to content

Commit

Permalink
walk back embedded-nal bump for complexity reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens committed Mar 19, 2024
1 parent 4a528d9 commit f9e5aa3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/quartiq/smoltcp-nal.git"

[dependencies]
heapless = "0.7"
embedded-nal = "0.8"
embedded-nal = "0.7"
embedded-time = "0.12"

[dependencies.nanorand]
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,9 @@ where
}

fn get_host_by_address(
&self,
&mut self,
_addr: embedded_nal::IpAddr,
_result: &mut [u8],
) -> Result<usize, Self::Error> {
) -> embedded_nal::nb::Result<embedded_nal::heapless::String<256>, Self::Error> {
unimplemented!()
}
}
9 changes: 1 addition & 8 deletions src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ macro_rules! forward {
}
}
}
macro_rules! forward_ref {
($func:ident($($v:ident: $IT:ty),*) -> $T:ty) => {
fn $func(&self, $($v: $IT),*) -> $T {
self.mutex.lock(|stack| stack.$func($($v),*))
}
}
}

// Implement a TCP stack for the proxy if the underlying network stack implements it.
impl<'a, S> embedded_nal::TcpClientStack for NetworkStackProxy<'a, S>
Expand Down Expand Up @@ -106,7 +99,7 @@ where
type Error = S::Error;

forward! {get_host_by_name(hostname: &str, addr_type: embedded_nal::AddrType) -> embedded_nal::nb::Result<embedded_nal::IpAddr, Self::Error>}
forward_ref! {get_host_by_address(addr: embedded_nal::IpAddr, result: &mut [u8]) -> Result<usize, Self::Error>}
forward! {get_host_by_address(addr: embedded_nal::IpAddr) -> embedded_nal::nb::Result<embedded_nal::heapless::String<256>, Self::Error>}
}

impl<'a, Device, Clock> NetworkManager<'a, Device, Clock>
Expand Down

0 comments on commit f9e5aa3

Please sign in to comment.