Reorder some functions

This commit is contained in:
Sara Damiano
2020-02-11 11:08:03 -05:00
parent 06c31aa856
commit 41531c339b
14 changed files with 317 additions and 283 deletions

View File

@@ -274,19 +274,6 @@ class TinyGsmSequansMonarch
return waitResponse() == 1;
}
/*
* SIM card functions
*/
protected:
String getSimCCIDImpl() {
sendAT(GF("+SQNCCID"));
if (waitResponse(GF(GSM_NL "+SQNCCID:")) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/*
* Generic network functions
*/
@@ -301,6 +288,20 @@ class TinyGsmSequansMonarch
return (s == REG_OK_HOME || s == REG_OK_ROAMING);
}
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+CGPADDR=3"));
if (waitResponse(10000L, GF("+CGPADDR: 3,\"")) != 1) {
return "";
}
String res = stream.readStringUntil('\"');
waitResponse();
return res;
}
/*
* GPRS functions
*/
@@ -338,14 +339,17 @@ class TinyGsmSequansMonarch
}
/*
* IP Address functions
* SIM card functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+CGPADDR=3"));
if (waitResponse(10000L, GF("+CGPADDR: 3,\"")) != 1) { return ""; }
String res = stream.readStringUntil('\"');
String getSimCCIDImpl() {
sendAT(GF("+SQNCCID"));
if (waitResponse(GF(GSM_NL "+SQNCCID:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}