From 1515534542652609b990cca794079af1ec22a570 Mon Sep 17 00:00:00 2001 From: Chris Hellyar Date: Wed, 16 Aug 2017 21:57:28 +1200 Subject: [PATCH] readBuffer already strips commas --- SerialESP8266wifi.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SerialESP8266wifi.cpp b/SerialESP8266wifi.cpp index 31185fa..3972d23 100644 --- a/SerialESP8266wifi.cpp +++ b/SerialESP8266wifi.cpp @@ -549,7 +549,9 @@ WifiMessage SerialESP8266wifi::listenForIncomingMessage(int timeout){ flags.connectedToServer = true; readChar(); // removing comma readBuffer(&buf[0], sizeof(buf) - 1, ':'); // read char count - readChar(); // removing ':' delim + // kiwichrish, commented out following line. Comma is already read from buffer inline above. + // causes trucation of message. + // readChar(); // removing ':' delim byte length = atoi(buf); readBuffer(&msgIn[0], min(length, sizeof(msgIn) - 1)); msg.hasData = true; @@ -586,7 +588,9 @@ WifiMessage SerialESP8266wifi::getIncomingMessage(void) { flags.connectedToServer = true; readChar(); // removing comma readBuffer(&buf[0], sizeof(buf) - 1, ':'); // read char count - readChar(); // removing ':' delim + // kiwichrish, commented out following line. Comma is already read from buffer inline above. + // causes trucation of message. + // readChar(); // removing ':' delim byte length = atoi(buf); readBuffer(&msgIn[0], min(length, sizeof(msgIn) - 1)); msg.hasData = true;