experimental mqtt client supporting large packets

This commit is contained in:
proddy
2021-02-27 14:45:51 +01:00
parent 333c5c16c0
commit ce45374b54
28 changed files with 1358 additions and 1046 deletions

View File

@@ -35,4 +35,27 @@ class Helpers {
return bytesNeeded;
}
};
#if defined(ARDUINO_ARCH_ESP32)
#define SEMAPHORE_TAKE() xSemaphoreTake(_xSemaphore, portMAX_DELAY)
#define SEMAPHORE_GIVE() xSemaphoreGive(_xSemaphore)
#define GET_FREE_MEMORY() ESP.getMaxAllocHeap()
#include <esp32-hal-log.h>
#elif defined(ARDUINO_ARCH_ESP8266)
#define SEMAPHORE_TAKE(X) while (_xSemaphore) { /*ESP.wdtFeed();*/ } _xSemaphore = true
#define SEMAPHORE_GIVE() _xSemaphore = false
#define GET_FREE_MEMORY() ESP.getMaxFreeBlockSize()
#if defined(DEBUG_ESP_PORT) && defined(DEBUG_ASYNC_MQTT_CLIENT)
#define log_i(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n")
#define log_e(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n")
#define log_w(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n")
#else
#define log_i(...)
#define log_e(...)
#define log_w(...)
#endif
#else
#pragma error "No valid architecture"
#endif
} // namespace AsyncMqttClientInternals