Changed waitForNetwork in XBee
Want to force the reset for the WifiBee, which tends to be stuck reconnecting
This commit is contained in:
@@ -537,20 +537,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool waitForNetwork(unsigned long timeout = 60000L) {
|
bool waitForNetwork(unsigned long timeout = 60000L) {
|
||||||
commandMode();
|
|
||||||
for (unsigned long start = millis(); millis() - start < timeout; ) {
|
for (unsigned long start = millis(); millis() - start < timeout; ) {
|
||||||
sendAT(GF("AI"));
|
if (isNetworkConnected()) {
|
||||||
String res = readResponse();
|
|
||||||
char buf[3] = {0,}; // Set up buffer for response
|
|
||||||
res.toCharArray(buf, 3);
|
|
||||||
int intRes = strtol(buf, 0, 16);
|
|
||||||
if (intRes == 0) {
|
|
||||||
exitCommand();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
delay(250);
|
delay(250);
|
||||||
}
|
}
|
||||||
exitCommand();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user