diff --git a/src/TinyGsmClientA6.h b/src/TinyGsmClientA6.h index aba1cf8..cc6f946 100644 --- a/src/TinyGsmClientA6.h +++ b/src/TinyGsmClientA6.h @@ -176,11 +176,11 @@ class TinyGsmA6 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } sendAT(GF("+RST=1")); delay(3000); - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientBG96.h b/src/TinyGsmClientBG96.h index 245d923..41892cd 100644 --- a/src/TinyGsmClientBG96.h +++ b/src/TinyGsmClientBG96.h @@ -202,11 +202,11 @@ class TinyGsmBG96 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } if (!setPhoneFunctionality(1, true)) { return false; } waitResponse(10000L, GF("APP RDY")); - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientESP8266.h b/src/TinyGsmClientESP8266.h index b3244c7..0b5c7a6 100644 --- a/src/TinyGsmClientESP8266.h +++ b/src/TinyGsmClientESP8266.h @@ -182,13 +182,13 @@ class TinyGsmESP8266 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } sendAT(GF("+RST")); if (waitResponse(10000L) != 1) { return false; } if (waitResponse(10000L, GF(GSM_NL "ready" GSM_NL)) != 1) { return false; } delay(500); - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientM590.h b/src/TinyGsmClientM590.h index c234941..43804e2 100644 --- a/src/TinyGsmClientM590.h +++ b/src/TinyGsmClientM590.h @@ -171,12 +171,12 @@ class TinyGsmM590 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } if (!setPhoneFunctionality(15)) { return false; } // MODEM:STARTUP waitResponse(60000L, GF(GSM_NL "+PBREADY" GSM_NL)); - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientM95.h b/src/TinyGsmClientM95.h index a853512..538969a 100644 --- a/src/TinyGsmClientM95.h +++ b/src/TinyGsmClientM95.h @@ -198,7 +198,7 @@ class TinyGsmM95 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } sendAT(GF("+CFUN=0")); if (waitResponse(10000L, GF("NORMAL POWER DOWN"), GF("OK"), GF("FAIL")) == @@ -209,7 +209,7 @@ class TinyGsmM95 : public TinyGsmModem, if (waitResponse(10000L, GF("Call Ready"), GF("OK"), GF("FAIL")) == 3) { return false; } - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientMC60.h b/src/TinyGsmClientMC60.h index 7eb2c4b..9d30ef1 100644 --- a/src/TinyGsmClientMC60.h +++ b/src/TinyGsmClientMC60.h @@ -197,12 +197,12 @@ class TinyGsmMC60 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } if (!setPhoneFunctionality(0)) { return false; } if (!setPhoneFunctionality(1, true)) { return false; } delay(3000); - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientSIM5360.h b/src/TinyGsmClientSIM5360.h index 536d0d6..c4c2b83 100644 --- a/src/TinyGsmClientSIM5360.h +++ b/src/TinyGsmClientSIM5360.h @@ -215,7 +215,7 @@ class TinyGsmSim5360 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } sendAT(GF("+REBOOT")); // Should return an 'OK' after reboot command is sent @@ -223,7 +223,7 @@ class TinyGsmSim5360 : public TinyGsmModem, // After booting, modem sends out messages as each of its // internal modules loads. The final message is "PB DONE". if (waitResponse(40000L, GF(GSM_NL "PB DONE")) != 1) { return false; } - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientSIM7000.h b/src/TinyGsmClientSIM7000.h index 4a9e751..0934bf4 100644 --- a/src/TinyGsmClientSIM7000.h +++ b/src/TinyGsmClientSIM7000.h @@ -212,11 +212,11 @@ class TinyGsmSim7000 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!setPhoneFunctionality(0)) { return false; } if (!setPhoneFunctionality(1, true)) { return false; } waitResponse(10000L, GF("SMS Ready"), GF("RDY")); - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientSIM7600.h b/src/TinyGsmClientSIM7600.h index b592853..ae2220d 100644 --- a/src/TinyGsmClientSIM7600.h +++ b/src/TinyGsmClientSIM7600.h @@ -219,12 +219,12 @@ class TinyGsmSim7600 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } sendAT(GF("+CRESET")); if (waitResponse(10000L) != 1) { return false; } delay(5000L); // TODO(?): Test this delay! - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index b78ac98..3754eb5 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -250,14 +250,14 @@ class TinyGsmSim800 : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } sendAT(GF("&W")); waitResponse(); if (!setPhoneFunctionality(0)) { return false; } if (!setPhoneFunctionality(1, true)) { return false; } delay(3000); - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientSaraR4.h b/src/TinyGsmClientSaraR4.h index 30ccb81..8cc0b4d 100644 --- a/src/TinyGsmClientSaraR4.h +++ b/src/TinyGsmClientSaraR4.h @@ -297,11 +297,11 @@ class TinyGsmSaraR4 : public TinyGsmModem, */ protected: // using +CFUN=15 instead of the more common CFUN=1,1 - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } if (!setPhoneFunctionality(15)) { return false; } delay(3000); // TODO(?): Verify delay timing here - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientSequansMonarch.h b/src/TinyGsmClientSequansMonarch.h index 1a997db..855c166 100644 --- a/src/TinyGsmClientSequansMonarch.h +++ b/src/TinyGsmClientSequansMonarch.h @@ -283,7 +283,7 @@ class TinyGsmSequansMonarch * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } sendAT(GF("+CFUN=0")); @@ -295,7 +295,7 @@ class TinyGsmSequansMonarch res = waitResponse(20000L, GF("+SYSSTART"), GFP(GSM_ERROR)); if (res != 1 && res != 3) { return false; } delay(1000); - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index 600dcd7..ce27d99 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -243,11 +243,11 @@ class TinyGsmUBLOX : public TinyGsmModem, * Power functions */ protected: - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!testAT()) { return false; } if (!setPhoneFunctionality(16)) { return false; } delay(3000); // TODO(?): Verify delay timing here - return init(); + return init(pin); } bool powerOffImpl() { diff --git a/src/TinyGsmClientXBee.h b/src/TinyGsmClientXBee.h index cd8320d..a360631 100644 --- a/src/TinyGsmClientXBee.h +++ b/src/TinyGsmClientXBee.h @@ -487,7 +487,7 @@ class TinyGsmXBee : public TinyGsmModem, } } - bool restartImpl() { + bool restartImpl(const char* pin = NULL) { if (!commandMode()) { return false; } // Return immediately if (beeType == XBEE_UNKNOWN) getSeries(); // how we restart depends on this @@ -525,7 +525,7 @@ class TinyGsmXBee : public TinyGsmModem, exitCommand(); - return init(); + return init(pin); } void setupPinSleep(bool maintainAssociation = false) { diff --git a/src/TinyGsmModem.tpp b/src/TinyGsmModem.tpp index d22770f..1f2f928 100644 --- a/src/TinyGsmModem.tpp +++ b/src/TinyGsmModem.tpp @@ -53,8 +53,8 @@ class TinyGsmModem { /* * Power functions */ - bool restart() { - return thisModem().restartImpl(); + bool restart(const char* pin = NULL) { + return thisModem().restartImpl(pin); } bool poweroff() { return thisModem().powerOffImpl();