Added support for IMSI information on SIM800 and SIM808 modules
This commit is contained in:
@@ -321,6 +321,8 @@ TINY_GSM_MODEM_GET_SIMCCID_CCID()
|
|||||||
|
|
||||||
TINY_GSM_MODEM_GET_IMEI_GSN()
|
TINY_GSM_MODEM_GET_IMEI_GSN()
|
||||||
|
|
||||||
|
TINY_GSM_MODEM_GET_IMSI_CIMI()
|
||||||
|
|
||||||
SimStatus getSimStatus(unsigned long timeout_ms = 10000L) {
|
SimStatus getSimStatus(unsigned long timeout_ms = 10000L) {
|
||||||
for (unsigned long start = millis(); millis() - start < timeout_ms; ) {
|
for (unsigned long start = millis(); millis() - start < timeout_ms; ) {
|
||||||
sendAT(GF("+CPIN?"));
|
sendAT(GF("+CPIN?"));
|
||||||
|
@@ -527,6 +527,20 @@ String TinyGsmDecodeHex16bit(String &instr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Asks for International Mobile Subscriber Identity IMSI via the AT+CIMI command
|
||||||
|
#define TINY_GSM_MODEM_GET_IMSI_CIMI() \
|
||||||
|
String getIMSI() { \
|
||||||
|
sendAT(GF("+CIMI")); \
|
||||||
|
if (waitResponse(GF(GSM_NL)) != 1) { \
|
||||||
|
return ""; \
|
||||||
|
} \
|
||||||
|
String res = stream.readStringUntil('\n'); \
|
||||||
|
waitResponse(); \
|
||||||
|
res.trim(); \
|
||||||
|
return res; \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gets the modem's registration status via CREG/CGREG/CEREG
|
// Gets the modem's registration status via CREG/CGREG/CEREG
|
||||||
// CREG = Generic network registration
|
// CREG = Generic network registration
|
||||||
// CGREG = GPRS service registration
|
// CGREG = GPRS service registration
|
||||||
|
Reference in New Issue
Block a user