From 8fb05a3010541d03f8b5031ca03e3182435ff3f5 Mon Sep 17 00:00:00 2001 From: Blizzard Finnegan Date: Mon, 19 Jun 2023 10:14:59 -0400 Subject: [PATCH] Mute unexpected response for DebugInit and empty --- src/device.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/device.rs b/src/device.rs index 21c06f1..5f07a5d 100755 --- a/src/device.rs +++ b/src/device.rs @@ -186,7 +186,8 @@ impl Device{ self.usb_tty.write_to_device(Command::Login); loop { match self.usb_tty.read_from_device(None){ - Response::PreShellPrompt | Response::Empty | Response::ShuttingDown | Response::Rebooting => {}, + Response::PreShellPrompt | Response::Empty | Response::ShuttingDown | + Response::DebugInit | Response::EmptyNewline | Response::Rebooting => {}, Response::PasswordPrompt => {self.usb_tty.write_to_device(Command::Newline);}, Response::ShellPrompt => break, _ => { @@ -201,7 +202,8 @@ impl Device{ self.usb_tty.write_to_device(Command::DebugMenu); loop { match self.usb_tty.read_from_device(None) { - Response::PreShellPrompt | Response::Empty | Response::ShuttingDown | Response::Rebooting => {}, + Response::PreShellPrompt | Response::Empty | Response::ShuttingDown | + Response::DebugInit | Response::EmptyNewline | Response::Rebooting => {}, Response::LoginPrompt => { self.usb_tty.write_to_device(Command::Login); while self.usb_tty.read_from_device(None) != Response::ShellPrompt {}; @@ -255,7 +257,8 @@ impl Device{ self.usb_tty.write_to_device(Command::Login); loop { match self.usb_tty.read_from_device(None){ - Response::PreShellPrompt | Response::Empty | Response::ShuttingDown | Response::Rebooting => {}, + Response::PreShellPrompt | Response::Empty | Response::ShuttingDown | + Response::DebugInit | Response::EmptyNewline | Response::Rebooting => {}, Response::PasswordPrompt => {self.usb_tty.write_to_device(Command::Newline);}, Response::ShellPrompt => break, _ => { @@ -270,7 +273,8 @@ impl Device{ loop { let read_in = self.usb_tty.read_from_device(None); match read_in { - Response::PreShellPrompt | Response::Empty | Response::ShuttingDown | Response::Rebooting => {}, + Response::PreShellPrompt | Response::Empty | Response::ShuttingDown | + Response::DebugInit | Response::EmptyNewline | Response::Rebooting => {}, Response::LoginPrompt => { self.usb_tty.write_to_device(Command::Login); while self.usb_tty.read_from_device(None) != Response::ShellPrompt {};