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

@@ -204,8 +204,7 @@ class TinyGsmBG96 : public TinyGsmModem<TinyGsmBG96>,
protected:
bool restartImpl() {
if (!testAT()) { return false; }
sendAT(GF("+CFUN=1,1"));
if (waitResponse(10000L, GF("OK")) != 1) { return false; }
if (!setPhoneFunctionality(1, true)) { return false; }
waitResponse(10000L, GF("APP RDY"));
return init();
}
@@ -226,6 +225,11 @@ class TinyGsmBG96 : public TinyGsmModem<TinyGsmBG96>,
return waitResponse() == 1;
}
bool setPhoneFunctionalityImpl(uint8_t fun, bool reset = false) {
sendAT(GF("+CFUN="), fun, reset ? ",1" : "");
return waitResponse(10000L, GF("OK")) == 1;
}
/*
* Generic network functions
*/