Also need to handle error for location string
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
@@ -75,6 +75,12 @@ class TinyGsmGSMLocation {
|
|||||||
thisModem().sendAT(GF("+CLBS=1,1"));
|
thisModem().sendAT(GF("+CLBS=1,1"));
|
||||||
// Should get a location code of "0" indicating success
|
// Should get a location code of "0" indicating success
|
||||||
if (thisModem().waitResponse(120000L, GF("+CLBS:0,")) != 1) { return ""; }
|
if (thisModem().waitResponse(120000L, GF("+CLBS:0,")) != 1) { return ""; }
|
||||||
|
int8_t locationCode = thisModem().streamGetIntLength(2);
|
||||||
|
// 0 = success, else, error
|
||||||
|
if (locationCode != 0) {
|
||||||
|
thisModem().waitResponse(); // should be an ok after the error
|
||||||
|
return "";
|
||||||
|
}
|
||||||
String res = thisModem().stream.readStringUntil('\n');
|
String res = thisModem().stream.readStringUntil('\n');
|
||||||
thisModem().waitResponse();
|
thisModem().waitResponse();
|
||||||
res.trim();
|
res.trim();
|
||||||
|
Reference in New Issue
Block a user