Merge pull request #34 from adrianca88/add_getIMSI_SIM800
Add get imsi sim800
This commit is contained in:
@@ -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/)
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user