mqtt.h 669 Bytes
Newer Older
1
2
3
4
5
6
#ifndef MQTT_H_INCLUDED
#define MQTT_H_INCLUDED

#include <Arduino.h>
#include "config.h"
#include "led_effects.h"
Eric Duminil's avatar
Eric Duminil committed
7
#include "sensor_commands.h"
8
9
10
#ifdef AMPEL_CSV
#  include "csv_writer.h"
#endif
11
12
13
14
#include "co2_sensor.h"
#include "src/lib/PubSubClient/src/PubSubClient.h"
#include "wifi_util.h"
namespace config {
Eric Duminil's avatar
Eric Duminil committed
15
  extern uint16_t sending_interval; // [s]
16
17
18
}
namespace mqtt {
  extern String last_successful_publish;
19
  extern bool connected;
20
21
  void initialize(String &topic);
  void keepConnection();
Eric Duminil's avatar
Eric Duminil committed
22
  void publishIfTimeHasCome(const String &timeStamp, const int16_t &co2, const float &temp, const float &hum);
23
24

  void setMQTTinterval(int32_t sending_interval);
25
26
}
#endif