mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 14:12:16 +03:00
небольшие исправления
This commit is contained in:
7
.vscode/extensions.json
vendored
Normal file
7
.vscode/extensions.json
vendored
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user