A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
fix scan cancel for uart
Geo0d059b5d35dd
diff --git a/src/Controllers/UartController.cpp b/src/Controllers/UartController.cppindex 3ace911f..d94a97a8 100644--- a/src/Controllers/UartController.cpp+++ b/src/Controllers/UartController.cpp@@ -188,8 +188,10 @@ void UartController::handleScan() {terminalView.println("");uartService.clearUartBuffer();+ scanCancelled = false;for (int baud : baudrates) {+ if (scanCancelled) return;if (scanAtBaudrate(baud)) {state.setUartBaudRate(baud);uartService.switchBaudrate(baud);@@ -240,6 +242,7 @@ bool UartController::checkScanCancelled() {char key = terminalInput.readChar();if (key == '\r' || key == '\n') {terminalView.println("UART Scan: Cancelled by user.");+ scanCancelled = true;return true;}return false;diff --git a/src/Controllers/UartController.h b/src/Controllers/UartController.hindex 7e8d4767..0485cb2f 100644--- a/src/Controllers/UartController.h+++ b/src/Controllers/UartController.h@@ -71,7 +71,7 @@ public:// Update rolling buffervoid updateResponse(std::string& response, size_t& asciiCount, size_t maxSize);- // Check if data response is a valid UART data+ // Check if data response is a valid UARTbool isValidResponse(const std::string& response, size_t asciiCount);// Check entropy to determine if a response is a valid UART response@@ -85,6 +85,7 @@ public:UserInputManager& userInputManager;GlobalState& state = GlobalState::getInstance();bool configured = false;+ bool scanCancelled = false;// Predefined probe commands for scan()std::vector<std::string> probes = {