Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to use ESP Async WebServer v3+ API #596

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions gbs-control.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9542,7 +9542,7 @@ void startWebserver()
//Serial.print("got serial request params: ");
//Serial.println(params);
if (params > 0) {
AsyncWebParameter *p = request->getParam(0);
const AsyncWebParameter *p = request->getParam((size_t) 0);
//Serial.println(p->name());
serialCommand = p->name().charAt(0);

Expand All @@ -9561,7 +9561,7 @@ void startWebserver()
//Serial.print("got user request params: ");
//Serial.println(params);
if (params > 0) {
AsyncWebParameter *p = request->getParam(0);
const AsyncWebParameter *p = request->getParam((size_t) 0);
//Serial.println(p->name());
userCommand = p->name().charAt(0);
}
Expand Down Expand Up @@ -9623,7 +9623,7 @@ void startWebserver()
int params = request->params();

if (params > 0) {
AsyncWebParameter *slotParam = request->getParam(0);
const AsyncWebParameter *slotParam = request->getParam((size_t) 0);
String slotParamValue = slotParam->value();
char slotValue[2];
slotParamValue.toCharArray(slotValue, sizeof(slotValue));
Expand Down Expand Up @@ -9670,15 +9670,15 @@ void startWebserver()
}

// index param
AsyncWebParameter *slotIndexParam = request->getParam(0);
const AsyncWebParameter *slotIndexParam = request->getParam((size_t) 0);
String slotIndexString = slotIndexParam->value();
uint8_t slotIndex = lowByte(slotIndexString.toInt());
if (slotIndex >= SLOTS_TOTAL) {
goto fail;
}

// name param
AsyncWebParameter *slotNameParam = request->getParam(1);
const AsyncWebParameter *slotNameParam = request->getParam((size_t) 1);
String slotName = slotNameParam->value();

char emptySlotName[25] = " ";
Expand Down Expand Up @@ -9708,7 +9708,7 @@ void startWebserver()
server.on("/slot/remove", HTTP_GET, [](AsyncWebServerRequest *request) {
bool result = false;
int params = request->params();
AsyncWebParameter *p = request->getParam(0);
const AsyncWebParameter *p = request->getParam((size_t) 0);
char param = p->name().charAt(0);
if (params > 0)
{
Expand Down Expand Up @@ -9803,7 +9803,7 @@ void startWebserver()
if (ESP.getFreeHeap() > 10000) {
int params = request->params();
if (params > 0) {
request->send(SPIFFS, request->getParam(0)->value(), String(), true);
request->send(SPIFFS, request->getParam((size_t) 0)->value(), String(), true);
} else {
request->send(200, "application/json", "false");
}
Expand Down
17 changes: 11 additions & 6 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
lib_dir = ./src/
src_dir = ./

[env:d1_mini]
platform = [email protected]
board = d1_mini
[env]
platform = [email protected]
framework = arduino
board_build.f_cpu = 160000000L
board_build.ldscript = eagle.flash.4m1m.ld
upload_speed = 921600
monitor_speed = 115200
lib_deps =
me-no-dev/ESPAsyncTCP@^1.2.2
me-no-dev/ESP Async WebServer@^1.2.3
ESP32Async/ESPAsyncTCP@^2.0.0
ESP32Async/ESPAsyncWebServer@^3.6.2
thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 [email protected]
bluemurder/ESP8266-ping@^2.0.1
;r-downing/PersWiFiManager@^3.0.1
Expand All @@ -30,4 +29,10 @@ build_src_filter =
+<**/*.c>
+<**/*.cpp>
+<**/*.ino>
-<./3rdparty/*>
-<./3rdparty/*>

[env:d1_mini]
board = d1_mini

[env:esp12e]
board = esp12e