diff --git a/extras/doc/Quectel_M95_GSM_Specification_V3.1.pdf b/extras/doc/Quectel_M95_GSM_Specification_V3.1.pdf deleted file mode 100644 index b73c228..0000000 Binary files a/extras/doc/Quectel_M95_GSM_Specification_V3.1.pdf and /dev/null differ diff --git a/src/TinyGsmClientBG96.h b/src/TinyGsmClientBG96.h index ac76365..b1d6d49 100644 --- a/src/TinyGsmClientBG96.h +++ b/src/TinyGsmClientBG96.h @@ -308,8 +308,9 @@ public: } bool poweroff() { - sendAT(GF("+QPOWD")); - return waitResponse(GF("POWERED DOWN")) == 1; // TODO + sendAT(GF("+QPOWD=1")); + waitResponse(300); // returns OK first + return waitResponse(300, GF("POWERED DOWN")) == 1; } bool radioOff() { diff --git a/src/TinyGsmClientESP8266.h b/src/TinyGsmClientESP8266.h index b6da2b2..b43ca12 100644 --- a/src/TinyGsmClientESP8266.h +++ b/src/TinyGsmClientESP8266.h @@ -297,7 +297,10 @@ public: return init(); } - bool poweroff() TINY_GSM_ATTR_NOT_IMPLEMENTED; + bool poweroff() { + sendAT(GF("+GSLP=0")); // Power down indefinitely - until manually reset! + return waitResponse() == 1; + } bool radioOff() TINY_GSM_ATTR_NOT_IMPLEMENTED; diff --git a/src/TinyGsmClientM95.h b/src/TinyGsmClientM95.h index 6b01da1..88f99b7 100644 --- a/src/TinyGsmClientM95.h +++ b/src/TinyGsmClientM95.h @@ -316,8 +316,8 @@ public: } bool poweroff() { - sendAT(GF("+QPOWD")); - return waitResponse(GF("POWERED DOWN")) == 1; // TODO + sendAT(GF("+QPOWD=1")); + return waitResponse(300, GF("NORMAL POWER DOWN")) == 1; } bool radioOff() { diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index e34504e..0fb513c 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -325,7 +325,10 @@ public: return init(); } - bool poweroff() TINY_GSM_ATTR_NOT_IMPLEMENTED; + bool poweroff() { + sendAT(GF("+CPWROFF")); + return waitResponse(40000L) == 1; + } bool radioOff() { sendAT(GF("+CFUN=0")); diff --git a/src/TinyGsmClientXBee.h b/src/TinyGsmClientXBee.h index 0c82962..d969d93 100644 --- a/src/TinyGsmClientXBee.h +++ b/src/TinyGsmClientXBee.h @@ -402,7 +402,9 @@ public: exitCommand(); } - bool poweroff() TINY_GSM_ATTR_NOT_IMPLEMENTED; + bool poweroff() { // Not supported + return false; + } bool radioOff() TINY_GSM_ATTR_NOT_IMPLEMENTED; diff --git a/src/TinyGsmCommon.h b/src/TinyGsmCommon.h index 2cd7827..f1d5729 100644 --- a/src/TinyGsmCommon.h +++ b/src/TinyGsmCommon.h @@ -239,6 +239,7 @@ public: */ virtual bool restart() = 0; + virtual bool poweroff() = 0; /* * SIM card functions - only apply to cellular modems @@ -282,6 +283,7 @@ public: return false; } virtual bool gprsDisconnect() { return false; } + virtual bool isGprsConnected() { return false; } /* * IP Address functions