diff --git a/src/AsyncMqttClient.cpp b/src/AsyncMqttClient.cpp index 9ef5975..46784f6 100644 --- a/src/AsyncMqttClient.cpp +++ b/src/AsyncMqttClient.cpp @@ -134,6 +134,7 @@ AsyncMqttClient& AsyncMqttClient::setServer(const char* serviceName, const char* _serviceName = serviceName; _protocol = protocol; +#ifdef ESP32 // std::cout << "host name: " << hostName << std::endl; if (_hostName != "") { if (MDNS.begin(_hostName)) { // Nome do host do ESP32 @@ -146,6 +147,9 @@ AsyncMqttClient& AsyncMqttClient::setServer(const char* serviceName, const char* } } } +#else + return *this; +#endif } AsyncMqttClient& AsyncMqttClient::setHostName(const char* hostName) { diff --git a/src/AsyncMqttClient.hpp b/src/AsyncMqttClient.hpp index 02322e7..02c7eaf 100644 --- a/src/AsyncMqttClient.hpp +++ b/src/AsyncMqttClient.hpp @@ -15,13 +15,13 @@ #include #include #include +#include +#include #elif defined(ESP8266) #include -#include #else #error Platform not supported #endif -#include #if ASYNC_TCP_SSL_ENABLED #include @@ -106,8 +106,9 @@ class AsyncMqttClient { uint32_t _lastClientActivity; uint32_t _lastServerActivity; uint32_t _lastPingRequestTime; +#ifdef ESP32 Preferences preferences; - +#endif char _generatedClientId[18 + 1]; // esp8266-abc123 and esp32-abcdef123456 IPAddress _ip; const char* _host;