Skip to content

Commit

Permalink
Fix TINY_MQTT_DEBUG compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
hsaturn committed Dec 28, 2022
1 parent a9ebf31 commit 49b6963
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/TinyMqtt.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -39,7 +42,7 @@

#include <TinyStreaming.h>
#if TINY_MQTT_DEBUG
include <TinyConsole.h> // https://github.com/hsaturn/TinyConsole
#include <TinyConsole.h> // https://github.com/hsaturn/TinyConsole
struct TinyMqtt
{
static int debug;
Expand Down Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit 49b6963

Please sign in to comment.