From af60126a40cbe28778636df90d1ddaad0666baeb Mon Sep 17 00:00:00 2001 From: Bertrand Lemasle Date: Wed, 21 Nov 2018 18:35:14 +1300 Subject: [PATCH] Serial cannot be detected, so alert SMS were never sent. --- src/Core.cpp | 13 ++++--------- src/config/Alerts.h | 7 ++++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Core.cpp b/src/Core.cpp index 0a56745..965bbde 100644 --- a/src/Core.cpp +++ b/src/Core.cpp @@ -88,16 +88,11 @@ namespace core { details::appendToSmsBuffer(buffer, PSTR("\n- RTC was stopped.%S"), backupFailureString); } -#if ALERTS_ON_SERIAL_IF_AVAILABLE - if(Serial) { - NOTICE_FORMAT("notifyFailure", "%s", buffer); - notified = true; - } - else { -#endif +#if ALERTS_ON_SERIAL + NOTICE_FORMAT("notifyFailure", "%s", buffer); + notified = true; +#else notified = network::sendSms(buffer); -#if ALERTS_ON_SERIAL_IF_AVAILABLE - } #endif if (!notified) NOTICE_MSG("notifyFailure", "SMS not sent !"); } diff --git a/src/config/Alerts.h b/src/config/Alerts.h index b2122de..61247f8 100644 --- a/src/config/Alerts.h +++ b/src/config/Alerts.h @@ -18,15 +18,16 @@ /** - \def ALERTS_ON_SERIAL_IF_AVAILABLE + \def ALERTS_ON_SERIAL Display alerts on serial when connected rather than sending an SMS. Useful for debugging purpose and avoid costs related to SMS sending. */ -#define ALERTS_ON_SERIAL_IF_AVAILABLE 1 +#define ALERTS_ON_SERIAL _DEBUG + /** \def ALERT_SUSPICIOUS_RTC_TEMPERATURE Temperature at which to consider the RTC module as failling. When the backup battery is dead or nearly dead, the reading of the temperature fails and returns 0. */ -#define ALERT_SUSPICIOUS_RTC_TEMPERATURE 0 \ No newline at end of file +#define ALERT_SUSPICIOUS_RTC_TEMPERATURE 0 \ No newline at end of file