mirror of
https://github.com/KevinMidboe/TinyGSM.git
synced 2025-10-29 18:00:18 +00:00
A bit of debugging
This commit is contained in:
@@ -338,12 +338,15 @@ public:
|
|||||||
|
|
||||||
sendAT(GF("AP"), 0); // Put in transparent mode
|
sendAT(GF("AP"), 0); // Put in transparent mode
|
||||||
waitResponse();
|
waitResponse();
|
||||||
sendAT(GF("IP"), 0); // Put in UDP mode
|
sendAT(GF("IP"), 1); // Put in TCP mode
|
||||||
waitResponse();
|
waitResponse();
|
||||||
|
|
||||||
sendAT(GF("AN"), apn);
|
sendAT(GF("AN"), apn); // Set the APN
|
||||||
waitResponse();
|
waitResponse();
|
||||||
|
|
||||||
|
writeChanges();
|
||||||
|
exitCommand();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,10 +433,11 @@ public:
|
|||||||
finish:
|
finish:
|
||||||
if (!index) {
|
if (!index) {
|
||||||
data.trim();
|
data.trim();
|
||||||
|
data.replace(GSM_NL GSM_NL, GSM_NL);
|
||||||
|
data.replace(GSM_NL, "\r\n" " ");
|
||||||
if (data.length()) {
|
if (data.length()) {
|
||||||
DBG("### Unhandled:", data);
|
DBG("### Unhandled:", data);
|
||||||
}
|
}
|
||||||
data = "";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
data.trim();
|
data.trim();
|
||||||
@@ -529,6 +533,7 @@ private:
|
|||||||
bool commandMode(void){
|
bool commandMode(void){
|
||||||
delay(1000); // cannot send anything for 1 second before entering command mode
|
delay(1000); // cannot send anything for 1 second before entering command mode
|
||||||
streamWrite(GF("+++")); // enter command mode
|
streamWrite(GF("+++")); // enter command mode
|
||||||
|
DBG("+++\r\n");
|
||||||
waitResponse(1100);
|
waitResponse(1100);
|
||||||
return 1 == waitResponse(1100); // wait another second for an "OK\r"
|
return 1 == waitResponse(1100); // wait another second for an "OK\r"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user