aboutsummaryrefslogtreecommitdiff
path: root/src/control.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/control.rs')
-rw-r--r--src/control.rs7
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};
9pub use crate::bus::SpiBusCyw43; 9pub use crate::bus::SpiBusCyw43;
10use crate::consts::*; 10use crate::consts::*;
11use crate::events::{Event, EventQueue}; 11use crate::events::{Event, EventQueue};
12use crate::fmt::Bytes;
12use crate::structs::*; 13use crate::structs::*;
13use crate::{countries, IoctlState, IoctlType, PowerManagementMode}; 14use 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());