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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/// Data type of a digital input
pub const LPP_DIGITAL_INPUT: u8 = 0; // 1 byte
/// Data type of a digital output
pub const LPP_DIGITAL_OUTPUT: u8 = 1; // 1 byte
/// Data type of an analog input
pub const LPP_ANALOG_INPUT: u8 = 2; // 2 bytes, 0.01 signed
/// Data type of an analog output
pub const LPP_ANALOG_OUTPUT: u8 = 3; // 2 bytes, 0.01 signed
/// Data type of a generic sensor
pub const LPP_GENERIC_SENSOR: u8 = 100; // 4 bytes, unsigned
/// Data type of a luminosity value
pub const LPP_LUMINOSITY: u8 = 101; // 2 bytes, 1 lux unsigned
/// Data type of a presence sensor
pub const LPP_PRESENCE: u8 = 102; // 1 byte, 1
/// Data type of a temperature value
pub const LPP_TEMPERATURE: u8 = 103; // 2 bytes, 0.1°C signed
/// Data type of a relative humidity value
pub const LPP_RELATIVE_HUMIDITY: u8 = 104; // 1 byte, 0.5% unsigned
/// Data type of accelerometer values
pub const LPP_ACCELEROMETER: u8 = 113; // 2 bytes per axis, 0.001G
/// Data type of a barometric pressure value
pub const LPP_BAROMETRIC_PRESSURE: u8 = 115; // 2 bytes 0.1 hPa Unsigned
/// Data type of a voltage value
pub const LPP_VOLTAGE: u8 = 116; // 2 bytes 0.01V unsigned
/// Data type of a current value
pub const LPP_CURRENT: u8 = 117; // 2 bytes 1mA unsigned
/// Data type of a frequency value
pub const LPP_FREQUENCY: u8 = 118; // 4 bytes 1hz unsigned
/// Data type of a percentage
pub const LPP_PERCENTAGE: u8 = 120; // 1 byte 1-100% unsigned
/// Data type of an altitude
pub const LPP_ALTITUDE: u8 = 121; // 2 byte 1m signed
/// Data type of a concentration
pub const LPP_CONCENTRATION: u8 = 125; // 2 bytes, 1ppm unsigned
/// Data type of a power value
pub const LPP_POWER: u8 = 128; // 2 bytes 1W unsigned
/// Data type of a distance value
pub const LPP_DISTANCE: u8 = 130; // 4 bytes, 0.001m unsigned
/// Data type of an energy value
pub const LPP_ENERGY: u8 = 131; // 4 bytes, 1Wh, unsigned
/// Data type of a direction value
pub const LPP_DIRECTION: u8 = 132; // 2 bytes, 1 deg, unsigned
/// Data type of a time (unix timestamp)
pub const LPP_UNIXTIME: u8 = 133; // 4 bytes, unsigned
/// Data type of gyrometer values
pub const LPP_GYROMETER: u8 = 134; // 2 bytes per axis, 0.01 °/s
/// Data type of a color value
pub const LPP_COLOR: u8 = 135; // 1 byte per RGB color
/// Data type of GPS value
pub const LPP_GPS: u8 = 136; // 3 byte lon/lat 0.0001 °, 3 bytes alt 0.01 meter
/// Data type of switch value
pub const LPP_SWITCH: u8 = 142; // 1 byte 0/1
// Data ID + Data Type + Data Size
/// Size of a digital input packet including channel and data type
pub const LPP_DIGITAL_INPUT_SIZE: usize = 3; // 1 byte
/// Size of a digital output packet including channel and data type
pub const LPP_DIGITAL_OUTPUT_SIZE: usize = 3; // 1 byte
/// Size of an analog input packet including channel and data type
pub const LPP_ANALOG_INPUT_SIZE: usize = 4; // 2 bytes, 0.01 signed
/// Size of an analog output packet including channel and data type
pub const LPP_ANALOG_OUTPUT_SIZE: usize = 4; // 2 bytes, 0.01 signed
/// Size of a generic sensor packet including channel and data type
pub const LPP_GENERIC_SENSOR_SIZE: usize = 6; // 4 bytes, unsigned
/// Size of a luminosity packet including channel and data type
pub const LPP_LUMINOSITY_SIZE: usize = 4; // 2 bytes, 1 lux unsigned
/// Size of a presence sensor packet including channel and data type
pub const LPP_PRESENCE_SIZE: usize = 3; // 1 byte, 1
/// Size of a temperature packet including channel and data type
pub const LPP_TEMPERATURE_SIZE: usize = 4; // 2 bytes, 0.1°C signed
/// Size of a relative humidity packet including channel and data type
pub const LPP_RELATIVE_HUMIDITY_SIZE: usize = 3; // 1 byte, 0.5% unsigned
/// Size of an accelerometer packet including channel and data type
pub const LPP_ACCELEROMETER_SIZE: usize = 8; // 2 bytes per axis, 0.001G
/// Size of a barometric pressure packet including channel and data type
pub const LPP_BAROMETRIC_PRESSURE_SIZE: usize = 4; // 2 bytes 0.1 hPa unsigned
/// Size of a voltage packet including channel and data type
pub const LPP_VOLTAGE_SIZE: usize = 4; // 2 bytes 0.01V unsigned
/// Size of a current packet including channel and data type
pub const LPP_CURRENT_SIZE: usize = 4; // 2 bytes 1mA unsigned
/// Size of a frequency packet including channel and data type
pub const LPP_FREQUENCY_SIZE: usize = 6; // 4 bytes, 1hz unsigned
/// Size of an percentage packet including channel and data type
pub const LPP_PERCENTAGE_SIZE: usize = 3; // 1 bytes, 0-100% unsigned
/// Size of an altitude packet including channel and data type
pub const LPP_ALTITUDE_SIZE: usize = 4; // 2 bytes, 1M signed
/// Size of a concentration packet including channel and data type
pub const LPP_CONCENTRATION_SIZE: usize = 4; // 2 bytes, 1ppm unsigned
/// Size of a power packet including channel and data type
pub const LPP_POWER_SIZE: usize = 4; // 2 bytes, 1W unsigned
/// Size of a distance packet including channel and data type
pub const LPP_DISTANCE_SIZE: usize = 6; // 4 bytes, 1mm unsigned
/// Size of an energy packet including channel and data type
pub const LPP_ENERGY_SIZE: usize = 6; // 4 bytes, 1Wh unsigned
/// Size of a direction packet including channel and data type
pub const LPP_DIRECTION_SIZE: usize = 4; // 2 bytes, 1deg, unsigned
/// Size of a unix time packet including channel and data type
pub const LPP_UNIXTIME_SIZE: usize = 6; // 4 bytes, unsigned
/// Size of a gyrometer packet including channel and data type
pub const LPP_GYROMETER_SIZE: usize = 8; // 2 bytes per axis, 0.01 °/s
/// Size of a color packet including channel and data type
pub const LPP_COLOR_SIZE: usize = 5; // 1 bytes per color, RGB order
/// Size of a GPS packet including channel and data type
pub const LPP_GPS_SIZE: usize = 11; // 3 byte lon/lat 0.0001 °, 3 bytes alt 0.01 meter
/// Size of a switch packet including channel and data type
pub const LPP_SWITCH_SIZE: usize = 3; // 1 byte 0/1