From e47bdad2ac21660fdc9f355eed70ccb2bb892e09 Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Thu, 13 Dec 2018 01:08:27 +0300 Subject: [PATCH 1/2] Increase buffer size to fit B0 code --- code/espurna/rfbridge.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/espurna/rfbridge.ino b/code/espurna/rfbridge.ino index c9bdb9b8..f0899b3f 100644 --- a/code/espurna/rfbridge.ino +++ b/code/espurna/rfbridge.ino @@ -102,7 +102,7 @@ static bool _rfbToChar(byte * in, char * out, int n = RF_MESSAGE_SIZE) { #if WEB_SUPPORT void _rfbWebSocketSendCode(unsigned char id, bool status, const char * code) { - char wsb[100]; + char wsb[192]; snprintf_P(wsb, sizeof(wsb), PSTR("{\"rfb\":[{\"id\": %d, \"status\": %d, \"data\": \"%s\"}]}"), id, status ? 1 : 0, code); wsSend(wsb); } From 677f426a7f9fb541eee3bc123bdd3f37b367318b Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Thu, 13 Dec 2018 01:21:29 +0300 Subject: [PATCH 2/2] Comment for clarity --- code/espurna/rfbridge.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/espurna/rfbridge.ino b/code/espurna/rfbridge.ino index f0899b3f..f85babbd 100644 --- a/code/espurna/rfbridge.ino +++ b/code/espurna/rfbridge.ino @@ -102,7 +102,7 @@ static bool _rfbToChar(byte * in, char * out, int n = RF_MESSAGE_SIZE) { #if WEB_SUPPORT void _rfbWebSocketSendCode(unsigned char id, bool status, const char * code) { - char wsb[192]; + char wsb[192]; // (32 * 5): 46 bytes for json , 116 bytes raw code, reserve snprintf_P(wsb, sizeof(wsb), PSTR("{\"rfb\":[{\"id\": %d, \"status\": %d, \"data\": \"%s\"}]}"), id, status ? 1 : 0, code); wsSend(wsb); }