Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
790 B

  1. /*
  2. SyncClientWrap
  3. Temporary wrap to fix https://github.com/me-no-dev/ESPAsyncTCP/issues/109
  4. */
  5. #pragma once
  6. #include <SyncClient.h>
  7. // ref Core 2.5.0: cores/esp8266/IPAddress.h
  8. #ifndef CONST
  9. #include <lwip/init.h>
  10. #if LWIP_VERSION_MAJOR == 1
  11. #define CONST
  12. #else
  13. #define CONST const
  14. #endif
  15. #endif
  16. class SyncClientWrap: public SyncClient {
  17. public:
  18. SyncClientWrap() {}
  19. ~SyncClientWrap() {}
  20. // int connect(const char*, uint16_t);
  21. using SyncClient::connect;
  22. int connect(CONST IPAddress& ip, uint16_t port) { IPAddress _ip(ip); return SyncClient::connect(_ip, port); }
  23. bool flush(unsigned int maxWaitMs = 0) { SyncClient::flush(); return true; }
  24. bool stop(unsigned int maxWaitMs = 0) { SyncClient::stop(); return true; }
  25. };