Increase complexity of read tree
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
1300e040d7
commit
e92b0522b8
1 changed files with 18 additions and 0 deletions
|
@ -133,14 +133,32 @@ impl Device{
|
||||||
Response::ShellPrompt => {
|
Response::ShellPrompt => {
|
||||||
initial_state = State::ShellPrompt;
|
initial_state = State::ShellPrompt;
|
||||||
},
|
},
|
||||||
|
Response::DebugMenu => {
|
||||||
|
usb_port.write_to_device(Command::Newline);
|
||||||
|
match usb_port.read_from_device(None) {
|
||||||
|
Response::DebugMenu | Response::ShellPrompt => {
|
||||||
|
initial_state = State::ShellPrompt;
|
||||||
|
},
|
||||||
|
_ => {
|
||||||
|
log::error!("Unknown state for TTY {:?}!!! Consult logs immediately.",usb_port);
|
||||||
|
log::debug!("Last known state: DebugMenu.");
|
||||||
|
log::debug!("Assumed but incorrect current state: successfully exited debug menu");
|
||||||
|
return Err("Failed TTY init. Unknown state, cannot trust.".to_string());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
_ => {
|
_ => {
|
||||||
log::error!("Unknown state for TTY {:?}!!! Consult logs immediately.",usb_port);
|
log::error!("Unknown state for TTY {:?}!!! Consult logs immediately.",usb_port);
|
||||||
|
log::debug!("Last known state: DebugMenu.");
|
||||||
|
log::debug!("Assumed but incorrect current state: attempted to exit debug menu");
|
||||||
return Err("Failed TTY init. Unknown state, cannot trust.".to_string());
|
return Err("Failed TTY init. Unknown state, cannot trust.".to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
//Serial response shouldn't exist, emptynewline is already filtered in main
|
||||||
Response::Serial(_) | Response::EmptyNewline => {
|
Response::Serial(_) | Response::EmptyNewline => {
|
||||||
log::error!("Unknown state for TTY {:?}!!! Consult logs immediately.",usb_port);
|
log::error!("Unknown state for TTY {:?}!!! Consult logs immediately.",usb_port);
|
||||||
|
log::debug!("How did I get here???");
|
||||||
return Err("Failed TTY init. Unknown state, cannot trust.".to_string());
|
return Err("Failed TTY init. Unknown state, cannot trust.".to_string());
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue