diff --git a/src/TinyMqtt.cpp b/src/TinyMqtt.cpp index d13fd28..939528f 100644 --- a/src/TinyMqtt.cpp +++ b/src/TinyMqtt.cpp @@ -550,7 +550,7 @@ void MqttClient::processMessage(MqttMessage* mesg) { MqttMessage msg(MqttMessage::Type::ConnAck); msg.add(0); // Session present (not implemented) - msg.add(0); // Connection accepted + msg.add(0); // Connection accepted msg.sendTo(this); } break; diff --git a/src/TinyMqtt.h b/src/TinyMqtt.h index dc78a2c..131e5dc 100644 --- a/src/TinyMqtt.h +++ b/src/TinyMqtt.h @@ -8,7 +8,10 @@ // TODO Should add a AUnit with both TINY_MQTT_ASYNC and not TINY_MQTT_ASYNC // #define TINY_MQTT_ASYNC // Uncomment this to use ESPAsyncTCP instead of normal cnx -#if defined(ESP8266) || defined(EPOXY_DUINO) + +#if defined(TINY_MQTT_ETHERNET) + #include +#elif defined(ESP8266) || defined(EPOXY_DUINO) #ifdef TINY_MQTT_ASYNC #include #else @@ -20,7 +23,7 @@ #include // https://github.com/me-no-dev/AsyncTCP #endif #elif defined(ARDUINO_ARCH_RP2040) - #include + #include // works with Raspberry Pi Pico W, earlephilhower #endif #ifdef EPOXY_DUINO #define dbg_ptr uint64_t @@ -55,12 +58,17 @@ #define debug(what) {} #endif -#ifdef TINY_MQTT_ASYNC - using TcpClient = AsyncClient; - using TcpServer = AsyncServer; +#if defined(TINY_MQTT_ETHERNET) + using TcpClient = EthernetClient; + using TcpServer = EthernetServer; #else - using TcpClient = WiFiClient; - using TcpServer = WiFiServer; + #ifdef TINY_MQTT_ASYNC + using TcpClient = AsyncClient; + using TcpServer = AsyncServer; + #else + using TcpClient = WiFiClient; + using TcpServer = WiFiServer; + #endif #endif enum __attribute__((packed)) MqttError