Skip to content

Commit

Permalink
remove unused variables and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
technyon committed Nov 24, 2024
1 parent b3dbb0f commit b29496c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
23 changes: 0 additions & 23 deletions src/WebCfgServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ WebCfgServer::WebCfgServer(NukiNetwork* network, Preferences* preferences, bool
memset(&_credUser, 0, sizeof(_credUser));
memset(&_credPassword, 0, sizeof(_credPassword));

_hasCredentials = true;
const char *user = str.c_str();
memcpy(&_credUser, user, str.length());

Expand Down Expand Up @@ -960,22 +959,6 @@ esp_err_t WebCfgServer::buildOtaHtml(PsychicRequest *request, bool debug)
return response.endSend();
}

esp_err_t WebCfgServer::buildOtaCompletedHtml(PsychicRequest *request)
{
PsychicStreamResponse response(request, "text/plain");
response.beginSend();
buildHtmlHeader(&response);

response.print("<div>Over-the-air update completed.<br>You will be forwarded automatically.</div>");
response.print("<script type=\"text/javascript\">");
response.print("window.addEventListener('load', function () {");
response.print(" setTimeout(\"location.href = '/';\",10000);");
response.print("});");
response.print("</script>");
response.print("</body></html>");
return response.endSend();
}

void WebCfgServer::buildHtmlHeader(PsychicStreamResponse *response, String additionalHeader)
{
response->print("<html><head>");
Expand Down Expand Up @@ -1004,11 +987,6 @@ void WebCfgServer::waitAndProcess(const bool blocking, const uint32_t duration)
}
}

void WebCfgServer::printProgress(size_t prg, size_t sz)
{
Log->printf("Progress: %d%%\n", (prg*100)/_otaContentLen);
}

esp_err_t WebCfgServer::handleOtaUpload(PsychicRequest *request, const String& filename, uint64_t index, uint8_t *data, size_t len, bool final)
{
if(!request->url().endsWith("/uploadota"))
Expand Down Expand Up @@ -1042,7 +1020,6 @@ esp_err_t WebCfgServer::handleOtaUpload(PsychicRequest *request, const String& f
return(ESP_FAIL);
}

_otaStartTs = espMillis();
esp_task_wdt_config_t twdt_config =
{
.timeout_ms = 30000,
Expand Down
7 changes: 1 addition & 6 deletions src/WebCfgServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,17 @@ class WebCfgServer
std::vector<int> _rssiList;
String generateConfirmCode();
String _confirmCode = "----";

esp_err_t buildSSIDListHtml(PsychicRequest *request);
esp_err_t buildConfirmHtml(PsychicRequest *request, const String &message, uint32_t redirectDelay = 5, bool redirect = false);
esp_err_t buildOtaHtml(PsychicRequest *request, bool debug = false);
esp_err_t buildOtaCompletedHtml(PsychicRequest *request);
esp_err_t sendCss(PsychicRequest *request);
esp_err_t sendFavicon(PsychicRequest *request);
void createSsidList();
void buildHtmlHeader(PsychicStreamResponse *response, String additionalHeader = "");
void waitAndProcess(const bool blocking, const uint32_t duration);
esp_err_t handleOtaUpload(PsychicRequest *request, const String& filename, uint64_t index, uint8_t *data, size_t len, bool final);
void printCheckBox(PsychicStreamResponse *response, const char* token, const char* description, const bool value, const char* htmlClass);
void printProgress(size_t prg, size_t sz);
#ifndef CONFIG_IDF_TARGET_ESP32H2
esp_err_t buildWifiConnectHtml(PsychicRequest *request);
bool processWiFi(PsychicRequest *request, String& message);
Expand All @@ -122,14 +121,10 @@ class WebCfgServer
NukiNetwork* _network = nullptr;
Preferences* _preferences = nullptr;

bool _hasCredentials = false;
char _credUser[31] = {0};
char _credPassword[31] = {0};
bool _allowRestartToPortal = false;
uint8_t _partitionType = 0;
uint32_t _transferredSize = 0;
int64_t _otaStartTs = 0;
size_t _otaContentLen = 0;
String _hostname;
bool _enabled = true;
};

0 comments on commit b29496c

Please sign in to comment.