File tree Expand file tree Collapse file tree 2 files changed +23
-23
lines changed Expand file tree Collapse file tree 2 files changed +23
-23
lines changed Original file line number Diff line number Diff line change 1
1
*InterdeviceMessage.nmea max_size:1024
2
+ *InterdeviceMessage.beep int_size:16
Original file line number Diff line number Diff line change @@ -8,37 +8,36 @@ option java_outer_classname = "InterdeviceProtos";
8
8
option java_package = "com.geeksville.mesh" ;
9
9
option swift_prefix = "" ;
10
10
11
- // encapsulate up to 1k of NMEA string data
12
-
13
- enum MessageType {
14
- ACK = 0 ;
15
- COLLECT_INTERVAL = 160 ; // in ms
16
- BEEP_ON = 161 ; // duration ms
17
- BEEP_OFF = 162 ; // cancel prematurely
18
- SHUTDOWN = 163 ;
19
- POWER_ON = 164 ;
20
- SCD41_TEMP = 176 ;
21
- SCD41_HUMIDITY = 177 ;
22
- SCD41_CO2 = 178 ;
23
- AHT20_TEMP = 179 ;
24
- AHT20_HUMIDITY = 180 ;
25
- TVOC_INDEX = 181 ;
11
+ message I2CCommand {
12
+ enum Operation {
13
+ START = 0 ;
14
+ STOP = 1 ;
15
+ WRITE = 2 ;
16
+ READ = 3 ;
17
+ }
18
+ Operation op = 1 ;
19
+ uint32 addr = 2 ;
20
+ uint32 data = 3 ;
21
+ bool ack = 4 ;
26
22
}
27
23
28
- message SensorData {
29
- // The message type
30
- MessageType type = 1 ;
31
- // The sensor data, either as a float or an uint32
32
- oneof data {
33
- float float_value = 2 ;
34
- uint32 uint32_value = 3 ;
24
+ message I2CResponse {
25
+ enum Status {
26
+ OK = 0 ;
27
+ NACK = 1 ;
28
+ ERROR = 2 ;
35
29
}
30
+ Status status = 1 ;
31
+ uint32 data = 2 ;
36
32
}
37
33
34
+ // Main message for interdevice communication
38
35
message InterdeviceMessage {
39
36
// The message data
40
37
oneof data {
41
38
string nmea = 1 ;
42
- SensorData sensor = 2 ;
39
+ I2CCommand i2c_command = 2 ;
40
+ I2CResponse i2c_response = 3 ;
41
+ uint32 beep = 4 ;
43
42
}
44
43
}
You can’t perform that action at this time.
0 commit comments