-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSensors.h
48 lines (39 loc) · 1.07 KB
/
Sensors.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
#pragma once
namespace AW {
struct TSensorValue {
StringBuf Name;
double Value;
};
struct TSensorSource {
StringBuf Name;
TTime Updated;
};
template <size_t Count> struct TSensor : TSensorSource {
TSensorValue Values[Count];
};
struct TEventSensorData : TBasicEvent<TEventSensorData> {
constexpr static TEventID EventID = 6; // TODO
const TSensorSource& Source;
const TSensorValue& Value;
TEventSensorData(const TSensorSource& source, const TSensorValue& value)
: Source(source)
, Value(value) {}
};
struct TEventSensorMessage : TBasicEvent<TEventSensorMessage> {
constexpr static TEventID EventID = 7; // TODO
const TSensorSource& Source;
String Message;
TEventSensorMessage(const TSensorSource& source, const String& message)
: Source(source)
, Message(message) {}
};
}
#include "SensorMemory.h"
#include "SensorEnergy.h"
#include "SensorVoltage.h"
#include "SensorBMP280.h"
#include "SensorBME280.h"
#include "SensorINA219.h"
#include "SensorAM2320.h"
#include "SensorCT.h"
#include "SensorCounter.h"