From 5205261809bba6e9bc72a62be05044c454c3cae3 Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 13 Sep 2024 10:01:04 +0200 Subject: [PATCH] Add debug derive fixing log feature --- src/asynch/at_udp_socket.rs | 11 +++-------- src/asynch/control.rs | 2 +- src/asynch/state.rs | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/asynch/at_udp_socket.rs b/src/asynch/at_udp_socket.rs index 4428181..fb410cb 100644 --- a/src/asynch/at_udp_socket.rs +++ b/src/asynch/at_udp_socket.rs @@ -7,6 +7,7 @@ pub struct AtUdpSocket<'a>(pub(crate) UdpSocket<'a>); impl<'a> AtUdpSocket<'a> { pub(crate) const PPP_AT_PORT: u16 = 23; + pub(crate) const PPP_AT_IP: Ipv4Address = Ipv4Address::new(172, 30, 0, 251); } impl<'a> embedded_io_async::ErrorType for &AtUdpSocket<'a> { @@ -23,10 +24,7 @@ impl<'a> Read for &AtUdpSocket<'a> { impl<'a> Write for &AtUdpSocket<'a> { async fn write(&mut self, buf: &[u8]) -> Result { self.0 - .send_to( - buf, - (Ipv4Address::new(172, 30, 0, 251), AtUdpSocket::PPP_AT_PORT), - ) + .send_to(buf, (AtUdpSocket::PPP_AT_IP, AtUdpSocket::PPP_AT_PORT)) .await .unwrap(); @@ -58,10 +56,7 @@ impl<'a> Read for AtUdpSocket<'a> { impl<'a> Write for AtUdpSocket<'a> { async fn write(&mut self, buf: &[u8]) -> Result { self.0 - .send_to( - buf, - (Ipv4Address::new(172, 30, 0, 251), AtUdpSocket::PPP_AT_PORT), - ) + .send_to(buf, (AtUdpSocket::PPP_AT_IP, AtUdpSocket::PPP_AT_PORT)) .await .unwrap(); diff --git a/src/asynch/control.rs b/src/asynch/control.rs index df35972..2404659 100644 --- a/src/asynch/control.rs +++ b/src/asynch/control.rs @@ -144,7 +144,7 @@ impl<'a, const INGRESS_BUF_SIZE: usize, const URC_CAPACITY: usize> Self { state_ch, at_client: ProxyClient::new(req_sender, res_slot), - urc_channel: urc_channel, + urc_channel, } } diff --git a/src/asynch/state.rs b/src/asynch/state.rs index 4dc3784..f7b1c3e 100644 --- a/src/asynch/state.rs +++ b/src/asynch/state.rs @@ -11,7 +11,7 @@ use embassy_sync::waitqueue::WakerRegistration; use crate::connection::{WiFiState, WifiConnection}; /// The link state of a network device. -#[derive(PartialEq, Eq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum LinkState { /// Device is not yet initialized.