Browse Source

Trying to find error in XBee

v_master
SRGDamia1 7 years ago
parent
commit
8a49f72f19
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      TinyGsmClientXBee.h

+ 3
- 8
TinyGsmClientXBee.h 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() {
TINY_GSM_YIELD();
int c = stream.read();
DBG((char)c);
return c;
}
int streamRead() { return stream.read(); }
String streamReadUntil(char c) { String streamReadUntil(char c) {
TINY_GSM_YIELD(); TINY_GSM_YIELD();


Loading…
Cancel
Save