improve ram usage on one char send

This commit is contained in:
Links
2018-05-12 15:27:08 +02:00
parent d2043bf8ef
commit 8967356af3
2 changed files with 4 additions and 2 deletions

View File

@ -42,7 +42,7 @@ void SocketIOclient::runCbEvent(WStype_t type, uint8_t * payload, size_t length)
case WStype_CONNECTED: {
DEBUG_WEBSOCKETS("[wsIOc] Connected to url: %s\n", payload);
// send message to server when Connected
// socket.io upgrade confirmation message (required)
// Engine.io upgrade confirmation message (required)
sendTXT(eIOtype_UPGRADE);
}
break;

View File

@ -216,7 +216,9 @@ bool WebSocketsClient::sendTXT(String & payload) {
}
bool WebSocketsClient::sendTXT(char payload) {
return sendTXT((uint8_t *) &payload, 1);
uint8_t buf[WEBSOCKETS_MAX_HEADER_SIZE + 2] = {0x00};
buf[WEBSOCKETS_MAX_HEADER_SIZE] = payload;
return sendTXT(buf, 1, true);
}
/**