2021-05-09 18:45:59 +00:00
|
|
|
#ifndef MQTT_H_INCLUDED
|
|
|
|
#define MQTT_H_INCLUDED
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
#include "config.h"
|
|
|
|
#include "led_effects.h"
|
2021-11-15 12:45:36 +00:00
|
|
|
#include "sensor_console.h"
|
2021-05-09 18:45:59 +00:00
|
|
|
#include "src/lib/PubSubClient/src/PubSubClient.h"
|
|
|
|
#include "wifi_util.h"
|
2021-11-15 12:45:36 +00:00
|
|
|
|
2021-05-09 18:45:59 +00:00
|
|
|
namespace config {
|
2021-11-15 12:45:36 +00:00
|
|
|
extern uint16_t mqtt_sending_interval; // [s]
|
2021-05-09 18:45:59 +00:00
|
|
|
}
|
2021-11-15 12:45:36 +00:00
|
|
|
|
2021-05-09 18:45:59 +00:00
|
|
|
namespace mqtt {
|
2021-11-15 12:45:36 +00:00
|
|
|
extern char last_successful_publish[];
|
2021-05-09 18:45:59 +00:00
|
|
|
extern bool connected;
|
2021-11-15 12:45:36 +00:00
|
|
|
void initialize(const char *sensorId);
|
2021-05-09 18:45:59 +00:00
|
|
|
void keepConnection();
|
2021-11-15 12:45:36 +00:00
|
|
|
void publishIfTimeHasCome(const char *timestamp, const int16_t &co2, const float &temp, const float &hum);
|
|
|
|
|
|
|
|
void setMQTTinterval(int32_t sending_interval);
|
|
|
|
void sendInfoAboutLocalNetwork();
|
2021-05-09 18:45:59 +00:00
|
|
|
}
|
|
|
|
#endif
|