SleepMode

Signed-off-by: Martin Kolací <martin.kolaci@lmc.eu>
This commit is contained in:
Martin Kolací
2020-12-28 13:10:49 +01:00
parent 6cc3c5dcf4
commit 25f31c7811
14 changed files with 170 additions and 40 deletions

View File

@@ -45,6 +45,9 @@ const char AT_CMD_CFUN0[] PROGMEM = "AT+CFUN=0"; //
const char AT_CMD_CFUN1[] PROGMEM = "AT+CFUN=1"; // Switch normal power mode
const char AT_CMD_CFUN4[] PROGMEM = "AT+CFUN=4"; // Switch sleep power mode
const char AC_CMD_CSCLK0[] PROGMEM = "AT+CSCLK=0"; // AT+CSCLK=0 command
const char AC_CMD_CSCLK2[] PROGMEM = "AT+CSCLK=2"; // AT+CSCLK=2 command
const char AT_CMD_CREG_TEST[] PROGMEM = "AT+CREG?"; // Check the network registration status
const char AT_CMD_SAPBR_GPRS[] PROGMEM = "AT+SAPBR=3,1,\"Contype\",\"GPRS\""; // Configure the GPRS bearer
const char AT_CMD_SAPBR_APN[] PROGMEM = "AT+SAPBR=3,1,\"APN\","; // Configure the APN for the GPRS
@@ -721,6 +724,16 @@ bool SIM800L::setPowerMode(PowerMode powerMode) {
return currentPowerMode == powerMode;
}
void SIM800L::exitSleepMode() {
sendCommand_P(AC_CMD_CSCLK0);
purgeSerial();
}
void SIM800L::enterSleepMode() {
sendCommand_P(AC_CMD_CSCLK2);
purgeSerial();
}
/**
* Status function: Check the strengh of the signal
*/