Browse Source

Serial cannot be detected, so alert SMS were never sent.

tags/v1.2.2
Bertrand Lemasle 6 years ago
parent
commit
af60126a40
2 changed files with 8 additions and 12 deletions
  1. +4
    -9
      src/Core.cpp
  2. +4
    -3
      src/config/Alerts.h

+ 4
- 9
src/Core.cpp View File

@@ -88,16 +88,11 @@ namespace core {
details::appendToSmsBuffer(buffer, PSTR("\n- RTC was stopped.%S"), backupFailureString); 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); notified = network::sendSms(buffer);
#if ALERTS_ON_SERIAL_IF_AVAILABLE
}
#endif #endif
if (!notified) NOTICE_MSG("notifyFailure", "SMS not sent !"); if (!notified) NOTICE_MSG("notifyFailure", "SMS not sent !");
} }


+ 4
- 3
src/config/Alerts.h View File

@@ -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. Display alerts on serial when connected rather than sending an SMS.
Useful for debugging purpose and avoid costs related to SMS sending. 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 \def ALERT_SUSPICIOUS_RTC_TEMPERATURE
Temperature at which to consider the RTC module as failling. Temperature at which to consider the RTC module as failling.
When the backup battery is dead or nearly dead, the reading When the backup battery is dead or nearly dead, the reading
of the temperature fails and returns 0. of the temperature fails and returns 0.
*/ */
#define ALERT_SUSPICIOUS_RTC_TEMPERATURE 0
#define ALERT_SUSPICIOUS_RTC_TEMPERATURE 0

Loading…
Cancel
Save