Trying to find error in XBee
This commit is contained in:
@@ -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();
|
||||||
|
Reference in New Issue
Block a user