diff --git a/src/web/WebAPIService.cpp b/src/web/WebAPIService.cpp index 64a3d2a09..226815238 100644 --- a/src/web/WebAPIService.cpp +++ b/src/web/WebAPIService.cpp @@ -105,7 +105,7 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject input) { } // capture current heap memory before allocating the large return buffer - emsesp::EMSESP::system_.refreshHeapMem(); + EMSESP::system_.refreshHeapMem(); // output json buffer auto response = new AsyncJsonResponse(); diff --git a/src/web/WebDataService.cpp b/src/web/WebDataService.cpp index 7311bfb6a..d48505331 100644 --- a/src/web/WebDataService.cpp +++ b/src/web/WebDataService.cpp @@ -182,7 +182,7 @@ void WebDataService::device_data(AsyncWebServerRequest * request) { for (const auto & emsdevice : EMSESP::emsdevices) { if (emsdevice->unique_id() == id) { // wait max 2.5 sec for updated data (post_send_delay is 2 sec) - for (uint16_t i = 0; i < (emsesp::TxService::POST_SEND_DELAY + 500) && EMSESP::wait_validate(); i++) { + for (uint16_t i = 0; i < (TxService::POST_SEND_DELAY + 500) && EMSESP::wait_validate(); i++) { delay(1); } EMSESP::wait_validate(0); // reset in case of timeout diff --git a/src/web/WebSchedulerService.cpp b/src/web/WebSchedulerService.cpp index bc69acfbe..479fd1c33 100644 --- a/src/web/WebSchedulerService.cpp +++ b/src/web/WebSchedulerService.cpp @@ -371,13 +371,13 @@ bool WebSchedulerService::command(const char * name, const std::string & command if (httpResult != 200) { char error[100]; snprintf(error, sizeof(error), "Schedule %s: URL command failed with http code %d", name, httpResult); - emsesp::EMSESP::logger().warning(error); + EMSESP::logger().warning(error); return false; } #if defined(EMSESP_DEBUG) char msg[100]; snprintf(msg, sizeof(msg), "Schedule %s: URL command successful with http code %d", name, httpResult); - emsesp::EMSESP::logger().debug(msg); + EMSESP::logger().debug(msg); #endif return true; } @@ -416,7 +416,7 @@ bool WebSchedulerService::command(const char * name, const std::string & command snprintf(error, sizeof(error), "Schedule %s: command %s failed with error %s", name, cmd.c_str(), Command::return_code_string(return_code)); } - emsesp::EMSESP::logger().warning(error); + EMSESP::logger().warning(error); return false; } @@ -439,14 +439,14 @@ void WebSchedulerService::condition() { if (scheduleItem.active && scheduleItem.flags == SCHEDULEFLAG_SCHEDULE_CONDITION) { auto match = compute(scheduleItem.time); #ifdef EMESESP_DEBUG - // emsesp::EMSESP::logger().debug("condition match: %s", match.c_str()); + // EMSESP::logger().debug("condition match: %s", match.c_str()); #endif if (match.length() == 1 && match[0] == '1' && scheduleItem.retry_cnt == 0xFF) { scheduleItem.retry_cnt = command(scheduleItem.name.c_str(), scheduleItem.cmd, compute(scheduleItem.value)) ? 1 : 0xFF; } else if (match.length() == 1 && match[0] == '0' && scheduleItem.retry_cnt == 1) { scheduleItem.retry_cnt = 0xFF; } else if (match.length() != 1) { // the match is not boolean - emsesp::EMSESP::logger().debug("condition result: %s", match.c_str()); + EMSESP::logger().debug("condition result: %s", match.c_str()); } } } diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp index 16efe4609..a00d55a8d 100644 --- a/src/web/WebStatusService.cpp +++ b/src/web/WebStatusService.cpp @@ -67,7 +67,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) { #ifndef EMSESP_STANDALONE uint8_t ntp_status = 0; // 0=disabled, 1=enabled, 2=connected if (esp_sntp_enabled()) { - ntp_status = (emsesp::EMSESP::system_.ntp_connected()) ? 2 : 1; + ntp_status = (EMSESP::system_.ntp_connected()) ? 2 : 1; } root["ntp_status"] = ntp_status; if (ntp_status == 2) { @@ -83,7 +83,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) { root["ap_status"] = EMSESP::esp32React.apStatus(); - if (emsesp::EMSESP::system_.ethernet_connected()) { + if (EMSESP::system_.ethernet_connected()) { root["network_status"] = 10; // custom code #10 - ETHERNET_STATUS_CONNECTED root["wifi_rssi"] = 0; } else { @@ -196,7 +196,7 @@ void WebStatusService::action(AsyncWebServerRequest * request, JsonVariant json) } else if (action == "systemStatus" && is_admin) { ok = setSystemStatus(param.c_str()); } else if (action == "resetMQTT" && is_admin) { - emsesp::EMSESP::mqtt_.reset_mqtt(); + EMSESP::mqtt_.reset_mqtt(); ok = true; } @@ -209,7 +209,7 @@ void WebStatusService::action(AsyncWebServerRequest * request, JsonVariant json) // check for error if (!ok) { - emsesp::EMSESP::logger().err("Action '%s' failed", action.c_str()); + EMSESP::logger().err("Action '%s' failed", action.c_str()); request->send(400); // bad request return; } @@ -233,7 +233,7 @@ bool WebStatusService::checkUpgrade(JsonObject root, std::string & versions) { #if defined(EMSESP_DEBUG) // look for dev in the name to determine if we're using a dev release bool using_dev_version = !current_version.prerelease().find("dev"); - emsesp::EMSESP::logger() + EMSESP::logger() .debug("Checking version upgrade. This version=%d.%d.%d-%s (%s),latest dev=%d.%d.%d-%s (%s upgradeable),latest stable=%d.%d.%d-%s (%s upgradeable)", current_version.major(), current_version.minor(), @@ -334,7 +334,7 @@ bool WebStatusService::getCustomSupport(JsonObject root) { if (!file) { // there is no custom file, return empty object #if defined(EMSESP_DEBUG) - emsesp::EMSESP::logger().debug("No custom support file found"); + EMSESP::logger().debug("No custom support file found"); #endif return true; } @@ -342,7 +342,7 @@ bool WebStatusService::getCustomSupport(JsonObject root) { // read the contents of the file into a json doc. We can't do this direct to object since 7.2.1 DeserializationError error = deserializeJson(doc, file); if (error) { - emsesp::EMSESP::logger().err("Failed to read custom support file"); + EMSESP::logger().err("Failed to read custom support file"); return false; } @@ -350,7 +350,7 @@ bool WebStatusService::getCustomSupport(JsonObject root) { #endif #if defined(EMSESP_DEBUG) - emsesp::EMSESP::logger().debug("Showing custom support page"); + EMSESP::logger().debug("Showing custom support page"); #endif root.set(doc.as()); // add to web response root object @@ -362,14 +362,14 @@ bool WebStatusService::getCustomSupport(JsonObject root) { // uploads a firmware file from a URL bool WebStatusService::uploadURL(const char * url) { // this will keep a copy of the URL, but won't initiate the download yet - emsesp::EMSESP::system_.uploadFirmwareURL(url); + EMSESP::system_.uploadFirmwareURL(url); return true; } // action = systemStatus // sets the system status bool WebStatusService::setSystemStatus(const char * status) { - emsesp::EMSESP::system_.systemStatus(Helpers::atoint(status)); + EMSESP::system_.systemStatus(Helpers::atoint(status)); return true; } diff --git a/test/test_api/test_api.cpp b/test/test_api/test_api.cpp index acc4563c5..7cc5da5e2 100644 --- a/test/test_api/test_api.cpp +++ b/test/test_api/test_api.cpp @@ -36,8 +36,8 @@ WebAPIService * webAPIService; EMSESP application; FS dummyFS; -std::shared_ptr shell; -char output_buffer[4096]; +std::shared_ptr shell; +char output_buffer[4096]; class TestStream : public Stream { public: