forked from D3R-ST3FAN/LaCrosseGatewayMQTT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevelSenderLib.h
More file actions
34 lines (27 loc) · 784 Bytes
/
Copy pathLevelSenderLib.h
File metadata and controls
34 lines (27 loc) · 784 Bytes
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
#ifndef _LEVELSENDERLIB_h
#define _LEVELSENDERLIB_h
#include "Arduino.h"
#include "SensorBase.h"
class LevelSenderLib : public SensorBase {
public:
struct Frame {
byte Header;
byte ID;
float Level;
float Temperature;
float Voltage;
byte CRC;
bool IsValid;
};
static byte CalculateCRC(byte data[]);
static const byte FRAME_LENGTH = 6;
static void EncodeFrame(struct Frame *frame, byte *bytes);
static void DecodeFrame(byte *data, struct Frame *frame);
static String AnalyzeFrame(byte *data);
static bool TryHandleData(byte *data);
static String GetFhemDataString(byte *data);
static bool IsValidDataRate(unsigned long dataRate);
protected:
static String BuildFhemDataString(struct LevelSenderLib::Frame *frame);
};
#endif