Tweaks to SIM7000

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2020-02-12 18:57:51 -05:00
parent 899c1d8233
commit fe323288c4
2 changed files with 18 additions and 5 deletions

View File

@@ -168,7 +168,14 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
// Enable Local Time Stamp for getting network time // Enable Local Time Stamp for getting network time
sendAT(GF("+CLTS=1")); sendAT(GF("+CLTS=1"));
if (waitResponse(10000L) != 1) { return false; } if (waitResponse(10000L) != 1) { return false;
}
// Enable battery checks
sendAT(GF("+CBATCHK=1"));
if (waitResponse() != 1) {
return false;
}
int ret = getSimStatus(); int ret = getSimStatus();
// if the sim isn't ready and a pin has been provided, try to unlock the sim // if the sim isn't ready and a pin has been provided, try to unlock the sim
@@ -209,8 +216,9 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
sendAT(GF("+CFUN=0")); sendAT(GF("+CFUN=0"));
if (waitResponse(10000L) != 1) { return false; } if (waitResponse(10000L) != 1) { return false; }
sendAT(GF("+CFUN=1,1")); sendAT(GF("+CFUN=1,1"));
if (waitResponse(10000L) != 1) { return false; } if (waitResponse(10000L) != 1) { return false;
delay(3000); // TODO(SRGDamia1): Test this delay }
waitResponse(60000L, GF("SMS Ready"));
return init(); return init();
} }
@@ -233,7 +241,7 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
*/ */
public: public:
RegStatus getRegistrationStatus() { RegStatus getRegistrationStatus() {
return (RegStatus)getRegistrationStatusXREG("CGREG"); return (RegStatus)getRegistrationStatusXREG("CEREG");
} }
protected: protected:

View File

@@ -170,7 +170,12 @@ class TinyGsmSim800
// Enable Local Time Stamp for getting network time // Enable Local Time Stamp for getting network time
sendAT(GF("+CLTS=1")); sendAT(GF("+CLTS=1"));
if (waitResponse(10000L) != 1) { return false; } if (waitResponse(10000L) != 1) { return false;
}
// Enable battery checks
sendAT(GF("+CBATCHK=1"));
waitResponse();
int ret = getSimStatus(); int ret = getSimStatus();
// if the sim isn't ready and a pin has been provided, try to unlock the sim // if the sim isn't ready and a pin has been provided, try to unlock the sim