mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-28 17:49:08 +03:00
start syslog when network connected
This commit is contained in:
29
src/system.h
29
src/system.h
@@ -66,6 +66,9 @@ class System {
|
||||
void show_mem(const char * note);
|
||||
void get_settings();
|
||||
void wifi_tweak();
|
||||
void syslog_start();
|
||||
bool check_upgrade();
|
||||
void send_heartbeat();
|
||||
|
||||
void led_init(bool refresh);
|
||||
void syslog_init(bool refresh);
|
||||
@@ -75,12 +78,8 @@ class System {
|
||||
void commands_init();
|
||||
|
||||
static bool is_valid_gpio(uint8_t pin);
|
||||
|
||||
static bool load_board_profile(std::vector<uint8_t> & data, const std::string & board_profile);
|
||||
|
||||
bool check_upgrade();
|
||||
void send_heartbeat();
|
||||
|
||||
std::string hostname() {
|
||||
return hostname_;
|
||||
}
|
||||
@@ -97,6 +96,14 @@ class System {
|
||||
ethernet_connected_ = b;
|
||||
}
|
||||
|
||||
bool network_connected() {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
return (ethernet_connected_ || WiFi.isConnected());
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
static uint32_t heap_start_;
|
||||
@@ -133,16 +140,16 @@ class System {
|
||||
void wifi_reconnect();
|
||||
int8_t wifi_quality();
|
||||
|
||||
bool system_healthy_ = false;
|
||||
uint32_t led_flash_speed_ = LED_WARNING_BLINK_FAST; // default boot flashes quickly
|
||||
uint32_t last_heartbeat_ = 0;
|
||||
uint32_t last_system_check_ = 0;
|
||||
bool upload_status_ = false; // true if we're in the middle of a OTA firmware upload
|
||||
bool ethernet_connected_;
|
||||
bool system_healthy_ = false;
|
||||
uint32_t led_flash_speed_ = LED_WARNING_BLINK_FAST; // default boot flashes quickly
|
||||
uint32_t last_heartbeat_ = 0;
|
||||
uint32_t last_system_check_ = 0;
|
||||
bool upload_status_ = false; // true if we're in the middle of a OTA firmware upload
|
||||
bool ethernet_connected_ = false;
|
||||
uint16_t analog_;
|
||||
|
||||
// settings
|
||||
std::string hostname_;
|
||||
std::string hostname_ = "ems-esp";
|
||||
bool hide_led_;
|
||||
uint8_t led_gpio_;
|
||||
bool syslog_enabled_;
|
||||
|
||||
Reference in New Issue
Block a user