diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-03-27 03:33:06 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-03-27 03:33:06 +0200 |
| commit | cffc3fc7956570c66bf1bd259a4f68a8ca02fe58 (patch) | |
| tree | 25ef48ee2e02a29528cf2d42bff4d78d52f349bf /src/control.rs | |
| parent | bb90bb8c563a02d314ba574f45816d5d3c79be38 (diff) | |
Fix build with log.
Diffstat (limited to 'src/control.rs')
| -rw-r--r-- | src/control.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/control.rs b/src/control.rs index 7f1c9fe86..8bfa033ba 100644 --- a/src/control.rs +++ b/src/control.rs | |||
| @@ -9,6 +9,7 @@ use embassy_time::{Duration, Timer}; | |||
| 9 | pub use crate::bus::SpiBusCyw43; | 9 | pub use crate::bus::SpiBusCyw43; |
| 10 | use crate::consts::*; | 10 | use crate::consts::*; |
| 11 | use crate::events::{Event, EventQueue}; | 11 | use crate::events::{Event, EventQueue}; |
| 12 | use crate::fmt::Bytes; | ||
| 12 | use crate::structs::*; | 13 | use crate::structs::*; |
| 13 | use crate::{countries, IoctlState, IoctlType, PowerManagementMode}; | 14 | use crate::{countries, IoctlState, IoctlType, PowerManagementMode}; |
| 14 | 15 | ||
| @@ -75,7 +76,7 @@ impl<'a> Control<'a> { | |||
| 75 | // read MAC addr. | 76 | // read MAC addr. |
| 76 | let mut mac_addr = [0; 6]; | 77 | let mut mac_addr = [0; 6]; |
| 77 | assert_eq!(self.get_iovar("cur_etheraddr", &mut mac_addr).await, 6); | 78 | assert_eq!(self.get_iovar("cur_etheraddr", &mut mac_addr).await, 6); |
| 78 | info!("mac addr: {:02x}", mac_addr); | 79 | info!("mac addr: {:02x}", Bytes(&mac_addr)); |
| 79 | 80 | ||
| 80 | let country = countries::WORLD_WIDE_XX; | 81 | let country = countries::WORLD_WIDE_XX; |
| 81 | let country_info = CountryInfo { | 82 | let country_info = CountryInfo { |
| @@ -205,7 +206,7 @@ impl<'a> Control<'a> { | |||
| 205 | let msg = subscriber.next_message_pure().await; | 206 | let msg = subscriber.next_message_pure().await; |
| 206 | if msg.event_type == Event::AUTH && msg.status != 0 { | 207 | if msg.event_type == Event::AUTH && msg.status != 0 { |
| 207 | // retry | 208 | // retry |
| 208 | defmt::warn!("JOIN failed with status={}", msg.status); | 209 | warn!("JOIN failed with status={}", msg.status); |
| 209 | self.ioctl(IoctlType::Set, 26, 0, &mut i.to_bytes()).await; | 210 | self.ioctl(IoctlType::Set, 26, 0, &mut i.to_bytes()).await; |
| 210 | } else if msg.event_type == Event::JOIN && msg.status == 0 { | 211 | } else if msg.event_type == Event::JOIN && msg.status == 0 { |
| 211 | // successful join | 212 | // successful join |
| @@ -241,7 +242,7 @@ impl<'a> Control<'a> { | |||
| 241 | } | 242 | } |
| 242 | 243 | ||
| 243 | async fn set_iovar(&mut self, name: &str, val: &[u8]) { | 244 | async fn set_iovar(&mut self, name: &str, val: &[u8]) { |
| 244 | info!("set {} = {:02x}", name, val); | 245 | info!("set {} = {:02x}", name, Bytes(val)); |
| 245 | 246 | ||
| 246 | let mut buf = [0; 64]; | 247 | let mut buf = [0; 64]; |
| 247 | buf[..name.len()].copy_from_slice(name.as_bytes()); | 248 | buf[..name.len()].copy_from_slice(name.as_bytes()); |
