Added IMSI
This commit is contained in:
@@ -38,6 +38,10 @@ class TinyGsmGPRS {
|
||||
String getIMEI() {
|
||||
return thisModem().getIMEIImpl();
|
||||
}
|
||||
// Asks for International Mobile Subscriber Identity IMSI
|
||||
String getIMSI() {
|
||||
return thisModem().getIMSIImpl();
|
||||
}
|
||||
SimStatus getSimStatus(uint32_t timeout_ms = 10000L) {
|
||||
return thisModem().getSimStatusImpl(timeout_ms);
|
||||
}
|
||||
@@ -105,6 +109,16 @@ class TinyGsmGPRS {
|
||||
return res;
|
||||
}
|
||||
|
||||
// Asks for International Mobile Subscriber Identity IMSI via the AT+CIMI
|
||||
// command
|
||||
String getIMSIImpl() {
|
||||
thisModem().sendAT(GF("+CIMI"));
|
||||
String res = thisModem().stream.readStringUntil('\n');
|
||||
thisModem().waitResponse();
|
||||
res.trim();
|
||||
return res;
|
||||
}
|
||||
|
||||
SimStatus getSimStatusImpl(uint32_t timeout_ms = 10000L) {
|
||||
for (uint32_t start = millis(); millis() - start < timeout_ms;) {
|
||||
thisModem().sendAT(GF("+CPIN?"));
|
||||
|
||||
Reference in New Issue
Block a user