fix #150 typo lenght -> length

This commit is contained in:
Philippe Guay
2017-03-06 15:07:20 -05:00
parent 210f2e8fa1
commit 26140be6c9
7 changed files with 22 additions and 22 deletions

View File

@ -20,7 +20,7 @@ WebSocketsClient webSocket;
#define USE_SERIAL Serial1
void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
@ -42,11 +42,11 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
// webSocket.sendTXT("message here");
break;
case WStype_BIN:
USE_SERIAL.printf("[WSc] get binary lenght: %u\n", lenght);
hexdump(payload, lenght);
USE_SERIAL.printf("[WSc] get binary length: %u\n", length);
hexdump(payload, length);
// send data to server
// webSocket.sendBIN(payload, lenght);
// webSocket.sendBIN(payload, length);
break;
}

View File

@ -27,7 +27,7 @@ uint64_t messageTimestamp = 0;
uint64_t heartbeatTimestamp = 0;
bool isConnected = false;
void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
@ -52,11 +52,11 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
// webSocket.sendTXT("message here");
break;
case WStype_BIN:
USE_SERIAL.printf("[WSc] get binary lenght: %u\n", lenght);
hexdump(payload, lenght);
USE_SERIAL.printf("[WSc] get binary length: %u\n", length);
hexdump(payload, length);
// send data to server
// webSocket.sendBIN(payload, lenght);
// webSocket.sendBIN(payload, length);
break;
}

View File

@ -18,7 +18,7 @@ WebSocketsServer webSocket = WebSocketsServer(81);
#define USE_SERIAL Serial1
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
case WStype_DISCONNECTED:
@ -43,11 +43,11 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
// webSocket.broadcastTXT("message here");
break;
case WStype_BIN:
USE_SERIAL.printf("[%u] get binary lenght: %u\n", num, lenght);
hexdump(payload, lenght);
USE_SERIAL.printf("[%u] get binary length: %u\n", num, length);
hexdump(payload, length);
// send message to client
// webSocket.sendBIN(num, payload, lenght);
// webSocket.sendBIN(num, payload, length);
break;
}

View File

@ -20,7 +20,7 @@ WebSocketsServer webSocket = WebSocketsServer(81);
String fragmentBuffer = "";
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
case WStype_DISCONNECTED:
@ -38,8 +38,8 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
USE_SERIAL.printf("[%u] get Text: %s\n", num, payload);
break;
case WStype_BIN:
USE_SERIAL.printf("[%u] get binary lenght: %u\n", num, lenght);
hexdump(payload, lenght);
USE_SERIAL.printf("[%u] get binary length: %u\n", num, length);
hexdump(payload, length);
break;
// Fragmentation / continuation opcode handling

View File

@ -26,7 +26,7 @@ ESP8266WiFiMulti WiFiMulti;
ESP8266WebServer server = ESP8266WebServer(80);
WebSocketsServer webSocket = WebSocketsServer(81);
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
case WStype_DISCONNECTED:

View File

@ -270,9 +270,9 @@ void WebSocketsClient::setAuthorization(const char * auth) {
* @param client WSclient_t * ptr to the client struct
* @param opcode WSopcode_t
* @param payload uint8_t *
* @param lenght size_t
* @param length size_t
*/
void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t lenght, bool fin) {
void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool fin) {
WStype_t type = WStype_ERROR;
switch(opcode) {
@ -287,7 +287,7 @@ void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, u
break;
}
runCbEvent(type, payload, lenght);
runCbEvent(type, payload, length);
}

View File

@ -468,9 +468,9 @@ bool WebSocketsServer::newClient(WEBSOCKETS_NETWORK_CLASS * TCPclient) {
* @param client WSclient_t * ptr to the client struct
* @param opcode WSopcode_t
* @param payload uint8_t *
* @param lenght size_t
* @param length size_t
*/
void WebSocketsServer::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t lenght, bool fin) {
void WebSocketsServer::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool fin) {
WStype_t type = WStype_ERROR;
switch(opcode) {
@ -485,7 +485,7 @@ void WebSocketsServer::messageReceived(WSclient_t * client, WSopcode_t opcode, u
break;
}
runCbEvent(client->num, type, payload, lenght);
runCbEvent(client->num, type, payload, length);
}