Skip to content

Commit

Permalink
make it compile standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Jun 6, 2022
1 parent cf4818f commit 64a7108
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/command.cpp
Expand Up @@ -276,7 +276,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
}
}

// call the function baesed on type
// call the function based on type
if (cf->cmdfunction_json_) {
return_code = ((cf->cmdfunction_json_)(value, id, output)) ? CommandRet::OK : CommandRet::ERROR;
}
Expand Down
4 changes: 3 additions & 1 deletion src/system.h
Expand Up @@ -81,13 +81,15 @@ class System {
return syslog_enabled_;
}

#ifndef EMSESP_STANDALONE
unsigned long syslog_count() {
return syslog_.message_count();
}

unsigned long syslog_fails() {
return syslog_.message_fails();
}
#endif

void led_init(bool refresh);
void network_init(bool refresh);
Expand Down Expand Up @@ -189,7 +191,7 @@ class System {
#ifndef EMSESP_STANDALONE
return (ethernet_connected() || WiFi.isConnected());
#else
return true;
return true;
#endif
}

Expand Down
2 changes: 2 additions & 0 deletions src/web/WebStatusService.cpp
Expand Up @@ -187,6 +187,7 @@ void WebStatusService::webStatusService(AsyncWebServerRequest * request) {
statJson["q"] =
WebAPIService::api_count() == 0 ? 100 : 100 - (uint8_t)((100 * WebAPIService::api_fails()) / (WebAPIService::api_count() + WebAPIService::api_fails()));

#ifndef EMSESP_STANDALONE
if (EMSESP::system_.syslog_enabled()) {
statJson = statsJson.createNestedObject();
statJson["id"] = "Syslog Messages";
Expand All @@ -196,6 +197,7 @@ void WebStatusService::webStatusService(AsyncWebServerRequest * request) {
? 100
: 100 - (uint8_t)((100 * EMSESP::system_.syslog_fails()) / (EMSESP::system_.syslog_count() + EMSESP::system_.syslog_fails()));
}
#endif

response->setLength();
request->send(response);
Expand Down

0 comments on commit 64a7108

Please sign in to comment.