Skip to content

Commit bd158c9

Browse files
committed
Fix warnings in platformIO
Fix : warning: enumeration value 'WStype_ERROR' not handled in switch [-Wswitch] Fix : warning: variable 'ip' set but not used [-Wunused-but-set-variable]
1 parent 9a803e1 commit bd158c9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/SocketIOclient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void SocketIOclient::handleCbEvent(WStype_t type, uint8_t * payload, size_t leng
161161
break;
162162
}
163163
} break;
164-
164+
case WStype_ERROR:
165165
case WStype_BIN:
166166
case WStype_FRAGMENT_TEXT_START:
167167
case WStype_FRAGMENT_BIN_START:

src/WebSocketsServer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,9 @@ bool WebSocketsServer::newClient(WEBSOCKETS_NETWORK_CLASS * TCPclient) {
462462
#endif
463463
client->status = WSC_HEADER;
464464
#if(WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32)
465+
#ifndef NODEBUG_WEBSOCKETS
465466
IPAddress ip = client->tcp->remoteIP();
467+
#endif
466468
DEBUG_WEBSOCKETS("[WS-Server][%d] new client from %d.%d.%d.%d\n", client->num, ip[0], ip[1], ip[2], ip[3]);
467469
#else
468470
DEBUG_WEBSOCKETS("[WS-Server][%d] new client\n", client->num);
@@ -635,7 +637,9 @@ void WebSocketsServer::handleNewClients(void) {
635637
if(!ok) {
636638
// no free space to handle client
637639
#if(WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32)
640+
#ifndef NODEBUG_WEBSOCKETS
638641
IPAddress ip = tcpClient->remoteIP();
642+
#endif
639643
DEBUG_WEBSOCKETS("[WS-Server] no free space new client from %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]);
640644
#else
641645
DEBUG_WEBSOCKETS("[WS-Server] no free space new client\n");

0 commit comments

Comments
 (0)