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_
@@ -102,8 +102,8 @@ void loop();
*/
uint64_t get_uptime_ms();
uint32_t get_uptime();
uint32_t get_uptime_sec();
uint32_t get_uptime();
uint32_t get_uptime_sec();
void set_uptime();

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

@@ -92,18 +92,18 @@ class AsyncWebServerRequest {
_method = method_s;
}
void addInterestingHeader(const String & name){};
void addInterestingHeader(const String & name) {};
size_t args() const {
return 0;
}
void send(AsyncWebServerResponse * response){};
void send(AsyncJsonResponse * response){};
void send(PrettyAsyncJsonResponse * response){};
void send(MsgpackAsyncJsonResponse * response){};
void send(int code, const String & contentType = String(), const String & content = String()){};
void send(int code, const String & contentType, const __FlashStringHelper *){};
void send(AsyncWebServerResponse * response) {};
void send(AsyncJsonResponse * response) {};
void send(PrettyAsyncJsonResponse * response) {};
void send(MsgpackAsyncJsonResponse * response) {};
void send(int code, const String & contentType = String(), const String & content = String()) {};
void send(int code, const String & contentType, const __FlashStringHelper *) {};
const String & url() const {
return _url;
@@ -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:
@@ -225,15 +225,15 @@ class AsyncWebServer {
~AsyncWebServer(){};
void begin(){};
void begin() {};
void end();
AsyncWebHandler & addHandler(AsyncWebHandler * handler) {
return *handler;
}
void on(const char * uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest){};
void on(const char * uri, ArJsonRequestHandlerFunction onRequest){}; // added by proddy
void on(const char * uri, WebRequestMethodComposite method, ArRequestHandlerFunction onRequest) {};
void on(const char * uri, ArJsonRequestHandlerFunction onRequest) {}; // added by proddy for EMS-ESP
};
@@ -246,7 +246,7 @@ class AsyncEventSource : public AsyncWebHandler {
return 1;
}
void send(const char * message, const char * event = NULL, uint32_t id = 0, uint32_t reconnect = 0){};
void send(const char * message, const char * event = NULL, uint32_t id = 0, uint32_t reconnect = 0) {};
};