From 49b696315c8aade9df9559e8e347f1efe5bacec3 Mon Sep 17 00:00:00 2001 From: hsaturn Date: Wed, 28 Dec 2022 19:30:16 +0100 Subject: [PATCH] Fix TINY_MQTT_DEBUG compilation --- src/TinyMqtt.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/TinyMqtt.h b/src/TinyMqtt.h index c9efee2..8980d9b 100644 --- a/src/TinyMqtt.h +++ b/src/TinyMqtt.h @@ -1,6 +1,9 @@ // vim: ts=2 sw=2 expandtab #pragma once + +#ifndef TINY_MQTT_DEBUG #define TINY_MQTT_DEBUG 0 +#endif // 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 @@ -39,7 +42,7 @@ #include #if TINY_MQTT_DEBUG -include // https://github.com/hsaturn/TinyConsole + #include // https://github.com/hsaturn/TinyConsole struct TinyMqtt { static int debug; @@ -162,7 +165,6 @@ class MqttMessage class MqttBroker; class MqttClient { - using CallBack = void (*)(const MqttClient* source, const Topic& topic, const char* payload, size_t payload_length); enum __attribute__((packed)) Flags { FlagUserName = 128, @@ -174,6 +176,9 @@ class MqttClient FlagReserved = 1 }; public: + + using CallBack = void (*)(const MqttClient* source, const Topic& topic, const char* payload, size_t payload_length); + /** Constructor. Broker is the adress of a local broker if not null If you want to connect elsewhere, leave broker null and use connect() **/ MqttClient(MqttBroker* broker = nullptr, const std::string& id = TINY_MQTT_DEFAULT_CLIENT_ID);