Skip to content

Commit

Permalink
Add debug derive fixing log feature
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasKoch committed Sep 13, 2024
1 parent 623a7c0 commit 5205261
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
11 changes: 3 additions & 8 deletions src/asynch/at_udp_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand All @@ -23,10 +24,7 @@ impl<'a> Read for &AtUdpSocket<'a> {
impl<'a> Write for &AtUdpSocket<'a> {
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
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();

Expand Down Expand Up @@ -58,10 +56,7 @@ impl<'a> Read for AtUdpSocket<'a> {
impl<'a> Write for AtUdpSocket<'a> {
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
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();

Expand Down
2 changes: 1 addition & 1 deletion src/asynch/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/asynch/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5205261

Please sign in to comment.