From c3a225e93565d5756797b7d0e32b2516ea826346 Mon Sep 17 00:00:00 2001 From: jrlanoisTA2023 <156359243+jrlanoisTA2023@users.noreply.github.com> Date: Fri, 12 Jan 2024 09:51:38 -0600 Subject: [PATCH] Incorporated changes from other PR Changes from https://github.com/vshymanskyy/TinyGSM/pull/642 --- src/TinyGsmClientSIM808.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/TinyGsmClientSIM808.h b/src/TinyGsmClientSIM808.h index 7398bfaa..ccba5d51 100644 --- a/src/TinyGsmClientSIM808.h +++ b/src/TinyGsmClientSIM808.h @@ -27,9 +27,16 @@ class TinyGsmSim808 : public TinyGsmSim800, public TinyGsmGPS, pu */ protected: // enable GPS - bool enableGPSImpl() { + bool enableGPSImpl(GpsStartMode startMode = GPS_START_AUTO) { // From https://github.com/vshymanskyy/TinyGSM/pull/642 sendAT(GF("+CGNSPWR=1")); if (waitResponse() != 1) { return false; } + switch (startMode) { + case GPS_START_COLD: sendAT(GF("+CGPSRST="), 0); break; + case GPS_START_HOT: sendAT(GF("+CGPSRST="), 1); break; + case GPS_START_WARM: sendAT(GF("+CGPSRST="), 2); break; + default: return true; + } + if (waitResponse() != 1) { return false; } return true; }