add automation strings

This commit is contained in:
bunnie 2022-05-24 23:21:26 +08:00
parent 2f8c850cd6
commit 62cbc86aeb
9 changed files with 48 additions and 4 deletions

View file

@ -1050,6 +1050,10 @@ fn xmain() -> ! {
.wlan_get_config() .wlan_get_config()
.expect("couldn't retrieve updated ipv4 config"); .expect("couldn't retrieve updated ipv4 config");
log::info!("Network config acquired: {:?}", config); log::info!("Network config acquired: {:?}", config);
log::info!("{}NET.OK,{:?},{}",
xous::BOOKEND_START,
std::net::IpAddr::from(config.addr),
xous::BOOKEND_END);
net_config = Some(config); net_config = Some(config);
// note: ARP cache is stale. Maybe that's ok? // note: ARP cache is stale. Maybe that's ok?

View file

@ -1449,6 +1449,7 @@ impl PddbOs {
let mut checkblock_a = [0u8; BLOCK_SIZE]; let mut checkblock_a = [0u8; BLOCK_SIZE];
self.rootkeys.decrypt_block(GenericArray::from_mut_slice(&mut checkblock_a)); self.rootkeys.decrypt_block(GenericArray::from_mut_slice(&mut checkblock_a));
log::info!("{}PDDB.CHECKPASS,{}", xous::BOOKEND_START, xous::BOOKEND_END);
#[cfg(any(target_os = "none", target_os = "xous"))] // skip this dialog in hosted mode #[cfg(any(target_os = "none", target_os = "xous"))] // skip this dialog in hosted mode
modals.show_notification(t!("pddb.checkpass", xous::LANG), None).expect("notification failed"); modals.show_notification(t!("pddb.checkpass", xous::LANG), None).expect("notification failed");
@ -1459,6 +1460,7 @@ impl PddbOs {
if checkblock_a == checkblock_b { if checkblock_a == checkblock_b {
success = true; success = true;
} else { } else {
log::info!("{}PDDB.PWFAIL,{}", xous::BOOKEND_START, xous::BOOKEND_END);
modals.show_notification(t!("pddb.checkpass_fail", xous::LANG), None).expect("notification failed"); modals.show_notification(t!("pddb.checkpass_fail", xous::LANG), None).expect("notification failed");
self.clear_password(); self.clear_password();
} }

View file

@ -545,6 +545,7 @@ fn xmain() -> ! {
} else { } else {
if !pddb_os.rootkeys_initialized() { if !pddb_os.rootkeys_initialized() {
// can't mount if we have no root keys // can't mount if we have no root keys
log::info!("{}PDDB.SKIPMOUNT,{}", xous::BOOKEND_START, xous::BOOKEND_END);
xous::return_scalar(msg.sender, 0).expect("could't return scalar"); xous::return_scalar(msg.sender, 0).expect("could't return scalar");
} else { } else {
match ensure_password(&modals, &mut pddb_os, pw_cid) { match ensure_password(&modals, &mut pddb_os, pw_cid) {
@ -555,6 +556,7 @@ fn xmain() -> ! {
xous::return_scalar(requester, 1).expect("couldn't return scalar"); xous::return_scalar(requester, 1).expect("couldn't return scalar");
} }
assert!(mount_notifications.len() == 0, "apparently I don't understand what drain() does"); assert!(mount_notifications.len() == 0, "apparently I don't understand what drain() does");
log::info!("{}PDDB.MOUNTED,{}", xous::BOOKEND_START, xous::BOOKEND_END);
xous::return_scalar(msg.sender, 1).expect("couldn't return scalar"); xous::return_scalar(msg.sender, 1).expect("couldn't return scalar");
} else { } else {
xous::return_scalar(msg.sender, 0).expect("couldn't return scalar"); xous::return_scalar(msg.sender, 0).expect("couldn't return scalar");
@ -567,6 +569,7 @@ fn xmain() -> ! {
xous::return_scalar(requester, 1).expect("couldn't return scalar"); xous::return_scalar(requester, 1).expect("couldn't return scalar");
} }
assert!(mount_notifications.len() == 0, "apparently I don't understand what drain() does"); assert!(mount_notifications.len() == 0, "apparently I don't understand what drain() does");
log::info!("{}PDDB.MOUNTED,{}", xous::BOOKEND_START, xous::BOOKEND_END);
xous::return_scalar(msg.sender, 1).expect("couldn't return scalar"); xous::return_scalar(msg.sender, 1).expect("couldn't return scalar");
} else { } else {
xous::return_scalar(msg.sender, 0).expect("couldn't return scalar"); xous::return_scalar(msg.sender, 0).expect("couldn't return scalar");
@ -1187,6 +1190,7 @@ fn ensure_password(modals: &modals::Modals, pddb_os: &mut PddbOs, _pw_cid: xous:
} }
PasswordState::Incorrect => { PasswordState::Incorrect => {
pddb_os.clear_password(); // clear the bad password entry pddb_os.clear_password(); // clear the bad password entry
log::info!("{}PDDB.BADPW,{}", xous::BOOKEND_START, xous::BOOKEND_END);
// check if the user wants to re-try or not. // check if the user wants to re-try or not.
modals.add_list_item(t!("pddb.yes", xous::LANG)).expect("couldn't build radio item list"); modals.add_list_item(t!("pddb.yes", xous::LANG)).expect("couldn't build radio item list");
modals.add_list_item(t!("pddb.no", xous::LANG)).expect("couldn't build radio item list"); modals.add_list_item(t!("pddb.no", xous::LANG)).expect("couldn't build radio item list");
@ -1238,6 +1242,7 @@ fn try_mount_or_format(modals: &modals::Modals, pddb_os: &mut PddbOs, basis_cach
modals.add_list_item(t!("pddb.okay", xous::LANG)).expect("couldn't build radio item list"); modals.add_list_item(t!("pddb.okay", xous::LANG)).expect("couldn't build radio item list");
modals.add_list_item(t!("pddb.cancel", xous::LANG)).expect("couldn't build radio item list"); modals.add_list_item(t!("pddb.cancel", xous::LANG)).expect("couldn't build radio item list");
let do_format: bool; let do_format: bool;
log::info!("{}PDDB.REQFMT,{}", xous::BOOKEND_START, xous::BOOKEND_END);
match modals.get_radiobutton(t!("pddb.requestformat", xous::LANG)) { match modals.get_radiobutton(t!("pddb.requestformat", xous::LANG)) {
Ok(response) => { Ok(response) => {
if response.as_str() == t!("pddb.okay", xous::LANG) { if response.as_str() == t!("pddb.okay", xous::LANG) {

View file

@ -473,6 +473,7 @@ fn xmain() -> ! {
} else { } else {
modals.add_list_item(t!("rootkeys.confirm.yes", xous::LANG)).expect("modals error"); modals.add_list_item(t!("rootkeys.confirm.yes", xous::LANG)).expect("modals error");
modals.add_list_item(t!("rootkeys.confirm.no", xous::LANG)).expect("modals error"); modals.add_list_item(t!("rootkeys.confirm.no", xous::LANG)).expect("modals error");
log::info!("{}ROOTKEY.CONFIRM,{}", xous::BOOKEND_START, xous::BOOKEND_END);
match modals.get_radiobutton(t!("rootkeys.confirm", xous::LANG)) { match modals.get_radiobutton(t!("rootkeys.confirm", xous::LANG)) {
Ok(response) => { Ok(response) => {
if response == t!("rootkeys.confirm.no", xous::LANG) { if response == t!("rootkeys.confirm.no", xous::LANG) {
@ -500,6 +501,7 @@ fn xmain() -> ! {
); );
#[cfg(feature="tts")] #[cfg(feature="tts")]
tts.tts_blocking(t!("rootkeys.bootpass", xous::LANG)).unwrap(); tts.tts_blocking(t!("rootkeys.bootpass", xous::LANG)).unwrap();
log::info!("{}ROOTKEY.BOOTPW,{}", xous::BOOKEND_START, xous::BOOKEND_END);
rootkeys_modal.activate(); rootkeys_modal.activate();
} }
}), }),
@ -524,6 +526,7 @@ fn xmain() -> ! {
); );
#[cfg(feature="tts")] #[cfg(feature="tts")]
tts.tts_blocking(t!("rootkeys.updatepass", xous::LANG)).unwrap(); tts.tts_blocking(t!("rootkeys.updatepass", xous::LANG)).unwrap();
log::info!("{}ROOTKEY.UPDPW,{}", xous::BOOKEND_START, xous::BOOKEND_END);
rootkeys_modal.activate(); rootkeys_modal.activate();
}, },
Some(Opcode::UxInitUpdatePasswordReturn) => { Some(Opcode::UxInitUpdatePasswordReturn) => {
@ -658,6 +661,7 @@ fn xmain() -> ! {
}; };
let mut skip_confirmation = false; let mut skip_confirmation = false;
log::info!("{}ROOTKEY.GWUP,{}", xous::BOOKEND_START, xous::BOOKEND_END);
match modals.get_radiobutton(prompt) { match modals.get_radiobutton(prompt) {
Ok(response) => { Ok(response) => {
if response == t!("rootkeys.gwup.short", xous::LANG) { if response == t!("rootkeys.gwup.short", xous::LANG) {
@ -720,6 +724,7 @@ fn xmain() -> ! {
); );
#[cfg(feature="tts")] #[cfg(feature="tts")]
tts.tts_blocking(t!("rootkeys.get_update_password", xous::LANG)).unwrap(); tts.tts_blocking(t!("rootkeys.get_update_password", xous::LANG)).unwrap();
log::info!("{}ROOTKEY.UPDPW,{}", xous::BOOKEND_START, xous::BOOKEND_END);
rootkeys_modal.activate(); rootkeys_modal.activate();
} }
} }
@ -797,6 +802,7 @@ fn xmain() -> ! {
); );
#[cfg(feature="tts")] #[cfg(feature="tts")]
tts.tts_blocking(t!("rootkeys.get_signing_password", xous::LANG)).unwrap(); tts.tts_blocking(t!("rootkeys.get_signing_password", xous::LANG)).unwrap();
log::info!("{}ROOTKEY.UPDPW,{}", xous::BOOKEND_START, xous::BOOKEND_END);
rootkeys_modal.activate(); rootkeys_modal.activate();
} }
}, },
@ -877,6 +883,7 @@ fn xmain() -> ! {
); );
#[cfg(feature="tts")] #[cfg(feature="tts")]
tts.tts_blocking(t!("rootkeys.get_login_password", xous::LANG)).unwrap(); tts.tts_blocking(t!("rootkeys.get_login_password", xous::LANG)).unwrap();
log::info!("{}ROOTKEY.BOOTPW,{}", xous::BOOKEND_START, xous::BOOKEND_END);
rootkeys_modal.activate(); rootkeys_modal.activate();
// note that the scalar is *not* yet returned, it will be returned by the opcode called by the password assurance // note that the scalar is *not* yet returned, it will be returned by the opcode called by the password assurance
} else { } else {

View file

@ -104,6 +104,10 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
Ok(len) => { Ok(len) => {
log::trace!("raw response ({}): {:?}", len, &buf[..len]); log::trace!("raw response ({}): {:?}", len, &buf[..len]);
write!(ret, "{}", std::string::String::from_utf8_lossy(&buf[..len.min(buf.len())])).ok(); // let it run off the end write!(ret, "{}", std::string::String::from_utf8_lossy(&buf[..len.min(buf.len())])).ok(); // let it run off the end
log::info!("{}NET.TCPGET,{},{}",
xous::BOOKEND_START,
std::string::String::from_utf8_lossy(&buf[..len.min(buf.len())]),
xous::BOOKEND_END);
} }
Err(e) => write!(ret, "Didn't get response from host: {:?}", e).unwrap(), Err(e) => write!(ret, "Didn't get response from host: {:?}", e).unwrap(),
} }
@ -147,6 +151,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
} }
}); });
write!(ret, "TCP listener started on port 80").unwrap(); write!(ret, "TCP listener started on port 80").unwrap();
log::info!("{}NET.SERVER,{}", xous::BOOKEND_START, xous::BOOKEND_END);
} }
"fountain" => { "fountain" => {
// anything typed after fountain will cause this to be a short test // anything typed after fountain will cause this to be a short test
@ -372,6 +377,13 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
addr, addr,
seq_or_addr, seq_or_addr,
timestamp).unwrap(); timestamp).unwrap();
log::info!("{}NET.PONG,{:?},{},{},{}",
xous::BOOKEND_START,
addr,
seq_or_addr,
timestamp,
xous::BOOKEND_END
);
}, },
IpAddr::V6(_) => { IpAddr::V6(_) => {
write!(ret, "Ipv6 pong received: {} ms", timestamp).unwrap(); write!(ret, "Ipv6 pong received: {} ms", timestamp).unwrap();

View file

@ -45,11 +45,18 @@ impl<'a> ShellCmdApi<'a> for RtcCmd {
timestr timestr
) )
.unwrap(); .unwrap();
log::info!("{}RTC.LOCAL,{},{}",
xous::BOOKEND_START,
dt.format("%H,%M,%m,%d,%Y").to_string(),
xous::BOOKEND_END);
} else { } else {
write!( write!(
ret, ret,
"Local time has not been set up" "Local time has not been set up"
).unwrap(); ).unwrap();
log::info!("{}RTC.FAIL,{}",
xous::BOOKEND_START,
xous::BOOKEND_END);
} }
} }
_ => { _ => {

View file

@ -23,7 +23,7 @@ impl<'a> ShellCmdApi<'a> for Ver {
let dirtystr = if dirty { "dirty" } else { "clean" }; let dirtystr = if dirty { "dirty" } else { "clean" };
write!(ret, "EC gateware commit: {:x}, {}\n", rev, dirtystr).unwrap(); write!(ret, "EC gateware commit: {:x}, {}\n", rev, dirtystr).unwrap();
let (maj, min, rev, commit) = env.com.get_ec_sw_tag().unwrap(); let (maj, min, rev, commit) = env.com.get_ec_sw_tag().unwrap();
log::info!("{}ECREV,{},{},{},{},{}", xous::BOOKEND_START, maj, min, rev, commit, xous::BOOKEND_END); log::info!("{}VER.EC,{},{},{},{},{}", xous::BOOKEND_START, maj, min, rev, commit, xous::BOOKEND_END);
write!(ret, "EC sw tag: {}.{}.{}+{}", maj, min, rev, commit).unwrap(); write!(ret, "EC sw tag: {}.{}.{}+{}", maj, min, rev, commit).unwrap();
} }
"wf200" => { "wf200" => {
@ -33,14 +33,14 @@ impl<'a> ShellCmdApi<'a> for Ver {
"soc" => { "soc" => {
let (maj, min, rev, extra, gitrev) = env.llio.soc_gitrev().unwrap(); let (maj, min, rev, extra, gitrev) = env.llio.soc_gitrev().unwrap();
write!(ret, "SoC git rev {}.{}.{}+{}, commit {:x}", maj, min, rev, extra, gitrev).unwrap(); write!(ret, "SoC git rev {}.{}.{}+{}, commit {:x}", maj, min, rev, extra, gitrev).unwrap();
log::info!("{}SOCREV,{},{},{},{},{}", xous::BOOKEND_START, maj, min, rev, gitrev, xous::BOOKEND_END); log::info!("{}VER.SOC,{},{},{},{},{}", xous::BOOKEND_START, maj, min, rev, gitrev, xous::BOOKEND_END);
} }
"dna" => { "dna" => {
write!(ret, "SoC silicon DNA: 0x{:x}", env.llio.soc_dna().unwrap()).unwrap(); write!(ret, "SoC silicon DNA: 0x{:x}", env.llio.soc_dna().unwrap()).unwrap();
} }
"xous" => { "xous" => {
write!(ret, "Xous version: {}", env.ticktimer.get_version()).unwrap(); write!(ret, "Xous version: {}", env.ticktimer.get_version()).unwrap();
log::info!("{}XOUSREV,{},{}", xous::BOOKEND_START, env.ticktimer.get_version(), xous::BOOKEND_END); log::info!("{}VER.XOUS,{},{}", xous::BOOKEND_START, env.ticktimer.get_version(), xous::BOOKEND_END);
} }
_ => { _ => {
write!(ret, "{}", helpstring).unwrap(); write!(ret, "{}", helpstring).unwrap();

View file

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

View file

@ -516,6 +516,7 @@ pub fn start_time_ux(sid: xous::SID) {
// note that we don't do an "else" here because we also want to catch the case of // note that we don't do an "else" here because we also want to catch the case of
// a key exists, but nothing was written to it (length of key was 0 or inappropriate) // a key exists, but nothing was written to it (length of key was 0 or inappropriate)
if !tz_set { if !tz_set {
log::info!("{}RTC.TZ,{}", xous::BOOKEND_START, xous::BOOKEND_END);
let tz = modals.alert_builder(t!("rtc.timezone", xous::LANG)) let tz = modals.alert_builder(t!("rtc.timezone", xous::LANG))
.field(None, Some(tz_ux_validator)) .field(None, Some(tz_ux_validator))
.build() .build()
@ -536,6 +537,7 @@ pub fn start_time_ux(sid: xous::SID) {
} }
// see if we want to try to use NTP or not // see if we want to try to use NTP or not
log::info!("{}RTC.NTP,{}", xous::BOOKEND_START, xous::BOOKEND_END);
modals.add_list_item(t!("pddb.yes", xous::LANG)).expect("couldn't build radio item list"); modals.add_list_item(t!("pddb.yes", xous::LANG)).expect("couldn't build radio item list");
modals.add_list_item(t!("pddb.no", xous::LANG)).expect("couldn't build radio item list"); modals.add_list_item(t!("pddb.no", xous::LANG)).expect("couldn't build radio item list");
let mut try_ntp = true; let mut try_ntp = true;
@ -571,10 +573,12 @@ pub fn start_time_ux(sid: xous::SID) {
0, 0, 0, 0,
) )
).expect("couldn't set time"); ).expect("couldn't set time");
log::info!("{}RTC.NTPOK,{}", xous::BOOKEND_START, xous::BOOKEND_END);
continue; continue;
} }
Err(err) => { Err(err) => {
log::info!("Err: {:?}", err); log::info!("Err: {:?}", err);
log::info!("{}RTC.NTPFAIL,{}", xous::BOOKEND_START, xous::BOOKEND_END);
modals.show_notification(t!("rtc.ntp_fail", xous::LANG), None).expect("couldn't show NTP error"); modals.show_notification(t!("rtc.ntp_fail", xous::LANG), None).expect("couldn't show NTP error");
}, },
} }