Minor debugging tweaks

This commit is contained in:
SRGDamia1
2017-04-13 01:37:26 -04:00
parent baa9768532
commit b0827e9565
2 changed files with 8 additions and 5 deletions

View File

@@ -618,7 +618,6 @@ public:
if (gotData) {
sockets[mux]->sock_available = modemGetAvailable(mux);
}
data = "";
return index;
}

View File

@@ -285,7 +285,12 @@ public:
bool waitForNetwork(unsigned long timeout = 60000L) {
for (unsigned long start = millis(); millis() - start < timeout; ) {
if (modemGetConnected()) {
commandMode();
sendAT(GF("AI"));
waitResponse();
String res = streamReadUntil('\r');
exitCommand();
if (res == 0) {
return true;
}
delay(1000);
@@ -389,7 +394,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("\r\n", ">>> AT:", cmd...);
DBG("\r\n", ">>> AT ", cmd..., "\r\n");
}
// TODO: Optimize this!
@@ -444,13 +449,12 @@ public:
data.replace(GSM_NL GSM_NL, GSM_NL);
data.replace(GSM_NL, "\r\n" " ");
if (data.length()) {
DBG(GSM_NL, "<<< ", data);
DBG("\r\n", "<<< ", data);
}
}
// if (gotData) {
// sockets[mux]->sock_available = modemGetAvailable(mux);
// }
data = "";
return index;
}