Fix CCID for SIM800, fixes #336

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2020-04-15 09:16:56 -04:00
parent e47e3e3879
commit 335c2e8e63
5 changed files with 17 additions and 5 deletions

View File

@@ -392,7 +392,19 @@ class TinyGsmSim800 : public TinyGsmModem<TinyGsmSim800>,
* SIM card functions
*/
protected:
// Able to follow all SIM card functions as inherited from the template
// May not return the "+CCID" before the number
String getSimCCIDImpl() {
sendAT(GF("+CCID"));
if (waitResponse(GF(GSM_NL)) != 1) {
return "";
}
String res = stream.readStringUntil('\n');
waitResponse();
// Trim out the CCID header in case it is there
res.replace("CCID:", "");
res.trim();
return res;
}
/*
* Phone Call functions