A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
minor fix for webui
Geo1d4e196051f8
diff --git a/src/Servers/WebSocketServer.cpp b/src/Servers/WebSocketServer.cppindex 6db5bd52..5cc5d638 100644--- a/src/Servers/WebSocketServer.cpp+++ b/src/Servers/WebSocketServer.cpp@@ -75,12 +75,6 @@ char WebSocketServer::readCharBlocking() {}char WebSocketServer::readCharNonBlocking() {- const unsigned long timeout = millis() + 20; // some time for websocket-- while (buffer.empty() && millis() < timeout) {- delay(1); // laisse tourner la loop- }-if (buffer.empty()) return KEY_NONE;char c = buffer.front();diff --git a/webui/scripts.h b/webui/scripts.hindex 97bf747b..52cd7701 100644--- a/webui/scripts.h+++ b/webui/scripts.h@@ -13,7 +13,9 @@ function connectSocket() {socket = new WebSocket("ws://" + window.location.host + "/ws");socket.onopen = function () {- hideWsLostPopup(); // Supprime le popup+ hideWsLostPopup(); // Supprime le popup+ bridgeMode = false;+ pendingEchoLines = 0;console.log("[WebSocket] Connected");};@@ -54,6 +56,7 @@ function connectSocket() {}function showWsLostPopup() {+ if (bridgeMode) return;const popup = document.getElementById("ws-lost-popup");if (popup) {popup.style.display = "block";@@ -72,16 +75,6 @@ function sendCommand() {const output = document.getElementById("output");const cmd = input.value.trim();- // Timeout for response- clearTimeout(responseTimeout);- if (!bridgeMode) {- clearTimeout(responseTimeout);- responseTimeout = setTimeout(() => {- console.warn("[WebSocket] No response after command.");- showWsLostPopup();- }, responseTimeoutDelay);- }-// No socketif (socket.readyState !== WebSocket.OPEN) return;@@ -99,6 +92,13 @@ function sendCommand() {return; // enter bridge mode}+ // Set timeout in non-bridge mode+ clearTimeout(responseTimeout);+ responseTimeout = setTimeout(() => {+ console.warn("[WebSocket] No response after command.");+ showWsLostPopup();+ }, responseTimeoutDelay);+// Normal Sendsocket.send(cmd + "\n");input.value = "";