Added setPhoneFunctionalityImpl function

This commit is contained in:
Adrian Cervera Andes
2020-04-30 16:22:09 +02:00
parent ad42db2131
commit 868e2bedf9
10 changed files with 66 additions and 28 deletions

View File

@@ -203,8 +203,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();
}
@@ -225,6 +224,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
*/