mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 02:34:29 +05:00
fix: compatibility with framework-arduinoespressif32 version 3.0.5
This commit is contained in:
@@ -33,22 +33,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
bool canHandle(WebServer &server, HTTPMethod method, const String uri) override {
|
bool canHandle(WebServer &server, HTTPMethod method, const String &uri) override {
|
||||||
return this->canHandle(method, uri);
|
return this->canHandle(method, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool canHandle(HTTPMethod method, const String uri) override {
|
|
||||||
#else
|
|
||||||
bool canHandle(HTTPMethod method, const String& uri) override {
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool canHandle(HTTPMethod method, const String& uri) override {
|
||||||
return uri.equals(this->uri) && (!this->canHandleCallback || this->canHandleCallback(method, uri));
|
return uri.equals(this->uri) && (!this->canHandleCallback || this->canHandleCallback(method, uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
|
||||||
bool handle(WebServer& server, HTTPMethod method, const String uri) override {
|
|
||||||
#else
|
|
||||||
bool handle(WebServer& server, HTTPMethod method, const String& uri) override {
|
bool handle(WebServer& server, HTTPMethod method, const String& uri) override {
|
||||||
#endif
|
|
||||||
if (!this->canHandle(method, uri)) {
|
if (!this->canHandle(method, uri)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,22 +28,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
bool canHandle(WebServer &server, HTTPMethod method, const String uri) override {
|
bool canHandle(WebServer &server, HTTPMethod method, const String &uri) override {
|
||||||
return this->canHandle(method, uri);
|
return this->canHandle(method, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool canHandle(HTTPMethod method, const String uri) override {
|
|
||||||
#else
|
|
||||||
bool canHandle(HTTPMethod method, const String& uri) override {
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool canHandle(HTTPMethod method, const String& uri) override {
|
||||||
return method == HTTP_GET && uri.equals(this->uri) && (!this->canHandleCallback || this->canHandleCallback(method, uri));
|
return method == HTTP_GET && uri.equals(this->uri) && (!this->canHandleCallback || this->canHandleCallback(method, uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
|
||||||
bool handle(WebServer& server, HTTPMethod method, const String uri) override {
|
|
||||||
#else
|
|
||||||
bool handle(WebServer& server, HTTPMethod method, const String& uri) override {
|
bool handle(WebServer& server, HTTPMethod method, const String& uri) override {
|
||||||
#endif
|
|
||||||
if (!this->canHandle(method, uri)) {
|
if (!this->canHandle(method, uri)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,34 +58,26 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
bool canHandle(WebServer &server, HTTPMethod method, const String uri) override {
|
bool canHandle(WebServer &server, HTTPMethod method, const String &uri) override {
|
||||||
return this->canHandle(method, uri);
|
return this->canHandle(method, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool canHandle(HTTPMethod method, const String uri) override {
|
|
||||||
#else
|
|
||||||
bool canHandle(HTTPMethod method, const String& uri) override {
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool canHandle(HTTPMethod method, const String& uri) override {
|
||||||
return method == HTTP_POST && uri.equals(this->uri) && (!this->canHandleCallback || this->canHandleCallback(method, uri));
|
return method == HTTP_POST && uri.equals(this->uri) && (!this->canHandleCallback || this->canHandleCallback(method, uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
bool canUpload(WebServer &server, const String uri) override {
|
bool canUpload(WebServer &server, const String &uri) override {
|
||||||
return this->canUpload(uri);
|
return this->canUpload(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool canUpload(const String uri) override {
|
|
||||||
#else
|
|
||||||
bool canUpload(const String& uri) override {
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool canUpload(const String& uri) override {
|
||||||
return uri.equals(this->uri) && (!this->canUploadCallback || this->canUploadCallback(uri));
|
return uri.equals(this->uri) && (!this->canUploadCallback || this->canUploadCallback(uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
|
||||||
bool handle(WebServer& server, HTTPMethod method, const String uri) override {
|
|
||||||
#else
|
|
||||||
bool handle(WebServer& server, HTTPMethod method, const String& uri) override {
|
bool handle(WebServer& server, HTTPMethod method, const String& uri) override {
|
||||||
#endif
|
|
||||||
if (this->afterUpgradeCallback) {
|
if (this->afterUpgradeCallback) {
|
||||||
this->afterUpgradeCallback(this->firmwareResult, this->filesystemResult);
|
this->afterUpgradeCallback(this->firmwareResult, this->filesystemResult);
|
||||||
}
|
}
|
||||||
@@ -99,11 +91,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
|
||||||
void upload(WebServer& server, const String uri, HTTPUpload& upload) override {
|
|
||||||
#else
|
|
||||||
void upload(WebServer& server, const String& uri, HTTPUpload& upload) override {
|
void upload(WebServer& server, const String& uri, HTTPUpload& upload) override {
|
||||||
#endif
|
|
||||||
UpgradeResult* result;
|
UpgradeResult* result;
|
||||||
if (upload.name.equals("firmware")) {
|
if (upload.name.equals("firmware")) {
|
||||||
result = &this->firmwareResult;
|
result = &this->firmwareResult;
|
||||||
|
|||||||
Reference in New Issue
Block a user