Fix isGprsConnected, gprsDisconnect
This commit is contained in:
@@ -398,14 +398,15 @@ public:
|
|||||||
|
|
||||||
bool gprsDisconnect() {
|
bool gprsDisconnect() {
|
||||||
sendAT(GF("+CIPSHUT"));
|
sendAT(GF("+CIPSHUT"));
|
||||||
if (waitResponse(60000L) != 1)
|
waitResponse(5000L);
|
||||||
return false;
|
|
||||||
|
|
||||||
sendAT(GF("+CGATT=0"));
|
for (int i = 0; i<3; i++) {
|
||||||
if (waitResponse(60000L) != 1)
|
sendAT(GF("+CGATT=0"));
|
||||||
return false;
|
if (waitResponse(5000L) == 1)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isGprsConnected() {
|
bool isGprsConnected() {
|
||||||
@@ -415,14 +416,7 @@ public:
|
|||||||
}
|
}
|
||||||
int res = stream.readStringUntil('\n').toInt();
|
int res = stream.readStringUntil('\n').toInt();
|
||||||
waitResponse();
|
waitResponse();
|
||||||
if (res != 1)
|
return (res == 1);
|
||||||
return false;
|
|
||||||
|
|
||||||
sendAT(GF("+CIFSR")); // TODO: check this
|
|
||||||
if (waitResponse() != 1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String getLocalIP() {
|
String getLocalIP() {
|
||||||
|
Reference in New Issue
Block a user