From f3b87877ef970b5fb745ae4ad496a7ba74a83215 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 23 Jan 2025 12:18:45 +0000 Subject: [PATCH] 5.5.12 Websockets (wifi) --- Websockets.cpp | 2 +- WifiESP32.cpp | 8 ++++---- version.h | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Websockets.cpp b/Websockets.cpp index e582ee6..a169a97 100644 --- a/Websockets.cpp +++ b/Websockets.cpp @@ -140,7 +140,7 @@ bool Websockets::checkConnectionString(byte clientId,byte * cmd, RingStream * ou byte * Websockets::unmask(byte clientId,RingStream *ring, byte * buffer) { // buffer should have a websocket header //byte opcode=buffer[0] & 0x0f; - if (Diag::WEBSOCKET) DIAG(F("Websock in: %x %x %x %x %x %x %x %x"), + if (Diag::WEBSOCKET) DIAG(F("Websock in: %x %x %x %x %x %x %x"), buffer[0],buffer[1],buffer[2],buffer[3], buffer[4],buffer[5],buffer[6]); diff --git a/WifiESP32.cpp b/WifiESP32.cpp index 9483501..d8094ba 100644 --- a/WifiESP32.cpp +++ b/WifiESP32.cpp @@ -407,11 +407,11 @@ void WifiESP::loop() { // buffer filled, end with '\0' so we can use it as C string buffer[wsHeaderLen+count]='\0'; if((unsigned int)clientId <= clients.size() && clients[clientId].active(clientId)) { - if (Diag::CMD || Diag::WITHROTTLE) - DIAG(F("SEND %d:%s"), clientId, buffer); - clients[clientId].wifi.write(buffer,count); + if (Diag::WIFI) + DIAG(F("SEND%S %d:%s"), useWebsocket?F("ws"):F(""),clientId, buffer+wsHeaderLen); + clients[clientId].wifi.write(buffer,count+wsHeaderLen); } else { - DIAG(F("Unsent(%d): %s"), clientId, buffer); + DIAG(F("Unsent(%d): %s"), clientId, buffer+wsHeaderLen); } } } diff --git a/version.h b/version.h index 271a60a..ea1326d 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "5.5.11" +#define VERSION "5.5.12" +// 5.5.12 - Websocket support (wifi only) // 5.5.11 - (5.4.2) accessory command reverse // 5.5.10 - CamParser fix // 5.5.9 - (5.4.3) fix changeFn for functions 29..31