-
Notifications
You must be signed in to change notification settings - Fork 0
/
light_energy_management_system.proto
65 lines (54 loc) · 1.1 KB
/
light_energy_management_system.proto
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
syntax = "proto3";
package light_energy_management_system;
enum MqttCommand {
UnknownCommand = 0;
HandleDataPacket = 1;
GetAllDevices = 2;
GetDeviceMeasurements = 3;
GetDeviceMeasurementsBefore = 4;
GetDeviceMeasurementsAfter = 5;
ChangeDeviceName = 6;
}
message MqttPayload {
MqttCommand command = 1;
repeated bytes msg = 2;
}
enum DeviceType {
UnknownDevice = 0;
LampController = 1;
}
message Device {
string name = 1;
string mac = 2;
DeviceType type = 3;
}
message Devices {
repeated Device devices = 1;
}
enum MeasurementType {
UnknownMeasurment = 0;
Illuminance = 1;
Voltage = 2;
Current = 3;
Power = 4;
Energy = 5;
Frequency = 6;
PowerFactor = 7;
}
enum MeasurementStatus {
Invalid = 0;
Valid = 1;
}
message Measurement {
float value = 1;
MeasurementType type = 2;
MeasurementStatus status = 3;
}
message DeviceMeasurements {
uint64 timestamp = 1;
repeated Measurement measurements = 2;
}
message DataPacket {
Device device = 1;
repeated DeviceMeasurements device_measurements = 2;
}