Get name from modem

This commit is contained in:
Sara Damiano
2019-05-24 22:35:29 -04:00
parent 69cbab842d
commit 9ce1a2d998
5 changed files with 49 additions and 9 deletions

View File

@@ -181,7 +181,27 @@ public:
}
String getModemName() {
return "SIMCom SIM7000";
String name = "SIMCom SIM7000";
sendAT(GF("+CGMI"));
String res1;
if (waitResponse(1000L, res1) != 1) {
return name;
}
res1.replace(GSM_NL "OK" GSM_NL, "");
res1.trim();
sendAT(GF("+GMM"));
String res2;
if (waitResponse(1000L, res2) != 1) {
return name;
}
res2.replace(GSM_NL "OK" GSM_NL, "");
res2.trim();
name = res1 + String(' ') + res2;
DBG("### Modem:", name);
return name;
}
TINY_GSM_MODEM_SET_BAUD_IPR()