We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Core Installation version: latest IDE name: Platform.io Computer OS: Windows 10
WebServer.on(...) function declaration now requires const Uri& uri. However the Uri object cannot be constructed directly from a flash string.
WebServer.on(...)
const Uri& uri
Uri
Adding an extra constructor does seem to solve it, but I can't see why as the constructor of String also can handle a __FlashStringHelper* as argument
__FlashStringHelper*
Uri(const __FlashStringHelper* uri) : _uri(String(uri)) {}
N.B. this way of calling WebServer.on used to work just fine.
WebServer.on
//Change the code below by your sketch web_server.on(F("/"), handle_root);
C:/GitHub/TD-er/ESPEasy/src/WebServer.ino: In function 'void WebServerInit()': C:/GitHub/TD-er/ESPEasy/src/WebServer.ino:180:36: error: no matching function for call to 'WebServer::on(const __FlashStringHelper*, void (&)())' web_server.on(F("/"), handle_root); ^ In file included from src\ESPEasy_fdwdecl.h:25:0, from src\ESPEasy-Globals.h:28, from C:/GitHub/TD-er/ESPEasy/src/ESPEasy.ino:92: C:/users/gijsn/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.h:88:8: note: candidate: void WebServer::on(const Uri&, WebServer::THandlerFunction) void on(const Uri &uri, THandlerFunction handler); ^ C:/users/gijsn/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.h:88:8: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'const Uri&' C:/users/gijsn/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.h:89:8: note: candidate: void WebServer::on(const Uri&, HTTPMethod, WebServer::THandlerFunction) void on(const Uri &uri, HTTPMethod method, THandlerFunction fn); ^ C:/users/gijsn/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.h:89:8: note: candidate expects 3 arguments, 2 provided C:/users/gijsn/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.h:90:8: note: candidate: void WebServer::on(const Uri&, HTTPMethod, WebServer::THandlerFunction, WebServer::THandlerFunction) void on(const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn); ^ C:/users/gijsn/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.h:90:8: note: candidate expects 4 arguments, 2 provided *** [.pio\build\custom_ESP32_4M316k_ETH\src\ESPEasy.ino.cpp.o] Error 1
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Hardware:
Core Installation version: latest
IDE name: Platform.io
Computer OS: Windows 10
Description:
WebServer.on(...)
function declaration now requiresconst Uri& uri
.However the
Uri
object cannot be constructed directly from a flash string.Adding an extra constructor does seem to solve it, but I can't see why as the constructor of String also can handle a
__FlashStringHelper*
as argumentN.B. this way of calling
WebServer.on
used to work just fine.Sketch: (leave the backquotes for code formatting)
Compiler output
The text was updated successfully, but these errors were encountered: