Trying to find error in XBee

This commit is contained in:
SRGDamia1
2017-06-07 15:51:41 -04:00
parent 56db5458e0
commit 8a49f72f19

View File

@@ -255,10 +255,10 @@ public:
// wait for the response // wait for the response
unsigned long startMillis = millis(); unsigned long startMillis = millis();
while (!stream.available() && millis() - startMillis < 1000) {}; 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[0] = streamRead();
buf[1] = streamRead(); buf[1] = streamRead();
DBG("\n"); DBG(buf, "\n");
exitCommand(); exitCommand();
int intr = strtol(buf, 0, 16); int intr = strtol(buf, 0, 16);
return intr; return intr;
@@ -538,12 +538,7 @@ private:
streamWrite(tail...); streamWrite(tail...);
} }
int streamRead() { int streamRead() { return stream.read(); }
TINY_GSM_YIELD();
int c = stream.read();
DBG((char)c);
return c;
}
String streamReadUntil(char c) { String streamReadUntil(char c) {
TINY_GSM_YIELD(); TINY_GSM_YIELD();