Browse Source

Reorder some functions

v_master
Sara Damiano 5 years ago
parent
commit
41531c339b
14 changed files with 317 additions and 283 deletions
  1. +24
    -20
      src/TinyGsmClientA6.h
  2. +17
    -15
      src/TinyGsmClientBG96.h
  3. +15
    -13
      src/TinyGsmClientESP8266.h
  4. +18
    -16
      src/TinyGsmClientM590.h
  5. +19
    -17
      src/TinyGsmClientM95.h
  6. +38
    -34
      src/TinyGsmClientMC60.h
  7. +26
    -22
      src/TinyGsmClientSIM5360.h
  8. +18
    -16
      src/TinyGsmClientSIM7000.h
  9. +26
    -22
      src/TinyGsmClientSIM7600.h
  10. +18
    -16
      src/TinyGsmClientSIM800.h
  11. +18
    -16
      src/TinyGsmClientSaraR4.h
  12. +22
    -18
      src/TinyGsmClientSequansMonarch.h
  13. +27
    -21
      src/TinyGsmClientUBLOX.h
  14. +31
    -37
      src/TinyGsmClientXBee.h

+ 24
- 20
src/TinyGsmClientA6.h View File

@ -189,19 +189,6 @@ class TinyGsmA6
bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_AVAILABLE; bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_AVAILABLE;
/*
* SIM card functions
*/
protected:
String getSimCCIDImpl() {
sendAT(GF("+CCID"));
if (waitResponse(GF(GSM_NL "+SCID: SIM Card ID:")) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -216,6 +203,22 @@ class TinyGsmA6
return (s == REG_OK_HOME || s == REG_OK_ROAMING); return (s == REG_OK_HOME || s == REG_OK_ROAMING);
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+CIFSR"));
String res;
if (waitResponse(10000L, res) != 1) {
return "";
}
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
res.trim();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -272,15 +275,16 @@ class TinyGsmA6
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+CIFSR"));
String res;
if (waitResponse(10000L, res) != 1) { return ""; }
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
String getSimCCIDImpl() {
sendAT(GF("+CCID"));
if (waitResponse(GF(GSM_NL "+SCID: SIM Card ID:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
res.trim(); res.trim();
return res; return res;
} }


+ 17
- 15
src/TinyGsmClientBG96.h View File

@ -208,19 +208,6 @@ class TinyGsmBG96
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
String getSimCCIDImpl() {
sendAT(GF("+QCCID"));
if (waitResponse(GF(GSM_NL "+QCCID:")) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -235,6 +222,12 @@ class TinyGsmBG96
return (s == REG_OK_HOME || s == REG_OK_ROAMING); return (s == REG_OK_HOME || s == REG_OK_ROAMING);
} }
/*
* IP Address functions
*/
protected:
// Can follow all of the IP functions from the template
/* /*
* GPRS functions * GPRS functions
*/ */
@ -267,10 +260,19 @@ class TinyGsmBG96
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
// Can follow all of the IP functions from the template
String getSimCCIDImpl() {
sendAT(GF("+QCCID"));
if (waitResponse(GF(GSM_NL "+QCCID:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Phone Call functions * Phone Call functions


+ 15
- 13
src/TinyGsmClientESP8266.h View File

@ -257,6 +257,21 @@ class TinyGsmESP8266
} }
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+CIPSTA_CUR?"));
int res1 = waitResponse(GF("ERROR"), GF("+CWJAP_CUR:"));
if (res1 != 2) {
return "";
}
String res2 = stream.readStringUntil('"');
waitResponse();
return res2;
}
/* /*
* WiFi functions * WiFi functions
*/ */
@ -277,19 +292,6 @@ class TinyGsmESP8266
return retVal; return retVal;
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+CIPSTA_CUR?"));
int res1 = waitResponse(GF("ERROR"), GF("+CWJAP_CUR:"));
if (res1 != 2) { return ""; }
String res2 = stream.readStringUntil('"');
waitResponse();
return res2;
}
/* /*
* Phone Call functions * Phone Call functions
*/ */


+ 18
- 16
src/TinyGsmClientM590.h View File

@ -190,12 +190,6 @@ class TinyGsmM590
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
// Able to follow all SIM card functions as inherited from the template
/* /*
* Generic network functions * Generic network functions
*/ */
@ -210,6 +204,22 @@ class TinyGsmM590
return (s == REG_OK_HOME || s == REG_OK_ROAMING); return (s == REG_OK_HOME || s == REG_OK_ROAMING);
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+XIIC?"));
if (waitResponse(GF(GSM_NL "+XIIC:")) != 1) {
return "";
}
streamSkipUntil(',');
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -267,18 +277,10 @@ class TinyGsmM590
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+XIIC?"));
if (waitResponse(GF(GSM_NL "+XIIC:")) != 1) { return ""; }
streamSkipUntil(',');
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
// Able to follow all SIM card functions as inherited from the template
/* /*
* Phone Call functions * Phone Call functions


+ 19
- 17
src/TinyGsmClientM95.h View File

@ -217,19 +217,6 @@ class TinyGsmM95
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
String getSimCCIDImpl() {
sendAT(GF("+QCCID"));
if (waitResponse(GF(GSM_NL "+QCCID:")) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -254,6 +241,18 @@ class TinyGsmM95
waitResponse(); waitResponse();
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+QILOCIP"));
streamSkipUntil('\n');
String res = stream.readStringUntil('\n');
res.trim();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -334,13 +333,16 @@ class TinyGsmM95
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+QILOCIP"));
streamSkipUntil('\n');
String getSimCCIDImpl() {
sendAT(GF("+QCCID"));
if (waitResponse(GF(GSM_NL "+QCCID:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n'); String res = stream.readStringUntil('\n');
waitResponse();
res.trim(); res.trim();
return res; return res;
} }


+ 38
- 34
src/TinyGsmClientMC60.h View File

@ -226,33 +226,6 @@ class TinyGsmMC60
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
SimStatus getSimStatusImpl(uint32_t timeout_ms = 10000L) {
for (uint32_t start = millis(); millis() - start < timeout_ms;) {
sendAT(GF("+CPIN?"));
if (waitResponse(GF(GSM_NL "+CPIN:")) != 1) {
delay(1000);
continue;
}
int status = waitResponse(GF("READY"), GF("SIM PIN"), GF("SIM PUK"),
GF("NOT INSERTED"), GF("PH_SIM PIN"),
GF("PH_SIM PUK"));
waitResponse();
switch (status) {
case 2:
case 3: return SIM_LOCKED;
case 5:
case 6: return SIM_ANTITHEFT_LOCKED;
case 1: return SIM_READY;
default: return SIM_ERROR;
}
}
return SIM_ERROR;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -267,6 +240,18 @@ class TinyGsmMC60
return (s == REG_OK_HOME || s == REG_OK_ROAMING); return (s == REG_OK_HOME || s == REG_OK_ROAMING);
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+QILOCIP"));
streamSkipUntil('\n');
String res = stream.readStringUntil('\n');
res.trim();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -326,15 +311,34 @@ class TinyGsmMC60
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+QILOCIP"));
streamSkipUntil('\n');
String res = stream.readStringUntil('\n');
res.trim();
return res;
SimStatus getSimStatusImpl(uint32_t timeout_ms = 10000L) {
for (uint32_t start = millis(); millis() - start < timeout_ms;) {
sendAT(GF("+CPIN?"));
if (waitResponse(GF(GSM_NL "+CPIN:")) != 1) {
delay(1000);
continue;
}
int status =
waitResponse(GF("READY"), GF("SIM PIN"), GF("SIM PUK"),
GF("NOT INSERTED"), GF("PH_SIM PIN"), GF("PH_SIM PUK"));
waitResponse();
switch (status) {
case 2:
case 3:
return SIM_LOCKED;
case 5:
case 6:
return SIM_ANTITHEFT_LOCKED;
case 1:
return SIM_READY;
default:
return SIM_ERROR;
}
}
return SIM_ERROR;
} }
/* /*


+ 26
- 22
src/TinyGsmClientSIM5360.h View File

@ -227,20 +227,6 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360, READ_AND_CHECK_SIZE,
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
// Gets the CCID of a sim card via AT+CCID
String getSimCCIDImpl() {
sendAT(GF("+CICCID"));
if (waitResponse(GF(GSM_NL "+ICCID:")) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -272,6 +258,23 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360, READ_AND_CHECK_SIZE,
return res; return res;
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+IPADDR")); // Inquire Socket PDP address
// sendAT(GF("+CGPADDR=1")); // Show PDP address
String res;
if (waitResponse(10000L, res) != 1) {
return "";
}
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
res.trim();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -386,16 +389,17 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360, READ_AND_CHECK_SIZE,
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+IPADDR")); // Inquire Socket PDP address
// sendAT(GF("+CGPADDR=1")); // Show PDP address
String res;
if (waitResponse(10000L, res) != 1) { return ""; }
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
// Gets the CCID of a sim card via AT+CCID
String getSimCCIDImpl() {
sendAT(GF("+CICCID"));
if (waitResponse(GF(GSM_NL "+ICCID:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
res.trim(); res.trim();
return res; return res;
} }


+ 18
- 16
src/TinyGsmClientSIM7000.h View File

@ -226,12 +226,6 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000, READ_AND_CHECK_SIZE,
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
// Able to follow all SIM card functions as inherited from the template
/* /*
* Generic network functions * Generic network functions
*/ */
@ -279,6 +273,22 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000, READ_AND_CHECK_SIZE,
return res; return res;
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+CIFSR;E0"));
String res;
if (waitResponse(10000L, res) != 1) {
return "";
}
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
res.trim();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -365,18 +375,10 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000, READ_AND_CHECK_SIZE,
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+CIFSR;E0"));
String res;
if (waitResponse(10000L, res) != 1) { return ""; }
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
res.trim();
return res;
}
// Able to follow all SIM card functions as inherited from the template
/* /*
* Phone Call functions * Phone Call functions


+ 26
- 22
src/TinyGsmClientSIM7600.h View File

@ -203,20 +203,6 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600, READ_AND_CHECK_SIZE,
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
// Gets the CCID of a sim card via AT+CCID
String getSimCCIDImpl() {
sendAT(GF("+CICCID"));
if (waitResponse(GF(GSM_NL "+ICCID:")) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -248,6 +234,23 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600, READ_AND_CHECK_SIZE,
return res; return res;
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+IPADDR")); // Inquire Socket PDP address
// sendAT(GF("+CGPADDR=1")); // Show PDP address
String res;
if (waitResponse(10000L, res) != 1) {
return "";
}
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
res.trim();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -339,16 +342,17 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600, READ_AND_CHECK_SIZE,
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+IPADDR")); // Inquire Socket PDP address
// sendAT(GF("+CGPADDR=1")); // Show PDP address
String res;
if (waitResponse(10000L, res) != 1) { return ""; }
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
// Gets the CCID of a sim card via AT+CCID
String getSimCCIDImpl() {
sendAT(GF("+CICCID"));
if (waitResponse(GF(GSM_NL "+ICCID:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
res.trim(); res.trim();
return res; return res;
} }


+ 18
- 16
src/TinyGsmClientSIM800.h View File

@ -254,12 +254,6 @@ class TinyGsmSim800 : public TinyGsmModem<TinyGsmSim800, READ_AND_CHECK_SIZE,
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
// Able to follow all SIM card functions as inherited from the template
/* /*
* Generic network functions * Generic network functions
*/ */
@ -274,6 +268,22 @@ class TinyGsmSim800 : public TinyGsmModem<TinyGsmSim800, READ_AND_CHECK_SIZE,
return (s == REG_OK_HOME || s == REG_OK_ROAMING); return (s == REG_OK_HOME || s == REG_OK_ROAMING);
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+CIFSR;E0"));
String res;
if (waitResponse(10000L, res) != 1) {
return "";
}
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
res.trim();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -364,18 +374,10 @@ class TinyGsmSim800 : public TinyGsmModem<TinyGsmSim800, READ_AND_CHECK_SIZE,
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+CIFSR;E0"));
String res;
if (waitResponse(10000L, res) != 1) { return ""; }
res.replace(GSM_NL "OK" GSM_NL, "");
res.replace(GSM_NL, "");
res.trim();
return res;
}
// Able to follow all SIM card functions as inherited from the template
/* /*
* Phone Call functions * Phone Call functions


+ 18
- 16
src/TinyGsmClientSaraR4.h View File

@ -281,20 +281,6 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4, READ_AND_CHECK_SIZE,
bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_AVAILABLE; bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_AVAILABLE;
/*
* SIM card functions
*/
protected:
// This uses "CGSN" instead of "GSN"
String getIMEIImpl() {
sendAT(GF("+CGSN"));
if (waitResponse(GF(GSM_NL)) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -341,6 +327,12 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4, READ_AND_CHECK_SIZE,
return restart(); return restart();
} }
/*
* IP Address functions
*/
protected:
// Can follow the template in all function
/* /*
* GPRS functions * GPRS functions
*/ */
@ -393,10 +385,20 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4, READ_AND_CHECK_SIZE,
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
// Can follow the template in all function
// This uses "CGSN" instead of "GSN"
String getIMEIImpl() {
sendAT(GF("+CGSN"));
if (waitResponse(GF(GSM_NL)) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Phone Call functions * Phone Call functions


+ 22
- 18
src/TinyGsmClientSequansMonarch.h View File

@ -274,19 +274,6 @@ class TinyGsmSequansMonarch
return waitResponse() == 1; return waitResponse() == 1;
} }
/*
* SIM card functions
*/
protected:
String getSimCCIDImpl() {
sendAT(GF("+SQNCCID"));
if (waitResponse(GF(GSM_NL "+SQNCCID:")) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -301,6 +288,20 @@ class TinyGsmSequansMonarch
return (s == REG_OK_HOME || s == REG_OK_ROAMING); return (s == REG_OK_HOME || s == REG_OK_ROAMING);
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+CGPADDR=3"));
if (waitResponse(10000L, GF("+CGPADDR: 3,\"")) != 1) {
return "";
}
String res = stream.readStringUntil('\"');
waitResponse();
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -338,14 +339,17 @@ class TinyGsmSequansMonarch
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+CGPADDR=3"));
if (waitResponse(10000L, GF("+CGPADDR: 3,\"")) != 1) { return ""; }
String res = stream.readStringUntil('\"');
String getSimCCIDImpl() {
sendAT(GF("+SQNCCID"));
if (waitResponse(GF(GSM_NL "+SQNCCID:")) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse(); waitResponse();
res.trim();
return res; return res;
} }


+ 27
- 21
src/TinyGsmClientUBLOX.h View File

@ -243,19 +243,6 @@ class TinyGsmUBLOX
bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_IMPLEMENTED; bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_IMPLEMENTED;
/*
* SIM card functions
*/
protected:
String getIMEIImpl() {
sendAT(GF("+CGSN"));
if (waitResponse(GF(GSM_NL)) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -275,6 +262,24 @@ class TinyGsmUBLOX
return false; return false;
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
sendAT(GF("+UPSND=0,0"));
if (waitResponse(GF(GSM_NL "+UPSND:")) != 1) {
return "";
}
streamSkipUntil(','); // Skip PSD profile
streamSkipUntil('\"'); // Skip request type
String res = stream.readStringUntil('\"');
if (waitResponse() != 1) {
return "";
}
return res;
}
/* /*
* GPRS functions * GPRS functions
*/ */
@ -360,16 +365,17 @@ class TinyGsmUBLOX
} }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
sendAT(GF("+UPSND=0,0"));
if (waitResponse(GF(GSM_NL "+UPSND:")) != 1) { return ""; }
streamSkipUntil(','); // Skip PSD profile
streamSkipUntil('\"'); // Skip request type
String res = stream.readStringUntil('\"');
if (waitResponse() != 1) { return ""; }
String getIMEIImpl() {
sendAT(GF("+CGSN"));
if (waitResponse(GF(GSM_NL)) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res; return res;
} }


+ 31
- 37
src/TinyGsmClientXBee.h View File

@ -542,29 +542,6 @@ class TinyGsmXBee
bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_IMPLEMENTED; bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_IMPLEMENTED;
/*
* SIM card functions
*/
protected:
bool simUnlockImpl(const char* pin) { // Not supported
if (pin && strlen(pin) > 0) {
DBG("XBee's do not support SIMs that require an unlock pin!");
}
return false;
}
String getSimCCIDImpl() {
return sendATGetString(GF("S#"));
}
String getIMEIImpl() {
return sendATGetString(GF("IM"));
}
SimStatus getSimStatusImpl(uint32_t) {
return SIM_READY; // unsupported
}
/* /*
* Generic network functions * Generic network functions
*/ */
@ -715,6 +692,22 @@ class TinyGsmXBee
return retVal; return retVal;
} }
/*
* IP Address functions
*/
protected:
String getLocalIPImpl() {
XBEE_COMMAND_START_DECORATOR(5, "")
sendAT(GF("MY"));
String IPaddr;
IPaddr.reserve(16);
// wait for the response - this response can be very slow
IPaddr = readResponseString(30000);
XBEE_COMMAND_END_DECORATOR
IPaddr.trim();
return IPaddr;
}
/* /*
* WiFi functions * WiFi functions
*/ */
@ -795,24 +788,25 @@ class TinyGsmXBee
return isNetworkConnected(); return isNetworkConnected();
} }
String getOperatorImpl() {
return sendATGetString(GF("MN"));
}
String getOperatorImpl() { return sendATGetString(GF("MN")); }
/* /*
* IP Address functions
* SIM card functions
*/ */
protected: protected:
String getLocalIPImpl() {
XBEE_COMMAND_START_DECORATOR(5, "")
sendAT(GF("MY"));
String IPaddr;
IPaddr.reserve(16);
// wait for the response - this response can be very slow
IPaddr = readResponseString(30000);
XBEE_COMMAND_END_DECORATOR
IPaddr.trim();
return IPaddr;
bool simUnlockImpl(const char* pin) { // Not supported
if (pin && strlen(pin) > 0) {
DBG("XBee's do not support SIMs that require an unlock pin!");
}
return false;
}
String getSimCCIDImpl() { return sendATGetString(GF("S#")); }
String getIMEIImpl() { return sendATGetString(GF("IM")); }
SimStatus getSimStatusImpl(uint32_t) {
return SIM_READY; // unsupported
} }
/* /*


Loading…
Cancel
Save