10000 fix typo lenght -> length · Intrising/arduinoWebSockets@3b1dabb · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b1dabb

Browse files
Philippe GuayPhilippe Guay
authored andcommitted
fix typo lenght -> length
1 parent 210f2e8 commit 3b1dabb

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

examples/WebSocketClient/WebSocketClient.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ WebSocketsClient webSocket;
2020

2121
#define USE_SERIAL Serial1
2222

23-
void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
23+
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
2424

2525

2626
switch(type) {
@@ -42,11 +42,11 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
4242
// webSocket.sendTXT("message here");
4343
break;
4444
case WStype_BIN:
45-
USE_SERIAL.printf("[WSc] get binary lenght: %u\n", lenght);
46-
hexdump(payload, lenght);
45+
USE_SERIAL.printf("[WSc] get binary length: %u\n", length);
46+
hexdump(payload, length);
4747

4848
// send data to server
49-
// webSocket.sendBIN(payload, lenght);
49+
// webSocket.sendBIN(payload, length);
5050
break;
5151
}
5252

examples/WebSocketClientSocketIO/WebSocketClientSocketIO.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ uint64_t messageTimestamp = 0;
2727
uint64_t heartbeatTimestamp = 0;
2828
bool isConnected = false;
2929

30-
void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
30+
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
3131

3232

3333
switch(type) {
@@ -52,11 +52,11 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
5252
// webSocket.sendTXT("message here");
5353
break;
5454
case WStype_BIN:
55-
USE_SERIAL.printf("[WSc] get binary lenght: %u\n", lenght);
56-
hexdump(payload, lenght);
55+
USE_SERIAL.printf("[WSc] get binary length: %u\n", length);
56+
hexdump(payload, length);
5757

5858
// send data to server
59-
// webSocket.sendBIN(payload, lenght);
59+
// webSocket.sendBIN(payload, length);
6060
break;
6161
}
6262

examples/WebSocketServer/WebSocketServer.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WebSocketsServer webSocket = WebSocketsServer(81);
1818

1919
#define USE_SERIAL Serial1
2020

21-
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {
21+
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {
2222

2323
switch(type) {
2424
case WStype_DISCONNECTED:
@@ -43,11 +43,11 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
4343
// webSocket.broadcastTXT("message here");
4444
break;
4545
case WStype_BIN:
46-
USE_SERIAL.printf("[%u] get binary lenght: %u\n", num, lenght);
47-
hexdump(payload, lenght);
46+
USE_SERIAL.printf("[%u] get binary length: %u\n", num, length);
47+
hexdump(payload, length);
4848

4949
// send message to client
50-
// webSocket.sendBIN(num, payload, lenght);
50+
// webSocket.sendBIN(num, payload, length);
5151
break;
5252
}
5353

examples/WebSocketServer/WebSocketServerFragmentation.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ WebSocketsServer webSocket = WebSocketsServer(81);
2020

2121
String fragmentBuffer = "";
2222

23-
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {
23+
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {
2424

2525
switch(type) {
2626
case WStype_DISCONNECTED:
@@ -38,8 +38,8 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
3838
USE_SERIAL.printf("[%u] get Text: %s\n", num, payload);
3939
break;
4040
case WStype_BIN:
41-
USE_SERIAL.printf("[%u] get binary lenght: %u\n", num, lenght);
42-
hexdump(payload, lenght);
41+
USE_SERIAL.printf("[%u] get binary length: %u\n", num, length);
42+
hexdump(payload, length);
4343
break;
4444

4545
// Fragmentation / continuation opcode handling

examples/WebSocketServer_LEDcontrol/WebSocketServer_LEDcontrol.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ESP8266WiFiMulti WiFiMulti;
2626
ESP8266WebServer server = ESP8266WebServer(80);
2727
WebSocketsServer webSocket = WebSocketsServer(81);
2828

29-
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {
29+
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {
3030

3131
switch(type) {
3232
case WStype_DISCONNECTED:

src/WebSocketsClient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ void WebSocketsClient::setAuthorization(const char * auth) {
270270
* @param client WSclient_t * ptr to the client struct
271271
* @param opcode WSopcode_t
272272
* @param payload uint8_t *
273-
* @param lenght size_t
273+
* @param length size_t
274274
*/
275-
void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t lenght, bool fin) {
275+
void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool fin) {
276276
WStype_t type = WStype_ERROR;
277277

278278
switch(opcode) {
@@ -287,7 +287,7 @@ void WebSocketsClient::messageReceived(WSclient_t * client, WSopcode_t opcode, u
287287
break;
288288
}
289289

290-
runCbEvent(type, payload, lenght);
290+
runCbEvent(type, payload, length);
291291

292292
}
293293

src/WebSocketsServer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,9 @@ bool WebSocketsServer::newClient(WEBSOCKETS_NETWORK_CLASS * TCPclient) {
468468
* @param client WSclient_t * ptr to the client struct
469469
* @param opcode WSopcode_t
470470
* @param payload uint8_t *
471-
* @param lenght size_t
471+
* @param length size_t
472472
*/
473-
void WebSocketsServer::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t lenght, bool fin) {
473+
void WebSocketsServer::messageReceived(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length, bool fin) {
474474
WStype_t type = WStype_ERROR;
475475

476476
switch(opcode) {
@@ -485,7 +485,7 @@ void WebSocketsServer::messageReceived(WSclient_t * client, WSopcode_t opcode, u
485485
break;
486486
}
487487

488-
runCbEvent(client->num, type, payload, lenght);
488+
runCbEvent(client->num, type, payload, length);
489489

490490
}
491491

0 commit comments

Comments
 (0)
0