Added power off to common
And implemented for ublox
This commit is contained in:
@@ -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() {
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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() {
|
||||
|
@@ -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"));
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user