Browse Source

Added power off to common

And implemented for ublox
v_master
Sara Damiano 6 years ago
parent
commit
dfa731388a
7 changed files with 18 additions and 7 deletions
  1. BIN
      extras/doc/Quectel_M95_GSM_Specification_V3.1.pdf
  2. +3
    -2
      src/TinyGsmClientBG96.h
  3. +4
    -1
      src/TinyGsmClientESP8266.h
  4. +2
    -2
      src/TinyGsmClientM95.h
  5. +4
    -1
      src/TinyGsmClientUBLOX.h
  6. +3
    -1
      src/TinyGsmClientXBee.h
  7. +2
    -0
      src/TinyGsmCommon.h

BIN
extras/doc/Quectel_M95_GSM_Specification_V3.1.pdf View File


+ 3
- 2
src/TinyGsmClientBG96.h View File

@ -308,8 +308,9 @@ public:
} }
bool poweroff() { 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() { bool radioOff() {


+ 4
- 1
src/TinyGsmClientESP8266.h View File

@ -297,7 +297,10 @@ public:
return init(); 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; bool radioOff() TINY_GSM_ATTR_NOT_IMPLEMENTED;


+ 2
- 2
src/TinyGsmClientM95.h View File

@ -316,8 +316,8 @@ public:
} }
bool poweroff() { 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() { bool radioOff() {


+ 4
- 1
src/TinyGsmClientUBLOX.h View File

@ -325,7 +325,10 @@ public:
return init(); return init();
} }
bool poweroff() TINY_GSM_ATTR_NOT_IMPLEMENTED;
bool poweroff() {
sendAT(GF("+CPWROFF"));
return waitResponse(40000L) == 1;
}
bool radioOff() { bool radioOff() {
sendAT(GF("+CFUN=0")); sendAT(GF("+CFUN=0"));


+ 3
- 1
src/TinyGsmClientXBee.h View File

@ -402,7 +402,9 @@ public:
exitCommand(); exitCommand();
} }
bool poweroff() TINY_GSM_ATTR_NOT_IMPLEMENTED;
bool poweroff() { // Not supported
return false;
}
bool radioOff() TINY_GSM_ATTR_NOT_IMPLEMENTED; bool radioOff() TINY_GSM_ATTR_NOT_IMPLEMENTED;


+ 2
- 0
src/TinyGsmCommon.h View File

@ -239,6 +239,7 @@ public:
*/ */
virtual bool restart() = 0; virtual bool restart() = 0;
virtual bool poweroff() = 0;
/* /*
* SIM card functions - only apply to cellular modems * SIM card functions - only apply to cellular modems
@ -282,6 +283,7 @@ public:
return false; return false;
} }
virtual bool gprsDisconnect() { return false; } virtual bool gprsDisconnect() { return false; }
virtual bool isGprsConnected() { return false; }
/* /*
* IP Address functions * IP Address functions


Loading…
Cancel
Save