8#include <PubSubClient.h>
13#include <EthernetUdp.h>
17#define MQTT_TASK_PRIORITY 2
20#define MQTT_HANDLE_MESSAGE_TASK_COREID 1
23#define MQTT_TASK_STACK_DEPTH 3072
27#define MQTT_INCOMING_QUEUE_LENGTH 100
31#define MQTT_OUTGOING_QUEUE_LENGTH 1000
33#define MQTT_UNINITIALIZED -10
98 static void (*
handler)(
const char *message);
101 static char _subscriberName[60];
102 static bool _setupCompleted;
105 static unsigned long lastPing;
108 static void mqttCallback(
char *topic,
byte *payload,
unsigned int length);
114 static void sendMessage(
char *topic,
const char *message);
119 static void reconnect();
125 static void taskLoop(
void *parm);
WiFiClient wifiSubscriberClient
Definition MattzoMQTTSubscriber.cpp:6
PubSubClient mqttSubscriberClient
Definition MattzoMQTTSubscriber.cpp:9
Class used to publish messages to an MQTT broker.
Definition MattzoMQTTSubscriber.h:42
static uint16_t MaxBufferSize
The maximum message size, including header, specified as the number of bytes. Messages larger than th...
Definition MattzoMQTTSubscriber.h:82
static void Loop()
Definition MattzoMQTTSubscriber.cpp:121
static uint32_t StackDepth
The size of the task stack specified as the number of bytes.
Definition MattzoMQTTSubscriber.h:76
static int GetStatus()
Definition MattzoMQTTSubscriber.cpp:45
static int ReconnectDelayInMilliseconds
Reconnect delay in milliseconds. This configures the delay between reconnect attempts.
Definition MattzoMQTTSubscriber.h:52
static QueueHandle_t IncomingQueue
Definition MattzoMQTTSubscriber.h:47
static uint8_t TaskPriority
The priority at which the task should run. Systems that include MPU support can optionally create tas...
Definition MattzoMQTTSubscriber.h:64
static int8_t CoreID
If the value is tskNO_AFFINITY, the created task is not pinned to any CPU, and the scheduler can run ...
Definition MattzoMQTTSubscriber.h:71
static void Setup(MCMQTTConfiguration *config, void(*MQTThandler)(const char *message))
Setup the MQTT Subscriber.
Definition MattzoMQTTSubscriber.cpp:10
static int HandleMessageDelayInMilliseconds
Send message delay in milliseconds. This configures the delay between send message attempts.
Definition MattzoMQTTSubscriber.h:57
static void(* handler)(const char *message)
Definition MattzoMQTTSubscriber.h:98
Definition MCMQTTConfiguration.h:3