mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-16 16:52:05 +02:00
@ -299,4 +299,7 @@ class WebSockets {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef UNUSED
|
||||||
|
#define UNUSED(var) (void)(var)
|
||||||
|
#endif
|
||||||
#endif /* WEBSOCKETS_H_ */
|
#endif /* WEBSOCKETS_H_ */
|
||||||
|
@ -318,6 +318,8 @@ void WebSocketsClient::setReconnectInterval(unsigned long time) {
|
|||||||
void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool fin) {
|
void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool fin) {
|
||||||
WStype_t type = WStype_ERROR;
|
WStype_t type = WStype_ERROR;
|
||||||
|
|
||||||
|
UNUSED(client);
|
||||||
|
|
||||||
switch(opcode) {
|
switch(opcode) {
|
||||||
case WSop_text:
|
case WSop_text:
|
||||||
type = fin ? WStype_TEXT : WStype_FRAGMENT_TEXT_START;
|
type = fin ? WStype_TEXT : WStype_FRAGMENT_TEXT_START;
|
||||||
@ -328,6 +330,11 @@ void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, u
|
|||||||
case WSop_continuation:
|
case WSop_continuation:
|
||||||
type = fin ? WStype_FRAGMENT_FIN : WStype_FRAGMENT;
|
type = fin ? WStype_FRAGMENT_FIN : WStype_FRAGMENT;
|
||||||
break;
|
break;
|
||||||
|
case WSop_close:
|
||||||
|
case WSop_ping:
|
||||||
|
case WSop_pong:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
runCbEvent(type, payload, length);
|
runCbEvent(type, payload, length);
|
||||||
|
@ -518,6 +518,11 @@ void WebSocketsServer::messageReceived(WSclient_t * client, WSopcode_t opcode, u
|
|||||||
case WSop_continuation:
|
case WSop_continuation:
|
||||||
type = fin ? WStype_FRAGMENT_FIN : WStype_FRAGMENT;
|
type = fin ? WStype_FRAGMENT_FIN : WStype_FRAGMENT;
|
||||||
break;
|
break;
|
||||||
|
case WSop_close:
|
||||||
|
case WSop_ping:
|
||||||
|
case WSop_pong:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
runCbEvent(client->num, type, payload, length);
|
runCbEvent(client->num, type, payload, length);
|
||||||
|
Reference in New Issue
Block a user