Skip to content

Commit db8167f

Browse files
authored
Merge pull request #355 from Links2004/ESP32_serial
ESP32 fixes
2 parents f7a7ab6 + 388683d commit db8167f

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

examples/esp32/WebSocketClient/WebSocketClient.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
WiFiMulti WiFiMulti;
1818
WebSocketsClient webSocket;
1919

20-
HardwareSerial Serial1(2);
21-
2220
#define USE_SERIAL Serial1
2321

2422
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {
@@ -59,6 +57,12 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
5957
// send data to server
6058
// webSocket.sendBIN(payload, length);
6159
break;
60+
case WStype_ERROR:
61+
case WStype_FRAGMENT_TEXT_START:
62+
case WStype_FRAGMENT_BIN_START:
63+
case WStype_FRAGMENT:
64+
case WStype_FRAGMENT_FIN:
65+
break;
6266
}
6367

6468
}

examples/esp32/WebSocketClientSSL/WebSocketClientSSL.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
WiFiMulti WiFiMulti;
2020
WebSocketsClient webSocket;
2121

22-
HardwareSerial Serial1(2);
23-
2422
#define USE_SERIAL Serial1
2523

2624
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {
@@ -64,6 +62,12 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
6462
// send data to server
6563
// webSocket.sendBIN(payload, length);
6664
break;
65+
case WStype_ERROR:
66+
case WStype_FRAGMENT_TEXT_START:
67+
case WStype_FRAGMENT_BIN_START:
68+
case WStype_FRAGMENT:
69+
case WStype_FRAGMENT_FIN:
70+
break;
6771
}
6872

6973
}

examples/esp32/WebSocketServer/WebSocketServer.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
WiFiMulti WiFiMulti;
1717
WebSocketsServer webSocket = WebSocketsServer(81);
1818

19-
HardwareSerial Serial1(2);
20-
2119
#define USE_SERIAL Serial1
2220

2321
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {
@@ -64,6 +62,12 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length
6462
// send message to client
6563
// webSocket.sendBIN(num, payload, length);
6664
break;
65+
case WStype_ERROR:
66+
case WStype_FRAGMENT_TEXT_START:
67+
case WStype_FRAGMENT_BIN_START:
68+
case WStype_FRAGMENT:
69+
case WStype_FRAGMENT_FIN:
70+
break;
6771
}
6872

6973
}

0 commit comments

Comments
 (0)