Minor UNTESTED improvements
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Blizzard Finnegan 2023-08-23 09:02:15 -04:00
parent ef4aee6183
commit 86e67f42cb
Signed by: blizzardfinnegan
GPG key ID: 61C1E13067E0018E
3 changed files with 3 additions and 7 deletions

View file

@ -213,7 +213,6 @@ impl Device{
log::error!("Unexpected response from device {}!",self.serial);
log::debug!("brightness menu, catch-all, login loop, {}, {:?}",self.serial,self.usb_tty);
log::error!("Unsure how to continue. Expect data from device {} to be erratic until next cycle.",self.serial);
//break;
},
};
};
@ -239,11 +238,9 @@ impl Device{
log::error!("Unexpected response from device {}!", self.serial);
log::debug!("brightness menu, catch-all, shell prompt loop, {}, {:?}",self.serial,self.usb_tty);
log::error!("Unsure how to continue. Expect data from device {} to be erratic until next cycle.",self.serial);
//break;
},
};
};
//_ = self.usb_tty.read_from_device(None);
self.current_state = State::DebugMenu;
},
State::Shutdown => {
@ -397,6 +394,7 @@ impl Device{
},
}
}
if self.serial == "" { self.serial = UNINITIALISED_SERIAL.to_string(); }
self.usb_tty.write_to_device(Command::DebugMenu);
while self.usb_tty.read_from_device(None) != Response::DebugMenu {}
self.current_state = State::DebugMenu;
@ -556,7 +554,6 @@ impl Device{
self.usb_tty.write_to_device(Command::Quit);
self.usb_tty.write_to_device(Command::Reboot);
let mut successful_reboot:bool = false;
//let mut exited_menu:bool = false;
loop{
match self.usb_tty.read_from_device(None){
Response::LoginPrompt => break,

View file

@ -47,7 +47,7 @@ fn main(){
}
}
log::info!("Testing all available USB ports for connected devices. This may take several minutes, and devices may reboot several times.");
log::info!("Testing all available USB ports for connected devices. This may take some time...");
let gpio = &mut GpioPins::new();
let mut available_ttys:Vec<Box<Path>> = Vec::new();
for entry in glob::glob("/dev/serial/*").expect("Failed to read glob pattern"){
@ -98,7 +98,6 @@ fn main(){
thread::spawn(move ||{
let tty_name = possible_tty.to_string_lossy();
log::debug!("Testing port {}",&tty_name);
//let possible_port = TTY::new(&tty_name);
match TTY::new(&tty_name){
Some(mut port) =>{
port.write_to_device(tty::Command::Newline);

View file

@ -200,7 +200,7 @@ impl TTY{
}
}
}
log::trace!("Unable to determine response. Response string is: [{:?}]",device_response);
log::warn!("Unable to determine response. Response string is: [{:?}]",device_response);
return Response::Other;
}
else {