diff --git a/lib/uuid-syslog/src/syslog.cpp b/lib/uuid-syslog/src/syslog.cpp index 25f35b45c..88f0f961d 100644 --- a/lib/uuid-syslog/src/syslog.cpp +++ b/lib/uuid-syslog/src/syslog.cpp @@ -19,14 +19,10 @@ #include "uuid/syslog.h" #include -#ifdef ARDUINO_ARCH_ESP8266 -#include -#else #include -#endif #include -#include +#include "../../../src/emsesp.h" #ifndef UUID_SYSLOG_HAVE_GETTIMEOFDAY #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) @@ -194,7 +190,7 @@ SyslogService::QueuedLogMessage::QueuedLogMessage(unsigned long id, std::shared_ : id_(id) , content_(std::move(content)) { // Added by proddy - check for Ethernet too. This assumes the network has already started. - if (time_good_ || WiFi.status() == WL_CONNECTED || ETH.linkUp()) { + if (time_good_ || emsesp::EMSESP::system_.network_connected()) { #if UUID_SYSLOG_HAVE_GETTIMEOFDAY if (gettimeofday(&time_, nullptr) != 0) { time_.tv_sec = (time_t)-1; @@ -272,10 +268,8 @@ bool SyslogService::can_transmit() { } #endif - if (WiFi.status() != WL_CONNECTED) { - if (!ETH.linkUp()) { - return false; // added by proddy. Check Ethernet - } + if (!emsesp::EMSESP::system_.network_connected()) { + return false; // added by proddy. Check Ethernet } const uint64_t now = uuid::get_uptime_ms();