небольшие исправления

This commit is contained in:
Dmitry Borisenko
2021-12-24 00:06:37 +01:00
parent a19a12c7d4
commit d73657d39a
2 changed files with 13 additions and 6 deletions

7
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}

View File

@@ -190,9 +190,9 @@ void standWebSocketsInit() {
void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length) { void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length) {
switch (type) { switch (type) {
case WStype_DISCONNECTED: case WStype_DISCONNECTED: {
Serial.printf("[%u] Disconnected!\n", num); Serial.printf("[%u] Disconnected!\n", num);
break; } break;
case WStype_CONNECTED: { case WStype_CONNECTED: {
IPAddress ip = standWebSocket.remoteIP(num); IPAddress ip = standWebSocket.remoteIP(num);
@@ -202,7 +202,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
standWebSocket.sendTXT(num, "Connected"); standWebSocket.sendTXT(num, "Connected");
} break; } break;
case WStype_TEXT: case WStype_TEXT: {
Serial.printf("[%u] get Text: %s\n", num, payload); Serial.printf("[%u] get Text: %s\n", num, payload);
// send message to client // send message to client
@@ -210,15 +210,15 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
// send data to all connected clients // send data to all connected clients
// standWebSocket.broadcastTXT("message here"); // standWebSocket.broadcastTXT("message here");
break; } break;
case WStype_BIN: case WStype_BIN: {
Serial.printf("[%u] get binary length: %u\n", num, length); Serial.printf("[%u] get binary length: %u\n", num, length);
hexdump(payload, length); hexdump(payload, length);
// send message to client // send message to client
// standWebSocket.sendBIN(num, payload, length); // standWebSocket.sendBIN(num, payload, length);
break; } break;
} }
} }