SIM7000 - setNetworkMode - setPreferredMode

Added Network and Preferred Mode selection functions
This commit is contained in:
MrTarantl
2019-02-13 11:53:14 +01:00
parent c3cecabefd
commit e4c4b3ebc6
2 changed files with 256 additions and 0 deletions

View File

@@ -458,6 +458,62 @@ public:
return false;
}
String getNetworkModes() {
sendAT(GF("+CNMP=?"));
if (waitResponse(GF(GSM_NL "+CNMP:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
return res;
}
String setNetworkMode(uint8_t mode) {
sendAT(GF("+CNMP="), mode);
if (waitResponse(GF(GSM_NL "+CNMP:")) != 1) {
return "OK";
}
String res = stream.readStringUntil('\n');
waitResponse();
return res;
}
String getPreferredModes() {
sendAT(GF("+CMNB=?"));
if (waitResponse(GF(GSM_NL "+CMNB:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
return res;
}
String setPreferredMode(uint8_t mode) {
sendAT(GF("+CMNB="), mode);
if (waitResponse(GF(GSM_NL "+CMNB:")) != 1) {
return "OK";
}
String res = stream.readStringUntil('\n');
waitResponse();
return res;
}
/*
* GPS location functions
*/
@@ -698,6 +754,7 @@ public:
return true;
}
String getLocalIP() {
sendAT(GF("+CIFSR;E0"));
String res;