mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
add some commands for testing the serial console & port setup
This commit is contained in:
parent
e4d230f42e
commit
7f5a288090
1 changed files with 16 additions and 0 deletions
|
|
@ -35,6 +35,22 @@ impl<'a> ShellCmdApi<'a> for Usb {
|
||||||
Err(_e) => write!(ret, "Can't send: are we connected to a host?").unwrap(),
|
Err(_e) => write!(ret, "Can't send: are we connected to a host?").unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"console" => {
|
||||||
|
// this will enable input injection mode
|
||||||
|
self.usb_dev.serial_console_input_injection();
|
||||||
|
write!(ret, "USB console connected.").ok();
|
||||||
|
}
|
||||||
|
"noconsole" => {
|
||||||
|
// this will disable any hooks (including the console input hook)
|
||||||
|
self.usb_dev.serial_clear_input_hooks();
|
||||||
|
write!(ret, "USB console disconnected.").ok();
|
||||||
|
}
|
||||||
|
"sersend" => {
|
||||||
|
let mut val = String::new();
|
||||||
|
join_tokens(&mut val, &mut tokens);
|
||||||
|
let sent = self.usb_dev.serial_send(val.as_bytes()).unwrap_or(0);
|
||||||
|
write!(ret, "Sent {} bytes", sent).ok();
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
write!(ret, "{}", helpstring).unwrap();
|
write!(ret, "{}", helpstring).unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue