forked from D3R-ST3FAN/LaCrosseGatewayMQTT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaCrosse.h
More file actions
39 lines (30 loc) · 877 Bytes
/
Copy pathLaCrosse.h
File metadata and controls
39 lines (30 loc) · 877 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
34
35
36
37
38
#ifndef _LACROSSE_h
#define _LACROSSE_h
#include "Arduino.h"
#include "SensorBase.h"
class LaCrosse : public SensorBase {
public:
struct Frame {
byte Header;
byte ID;
bool NewBatteryFlag;
bool Bit12;
float Temperature;
bool WeakBatteryFlag;
byte Humidity;
byte CRC;
bool IsValid;
};
static const byte FRAME_LENGTH = 5;
static bool USE_OLD_ID_CALCULATION;
static byte CalculateCRC(byte data[]);
static void EncodeFrame(struct LaCrosse::Frame *frame, byte bytes[5]);
static void DecodeFrame(byte *bytes, struct LaCrosse::Frame *frame);
static String AnalyzeFrame(byte *data);
static bool TryHandleData(byte *data);
static String GetFhemDataString(byte *data);
static bool IsValidDataRate(unsigned long dataRate);
static String BuildFhemDataString(struct LaCrosse::Frame *frame);
protected:
};
#endif