From 981453d399a00db8019b58a4976d071cb812a86c Mon Sep 17 00:00:00 2001 From: Gregor Baues Date: Fri, 14 May 2021 10:53:52 +0200 Subject: [PATCH] State and define.h changed --- DccMQTT.h | 5 +++-- defines.h | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/DccMQTT.h b/DccMQTT.h index 371d3a1..8600877 100644 --- a/DccMQTT.h +++ b/DccMQTT.h @@ -101,8 +101,9 @@ typedef struct csmqttclient_t { enum DccMQTTState { INIT, - CONFIGURED, // server/client objects set - CONNECTED // mqtt broker is connected + CONFIGURED, // server/client objects set + CONNECTED, // mqtt broker is connected + CONNECTION_FAILED // Impossible to get the connection set after MAXRECONNECT tries }; class DccMQTT diff --git a/defines.h b/defines.h index 4d8bce0..d1a2446 100644 --- a/defines.h +++ b/defines.h @@ -38,12 +38,9 @@ #define ETHERNET_ON false #endif -// MQTT is on only if the ethernet is enabled -#if ENABLE_MQTT && ETHERNET_ON +// MQTT handles ethernet on it's own +#if ENABLE_MQTT && (defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_SAMD_ZERO) || defined(TEENSYDUINO)) #define MQTT_ON true -#else - #define MQTT_ON false - #warning MQTT requires Ethernet to be enabled. #endif // #if WIFI_ON && ETHERNET_ON