added duplicate console to mqtt

This commit is contained in:
2022-02-14 19:31:24 +01:00
parent 6cacea2df3
commit 3a2e51713b
19 changed files with 262 additions and 166 deletions
+10 -2
View File
@@ -11,6 +11,7 @@
#ifndef DEBUG_MQTT_H
#define DEBUG_MQTT_H
#include <iostream>
#include <PubSubClient.h>
/**
@@ -71,6 +72,8 @@ class DebugMqtt {
*/
DebugMqtt(const char* name);
~DebugMqtt();
/**
* @brief Send a Message via MQTT
*
@@ -120,6 +123,8 @@ class DebugMqtt {
*/
void writeToInflux(String measurement_name, String field_set, float measurement, uint64_t nanos);
void addCharacter(char c);
/**
* @brief Initalize debugMQTT for all instances
*
@@ -133,7 +138,7 @@ class DebugMqtt {
* @param client PubSubClient
* @param max_loglevel Max loglevel to send.
*/
static void init(PubSubClient *client, Loglevel max_loglevel);
static void init(PubSubClient* client, Loglevel max_loglevel);
/**
* @brief Change loglevel
@@ -146,6 +151,9 @@ class DebugMqtt {
private:
const char* name;
char* buf;
uint8_t bufPos = 0;
uint8_t bufSitze = 100;
static String enum_to_string(Loglevel loglevel);
@@ -156,4 +164,4 @@ class DebugMqtt {
static char topic[MQTT_BUFFER_SIZE];
};
#endif // DEBUG_MQTT_H
#endif // DEBUG_MQTT_H