Adds MAC display to preference dialog box

also offer both hex and decimal formatting outputs on wlan status
This commit is contained in:
bunnie 2023-03-24 23:07:29 +08:00
parent 2bb58bb63f
commit f4fabc3f8e
2 changed files with 4 additions and 3 deletions

View file

@ -152,8 +152,8 @@ impl<'a> ShellCmdApi<'a> for Wlan {
"status" => { "status" => {
let _ = match env.com.wlan_status() { let _ = match env.com.wlan_status() {
Ok(msg) => { Ok(msg) => {
log::info!("{}WLAN.STATUS,{:x?},{}", xous::BOOKEND_START, std::net::IpAddr::from(msg.ipv4.addr), xous::BOOKEND_END); log::info!("{}WLAN.STATUS,{:?},{}", xous::BOOKEND_START, std::net::IpAddr::from(msg.ipv4.addr), xous::BOOKEND_END);
write!(ret, "{:x?}", msg) write!(ret, "{:?}\n{:x?}", msg, msg)
}, },
Err(e) => write!(ret, "Error: {:?}", e), Err(e) => write!(ret, "Error: {:?}", e),
}; };

View file

@ -286,7 +286,7 @@ impl WLANMan {
// TODO: make a proper translation for this. But, I think for now, this is a fairly // TODO: make a proper translation for this. But, I think for now, this is a fairly
// technical screen that we can leave in English. // technical screen that we can leave in English.
let status_str = format!( let status_str = format!(
"Connection status: \n\n ▪ SSID: {}\n ▪ Link state: {:?}\n ▪ IP: {}\n ▪ Gateway: {}\n ▪ Subnet mask: {}\n ▪ DNS 1: {}\n ▪ DNS 2: {}\n ▪ DHCP state: {:?}", "Connection status: \n\n ▪ SSID: {}\n ▪ Link state: {:?}\n ▪ IP: {}\n ▪ Gateway: {}\n ▪ Subnet mask: {}\n ▪ DNS 1: {}\n ▪ DNS 2: {}\n ▪ DHCP state: {:?}\n ▪ MAC: {:x?}",
ssid, ssid,
ls, ls,
format_ip(ip.addr), format_ip(ip.addr),
@ -295,6 +295,7 @@ impl WLANMan {
format_ip(ip.dns1), format_ip(ip.dns1),
format_ip(ip.dns2), format_ip(ip.dns2),
ip.dhcp, ip.dhcp,
ip.mac
); );
self.modals.show_notification(&status_str, None).unwrap(); self.modals.show_notification(&status_str, None).unwrap();