diff --git a/README.md b/README.md index 2784cfe..4ab951a 100644 --- a/README.md +++ b/README.md @@ -116,9 +116,8 @@ Watch this repo for new updates! And of course, contributions are welcome ;) - SIM800, SIM and SIM7000 only **Credits** -- Primary Author/Contributor: +- Primary Authors/Contributors: - [vshymanskyy](https://github.com/vshymanskyy) -- Digi XBee, editing of all modules: - [SRGDamia1](https://github.com/SRGDamia1/) - SIM7000: - [captFuture](https://github.com/captFuture/) diff --git a/src/TinyGsmClientA6.h b/src/TinyGsmClientA6.h index ad09572..67dc515 100644 --- a/src/TinyGsmClientA6.h +++ b/src/TinyGsmClientA6.h @@ -596,7 +596,7 @@ protected: return len; } - bool modemGetConnected(uint8_t mux) { + bool modemGetConnected(uint8_t) { sendAT(GF("+CIPSTATUS")); //TODO mux? int res = waitResponse(GF(",\"CONNECTED\""), GF(",\"CLOSED\""), GF(",\"CLOSING\""), GF(",\"INITIAL\"")); waitResponse(); diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index 229e986..1abadf8 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -323,6 +323,8 @@ TINY_GSM_MODEM_GET_SIMCCID_CCID() TINY_GSM_MODEM_GET_IMEI_GSN() +TINY_GSM_MODEM_GET_IMSI_CIMI() + SimStatus getSimStatus(unsigned long timeout_ms = 10000L) { for (unsigned long start = millis(); millis() - start < timeout_ms; ) { sendAT(GF("+CPIN?")); @@ -700,7 +702,7 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() } uint8_t getBattChargeState() { - sendAT(GF("+CBC?")); + sendAT(GF("+CBC")); if (waitResponse(GF(GSM_NL "+CBC:")) != 1) { return false; } @@ -712,7 +714,7 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() } bool getBattStats(uint8_t &chargeState, int8_t &percent, uint16_t &milliVolts) { - sendAT(GF("+CBC?")); + sendAT(GF("+CBC")); if (waitResponse(GF(GSM_NL "+CBC:")) != 1) { return false; } diff --git a/src/TinyGsmCommon.h b/src/TinyGsmCommon.h index 6e8bf37..a7b46d7 100644 --- a/src/TinyGsmCommon.h +++ b/src/TinyGsmCommon.h @@ -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 // CREG = Generic network registration // CGREG = GPRS service registration