-
Notifications
You must be signed in to change notification settings - Fork 1
/
Publisher.h
49 lines (41 loc) · 1.09 KB
/
Publisher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef __PUBLISHER__h
#define __PUBLISHER__h
#include "Arduino.h"
#include "WiFiClient.h"
#include "IPAddress.h"
#include "Settings.h"
#include "SensorData.h"
#include "StateManager.h"
#include "DataPort.h"
#include "BME280.h"
#define NR_OF_BARS 32
class Publisher {
public:
void Begin(Settings *settings, DataPort *dataPort, BME280 *bme280);
void Publish(SensorData *sensorData);
private:
String m_dummyPrefix;
String m_dummySuffix;
Settings *m_settings;
String m_readings;
uint16_t m_nbrOfReadings;
SensorData *m_sensorData;
DataPort *m_dataPort;
BME280 *m_bme280;
void SendToDataPort();
void AddReading(String name, String value);
void AddReading(String name, uint32_t value);
void AddReading(String name, int32_t value);
void AddReading(String name, float value);
void AddCommonReadings();
void AddCompactReadings();
void AddBinsCountReadings();
void AddBinsMagReadings();
void AddBinGroupsReadings();
void AddBinMagAVGReading();
void AddBinMagAVGkorrReading();
void AddBinMagAVGkorrThreshReading();
void AddGroupMagCalReading();
void Transmit();
};
#endif