restructerd projekt
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
#ifndef DEBUG_MQTT_H
|
||||
#define DEBUG_MQTT_H
|
||||
|
||||
#include <PubSubClient.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
enum Loglevel { none,
|
||||
error,
|
||||
warn,
|
||||
info,
|
||||
debug,
|
||||
influx};
|
||||
|
||||
class DebugMqtt {
|
||||
public:
|
||||
DebugMqtt(const char* name);
|
||||
void sendMsg(Loglevel loglevel, String topic, String msg);
|
||||
void sendMsg(Loglevel loglevel, String msg);
|
||||
void sendData(Loglevel loglevel, String topic, String data);
|
||||
void sendData(Loglevel loglevel, String data);
|
||||
void writeToInflux(String measurement_name, String field_set, float measurement);
|
||||
|
||||
void sendTime();
|
||||
|
||||
static void init(PubSubClient *client, Loglevel loglevel);
|
||||
static void changeLoglevel(Loglevel loglevel);
|
||||
static void initRealMillis();
|
||||
static unsigned long long int getUpdatedRealMillis();
|
||||
|
||||
private:
|
||||
const char* name;
|
||||
|
||||
static String enum_to_string(Loglevel loglevel);
|
||||
|
||||
static PubSubClient* client;
|
||||
static Loglevel loglevel;
|
||||
static bool isInit;
|
||||
static char msg[MQTT_BUFFER_SITE];
|
||||
static char topic[MQTT_BUFFER_SITE];
|
||||
|
||||
static unsigned long long int real_millis;
|
||||
static unsigned long int last_millis;
|
||||
|
||||
};
|
||||
|
||||
#endif // DEBUG_MQTT_H
|
||||
Reference in New Issue
Block a user