Переглянути джерело

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

tags/v1.2.2
Bertrand Lemasle 6 роки тому
джерело
коміт
af60126a40
2 змінених файлів з 8 додано та 12 видалено
  1. +4
    -9
      src/Core.cpp
  2. +4
    -3
      src/config/Alerts.h

+ 4
- 9
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 !");
}


+ 4
- 3
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
#define ALERT_SUSPICIOUS_RTC_TEMPERATURE 0

||||||
x
 
000:0
Завантаження…
Відмінити
Зберегти