From 8a49f72f1953ee953ae48acd186e9aaab5e51e82 Mon Sep 17 00:00:00 2001 From: SRGDamia1 Date: Wed, 7 Jun 2017 15:51:41 -0400 Subject: [PATCH] Trying to find error in XBee --- TinyGsmClientXBee.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/TinyGsmClientXBee.h b/TinyGsmClientXBee.h index dc5525d..74a56fd 100644 --- a/TinyGsmClientXBee.h +++ b/TinyGsmClientXBee.h @@ -255,10 +255,10 @@ public: // wait for the response unsigned long startMillis = millis(); while (!stream.available() && millis() - startMillis < 1000) {}; - char buf[3] = { 0, }; // Does not send an OK, just the result + char buf[2] = {0}; // Set up buffer for response buf[0] = streamRead(); buf[1] = streamRead(); - DBG("\n"); + DBG(buf, "\n"); exitCommand(); int intr = strtol(buf, 0, 16); return intr; @@ -538,12 +538,7 @@ private: streamWrite(tail...); } - int streamRead() { - TINY_GSM_YIELD(); - int c = stream.read(); - DBG((char)c); - return c; - } + int streamRead() { return stream.read(); } String streamReadUntil(char c) { TINY_GSM_YIELD();