diff --git a/code/espurna/libs/SyncClientWrap.h b/code/espurna/libs/SyncClientWrap.h index c22d27f9..b252eaf5 100644 --- a/code/espurna/libs/SyncClientWrap.h +++ b/code/espurna/libs/SyncClientWrap.h @@ -9,13 +9,29 @@ Temporary wrap to fix https://github.com/me-no-dev/ESPAsyncTCP/issues/109 #include +// ref Core 2.5.0: cores/esp8266/IPAddress.h +#ifndef CONST +#include + +#if LWIP_VERSION_MAJOR == 1 +#define CONST +#else +#define CONST const +#endif + +#endif + class SyncClientWrap: public SyncClient { public: + SyncClientWrap() {} + ~SyncClientWrap() {} + + // int connect(const char*, uint16_t); + using SyncClient::connect; - int connect(const char *host, uint16_t port); - int connect(CONST IPAddress& ip, uint16_t port) { return connect(ip, port); } - bool flush(unsigned int maxWaitMs = 0) { flush(); return true; } - bool stop(unsigned int maxWaitMs = 0) { stop(); return true; } + int connect(CONST IPAddress& ip, uint16_t port) { IPAddress _ip(ip); return SyncClient::connect(_ip, port); } + bool flush(unsigned int maxWaitMs = 0) { SyncClient::flush(); return true; } + bool stop(unsigned int maxWaitMs = 0) { SyncClient::stop(); return true; } };