1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-01-28 21:23:06 +01:00

5.5.12 Websockets (wifi)

This commit is contained in:
Asbelos 2025-01-23 12:18:45 +00:00
parent 07691e3985
commit f3b87877ef
3 changed files with 7 additions and 6 deletions

View File

@ -140,7 +140,7 @@ bool Websockets::checkConnectionString(byte clientId,byte * cmd, RingStream * ou
byte * Websockets::unmask(byte clientId,RingStream *ring, byte * buffer) { byte * Websockets::unmask(byte clientId,RingStream *ring, byte * buffer) {
// buffer should have a websocket header // buffer should have a websocket header
//byte opcode=buffer[0] & 0x0f; //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[0],buffer[1],buffer[2],buffer[3],
buffer[4],buffer[5],buffer[6]); buffer[4],buffer[5],buffer[6]);

View File

@ -407,11 +407,11 @@ void WifiESP::loop() {
// buffer filled, end with '\0' so we can use it as C string // buffer filled, end with '\0' so we can use it as C string
buffer[wsHeaderLen+count]='\0'; buffer[wsHeaderLen+count]='\0';
if((unsigned int)clientId <= clients.size() && clients[clientId].active(clientId)) { if((unsigned int)clientId <= clients.size() && clients[clientId].active(clientId)) {
if (Diag::CMD || Diag::WITHROTTLE) if (Diag::WIFI)
DIAG(F("SEND %d:%s"), clientId, buffer); DIAG(F("SEND%S %d:%s"), useWebsocket?F("ws"):F(""),clientId, buffer+wsHeaderLen);
clients[clientId].wifi.write(buffer,count); clients[clientId].wifi.write(buffer,count+wsHeaderLen);
} else { } else {
DIAG(F("Unsent(%d): %s"), clientId, buffer); DIAG(F("Unsent(%d): %s"), clientId, buffer+wsHeaderLen);
} }
} }
} }

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h" #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.11 - (5.4.2) accessory command reverse
// 5.5.10 - CamParser fix // 5.5.10 - CamParser fix
// 5.5.9 - (5.4.3) fix changeFn for functions 29..31 // 5.5.9 - (5.4.3) fix changeFn for functions 29..31