From f06781bc031856cb6dd8ba49c67f68406d2a985a Mon Sep 17 00:00:00 2001 From: david gauchard Date: Wed, 2 Feb 2022 11:19:43 +0100 Subject: [PATCH 1/3] minor fixes for emulation on host (https://github.com/d-a-v/emuAsync) --- src/ESPUI.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ESPUI.cpp b/src/ESPUI.cpp index 90ddbb4..dd55063 100644 --- a/src/ESPUI.cpp +++ b/src/ESPUI.cpp @@ -783,9 +783,9 @@ void ESPUIClass::updateControl(Control* control, int clientId) root["id"] = control->id; root["visible"] = control->visible; root["color"] = (int)control->color; - if (control->panelStyle != 0) + if (control->panelStyle.length()) root["panelStyle"] = control->panelStyle; - if (control->elementStyle != 0) + if (control->elementStyle.length()) root["elementStyle"] = control->elementStyle; serializeJson(document, json); @@ -811,7 +811,7 @@ void ESPUIClass::updateControl(Control* control, int clientId) // function like this and it's clients array is private int tryId = 0; - for (size_t count = 0; count < this->ws->count();) + for (size_t count = 0; tryId < (int)this->ws->count() && count < this->ws->count();) { if (this->ws->hasClient(tryId)) { @@ -1003,7 +1003,7 @@ void ESPUIClass::addGraphPoint(uint16_t id, int nValue, int clientId) // function like this and it's clients array is private int tryId = 0; - for (size_t count = 0; count < this->ws->count();) + for (size_t count = 0; tryId < (int)this->ws->count() && count < this->ws->count();) { if (this->ws->hasClient(tryId)) { @@ -1108,9 +1108,9 @@ void ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, uint16_t startin item["value"] = String(control->value); item["color"] = (int)control->color; item["visible"] = (int)control->visible; - if (control->panelStyle != 0) + if (control->panelStyle.length()) item["panelStyle"] = String(control->panelStyle); - if (control->elementStyle != 0) + if (control->elementStyle.length()) item["elementStyle"] = String(control->elementStyle); if (control->wide == true) item["wide"] = true; From c131a6ad1cb1019dd040bd6bbb91239b06a78ccf Mon Sep 17 00:00:00 2001 From: david gauchard Date: Wed, 2 Feb 2022 16:47:43 +0100 Subject: [PATCH 2/3] +doc --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index a9620ac..1564a74 100644 --- a/README.md +++ b/README.md @@ -564,6 +564,17 @@ If you change something in HTML/CSS/JS and want to create a pull request, please do include the minified versions and corresponding C header files in your commits. (Do **NOT** commit all the minified versions for the non changed files) +# Experimental note for Development: + +It is possible to run or debug this library on a unix-like computer (Linux, +macOS, WSL) without flashing on hardware, and with your favourite debugging +tools (gdb, valgrind, ...). This is accomplished through the +esp8266/Arduino "emulation on host" environment. + +A fake AsyncWebserver library is needed because lwIP is not yet ported to +the emulation environment. Full instructions can be found in this project's +[readme page](https://github.com/d-a-v/emuAsync). + ## Changelog for 2.1: - Adds the ability to have inline styles for widgets and panels From 271fd9dd02d5779f3a69ce1e44a073b67f73265b Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sat, 5 Feb 2022 17:46:42 +0100 Subject: [PATCH 3/3] doc: change title (review) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1564a74..098a2ae 100644 --- a/README.md +++ b/README.md @@ -564,7 +564,7 @@ If you change something in HTML/CSS/JS and want to create a pull request, please do include the minified versions and corresponding C header files in your commits. (Do **NOT** commit all the minified versions for the non changed files) -# Experimental note for Development: +# Experimental debugging environment using emulation on host It is possible to run or debug this library on a unix-like computer (Linux, macOS, WSL) without flashing on hardware, and with your favourite debugging