Skip to content

Commit

Permalink
change async libs
Browse files Browse the repository at this point in the history
  • Loading branch information
LoQue90 committed Dec 23, 2024
1 parent 1bd4e2a commit 7253989
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
16 changes: 13 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ platform = espressif32 @^6.5.0
board = az-delivery-devkit-v4
board_build.filesystem = littlefs
board_build.partitions = partitions_4M.csv

build_flags =
-D CONFIG_ASYNC_TCP_MAX_ACK_TIME=5000
-D CONFIG_ASYNC_TCP_PRIORITY=10
-D CONFIG_ASYNC_TCP_QUEUE_SIZE=64
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1
-D CONFIG_ASYNC_TCP_STACK_SIZE=4096
-std=gnu++17
build_unflags = -std=gnu++11

build_unflags =
-std=gnu++11

framework = arduino
monitor_speed = 115200
check_tool = clangtidy
Expand All @@ -24,9 +33,10 @@ lib_deps =
git+https://github.com/rancilio-pid/Arduino-PID-Library#d6d3c69
knolleary/PubSubClient @ 2.8.0
bblanchon/ArduinoJson @ 6.21.4
git+https://github.com/esphome/AsyncTCP @ 2.1.4
git+https://github.com/esphome/ESPAsyncWebServer @ 3.3.0
mathieucarbou/AsyncTCP @ ^3.3.1
mathieucarbou/ESPAsyncWebServer @ 3.4.5
git+https://github.com/tzapu/WiFiManager @ 2.0.17

extra_scripts =
pre:auto_firmware_version.py
pre:run_clangformat.py
Expand Down
8 changes: 5 additions & 3 deletions src/embeddedWebserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void serverSetup() {
// update all given params and match var name in editableVars

for (int i = 0; i < requestParams; i++) {
AsyncWebParameter* p = request->getParam(i);
const AsyncWebParameter* p = request->getParam(i);
String varName;

if (p->name().startsWith("var")) {
Expand Down Expand Up @@ -372,7 +372,8 @@ void serverSetup() {
else if (request->method() == 1) { // WebRequestMethod enum -> HTTP_GET
// get parameter id from first parameter, e.g. /parameters?param=PID_ON
int paramCount = request->params();
String paramId = paramCount > 0 ? request->getParam(0)->value() : "";
const AsyncWebParameter* param = request->getParam(static_cast<size_t>(0));
String paramId = paramCount > 0 && param != nullptr ? param->value() : "";

std::map<String, editable_t>::iterator it;

Expand Down Expand Up @@ -407,7 +408,8 @@ void serverSetup() {

server.on("/parameterHelp", HTTP_GET, [](AsyncWebServerRequest* request) {
DynamicJsonDocument doc(1024);
AsyncWebParameter* p = request->getParam(0);
const AsyncWebParameter* p = request->getParam(static_cast<size_t>(0));


if (p == NULL) {
request->send(422, "text/plain", "parameter is missing");
Expand Down

0 comments on commit 7253989

Please sign in to comment.