Merge pull request #389 from adrianca88/set_phone_functionality

Added setPhoneFunctionality method
This commit is contained in:
Sara Damiano
2020-10-01 14:04:31 -04:00
committed by GitHub
15 changed files with 78 additions and 28 deletions

View File

@@ -65,6 +65,9 @@ class TinyGsmModem {
bool sleepEnable(bool enable = true) {
return thisModem().sleepEnableImpl(enable);
}
bool setPhoneFunctionality(uint8_t fun, bool reset = false) {
return thisModem().setPhoneFunctionalityImpl(fun, reset);
}
/*
* Generic network functions
@@ -164,14 +167,15 @@ class TinyGsmModem {
*/
protected:
bool radioOffImpl() {
thisModem().sendAT(GF("+CFUN=0"));
if (thisModem().waitResponse(10000L) != 1) { return false; }
if (!thisModem().setPhoneFunctionality(0)) { return false; }
delay(3000);
return true;
}
bool sleepEnableImpl(bool enable = true) TINY_GSM_ATTR_NOT_IMPLEMENTED;
bool setPhoneFunctionalityImpl(uint8_t fun, bool reset = false) TINY_GSM_ATTR_NOT_IMPLEMENTED;
/*
* Generic network functions
*/