Added power off to common

And implemented for ublox
This commit is contained in:
Sara Damiano
2018-09-24 10:05:51 -04:00
parent 746b68d9f5
commit dfa731388a
7 changed files with 18 additions and 7 deletions

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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"));

View File

@@ -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;

View File

@@ -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