Catching CMS error on debug

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2020-06-22 17:13:24 -04:00
parent 1f1b56833a
commit 234a20e894
13 changed files with 123 additions and 78 deletions

View File

@@ -28,6 +28,7 @@ static const char GSM_OK[] TINY_GSM_PROGMEM = "OK" GSM_NL;
static const char GSM_ERROR[] TINY_GSM_PROGMEM = "ERROR" GSM_NL;
#if defined TINY_GSM_DEBUG
static const char GSM_CME_ERROR[] TINY_GSM_PROGMEM = GSM_NL "+CME ERROR:";
static const char GSM_CMS_ERROR[] TINY_GSM_PROGMEM = GSM_NL "+CMS ERROR:";
#endif
enum RegStatus {
@@ -611,10 +612,11 @@ class TinyGsmSequansMonarch
GsmConstStr r2 = GFP(GSM_ERROR),
#if defined TINY_GSM_DEBUG
GsmConstStr r3 = GFP(GSM_CME_ERROR),
GsmConstStr r4 = GFP(GSM_CMS_ERROR),
#else
GsmConstStr r3 = NULL,
GsmConstStr r3 = NULL, GsmConstStr r4 = NULL,
#endif
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) {
GsmConstStr r5 = NULL) {
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
@@ -689,10 +691,11 @@ class TinyGsmSequansMonarch
GsmConstStr r2 = GFP(GSM_ERROR),
#if defined TINY_GSM_DEBUG
GsmConstStr r3 = GFP(GSM_CME_ERROR),
GsmConstStr r4 = GFP(GSM_CMS_ERROR),
#else
GsmConstStr r3 = NULL,
GsmConstStr r3 = NULL, GsmConstStr r4 = NULL,
#endif
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) {
GsmConstStr r5 = NULL) {
String data;
return waitResponse(timeout_ms, data, r1, r2, r3, r4, r5);
}
@@ -701,10 +704,11 @@ class TinyGsmSequansMonarch
GsmConstStr r2 = GFP(GSM_ERROR),
#if defined TINY_GSM_DEBUG
GsmConstStr r3 = GFP(GSM_CME_ERROR),
GsmConstStr r4 = GFP(GSM_CMS_ERROR),
#else
GsmConstStr r3 = NULL,
GsmConstStr r3 = NULL, GsmConstStr r4 = NULL,
#endif
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) {
GsmConstStr r5 = NULL) {
return waitResponse(1000, r1, r2, r3, r4, r5);
}