replace IPAddress with MQTT library one

This commit is contained in:
proddy
2024-06-04 21:19:34 +02:00
parent d63bab5982
commit 26ac0057a5
6 changed files with 24 additions and 24 deletions

View File

@@ -48,7 +48,7 @@ extern "C" {
//If core is not defined, then we are running in Arduino or PIO
#ifndef CONFIG_ASYNC_TCP_RUNNING_CORE
#define CONFIG_ASYNC_TCP_RUNNING_CORE -1 //any available core
// Note default was 1 and previously set to 0 for EMS-ESP32
// Note default was 1 and previously set to 0 for EMS-ESP
#define CONFIG_ASYNC_TCP_USE_WDT 1 //if enabled, adds between 33us and 200us per event
#endif
@@ -56,13 +56,13 @@ extern "C" {
#define CONFIG_ASYNC_TCP_TASK_PRIORITY 5
#endif
// EMS-ESP32: stack usage measured: ESP32: ~2.3K, ESP32S3: ~3.5k
// EMS-ESP: stack usage measured: ESP32: ~2.3K, ESP32S3: ~3.5k
#ifndef CONFIG_ASYNC_TCP_STACK_SIZE
#define CONFIG_ASYNC_TCP_STACK_SIZE 5120
#endif
// EMS-ESP32: maybe enlarge queue to 64 or 128 see https://github.com/emsesp/EMS-ESP32/issues/177
// EMS-ESP: maybe enlarge queue to 64 or 128 see https://github.com/emsesp/EMS-ESP32/issues/177
#ifndef CONFIG_ASYNC_TCP_QUEUE
#define CONFIG_ASYNC_TCP_QUEUE 32
#endif

View File

@@ -28,7 +28,7 @@
#include <vector>
#include "FS.h"
#include <ArduinoJson.h> // added by proddy
#include <ArduinoJson.h> // added by proddy for EMS-ESP
#include "StringArray.h"
@@ -330,7 +330,7 @@ class AsyncWebServerRequest {
AsyncWebServerResponse * beginResponse_P(int code, const String & contentType, const uint8_t * content, size_t len, AwsTemplateProcessor callback = nullptr);
AsyncWebServerResponse * beginResponse_P(int code, const String & contentType, PGM_P content, AwsTemplateProcessor callback = nullptr);
// added by proddy
// added by proddy for EMS-ESP
AsyncWebServerResponse * beginResponse(const String & contentType, const uint8_t * content, size_t len);
size_t headers() const; // get header count
@@ -532,7 +532,7 @@ typedef std::function<void(AsyncWebServerRequest * request)> ArRequestHandlerFun
typedef std::function<void(AsyncWebServerRequest * request, const String & filename, size_t index, uint8_t * data, size_t len, bool final)> ArUploadHandlerFunction;
typedef std::function<void(AsyncWebServerRequest * request, uint8_t * data, size_t len, size_t index, size_t total)> ArBodyHandlerFunction;
typedef std::function<void(AsyncWebServerRequest * request, JsonVariant json)> ArJsonRequestHandlerFunction; // added by proddy
typedef std::function<void(AsyncWebServerRequest * request, JsonVariant json)> ArJsonRequestHandlerFunction; // added by proddy for EMS-ESP
class AsyncWebServer {
protected:
@@ -566,7 +566,7 @@ class AsyncWebServer {
AsyncCallbackWebHandler &
on(const char * uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest, ArUploadHandlerFunction onUpload, ArBodyHandlerFunction onBody);
void on(const char * uri, ArJsonRequestHandlerFunction onRequest); // added by proddy
void on(const char * uri, ArJsonRequestHandlerFunction onRequest); // added by proddy for EMS-ESP
AsyncStaticWebHandler & serveStatic(const char * uri, fs::FS & fs, const char * path, const char * cache_control = NULL);

View File

@@ -175,7 +175,7 @@ AsyncCallbackWebHandler & AsyncWebServer::on(const char * uri, ArRequestHandlerF
return *handler;
}
// added by proddy
// added by proddy for EMS-ESP
void AsyncWebServer::on(const char * uri, ArJsonRequestHandlerFunction onRequest) {
auto * handler = new AsyncCallbackJsonWebHandler(uri, onRequest);
addHandler(handler);

View File

@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// compare_flash_string added by Proddy
// compare_flash_string added by Proddy for EMS-ESP
#ifndef UUID_COMMON_H_
#define UUID_COMMON_H_

View File

@@ -64,7 +64,7 @@ namespace uuid {
* - <a href="https://mcu-uuid-log.readthedocs.io/">Documentation</a>
*/
// ANSI Colors - added by Proddy
// ANSI Colors - added by Proddy for EMS-ESP
// See https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html
#define COLOR_RESET "\x1B[0m"
#define COLOR_BLACK "\x1B[0;30m"

View File

@@ -213,7 +213,7 @@ class AsyncWebServerResponse {
typedef std::function<void(AsyncWebServerRequest * request)> ArRequestHandlerFunction;
typedef std::function<void(AsyncWebServerRequest * request, const String & filename, size_t index, uint8_t * data, size_t len, bool final)> ArUploadHandlerFunction;
typedef std::function<void(AsyncWebServerRequest * request, uint8_t * data, size_t len, size_t index, size_t total)> ArBodyHandlerFunction;
typedef std::function<void(AsyncWebServerRequest * request, JsonVariant json)> ArJsonRequestHandlerFunction; // added by proddy
typedef std::function<void(AsyncWebServerRequest * request, JsonVariant json)> ArJsonRequestHandlerFunction; // added by proddy for EMS-ESP
class AsyncWebServer {
protected:
@@ -233,7 +233,7 @@ class AsyncWebServer {
}
void on(const char * uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest) {};
void on(const char * uri, ArJsonRequestHandlerFunction onRequest){}; // added by proddy
void on(const char * uri, ArJsonRequestHandlerFunction onRequest) {}; // added by proddy for EMS-ESP
};