Skip to content

Commit 4907cce

Browse files
committed
Indicator WIP
1 parent 6587a25 commit 4907cce

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

meshtastic/interdevice.options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*InterdeviceMessage.nmea max_size:1024
2+
*InterdeviceMessage.beep int_size:16

meshtastic/interdevice.proto

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,36 @@ option java_outer_classname = "InterdeviceProtos";
88
option java_package = "com.geeksville.mesh";
99
option swift_prefix = "";
1010

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;
2622
}
2723

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;
3529
}
30+
Status status = 1;
31+
uint32 data = 2;
3632
}
3733

34+
// Main message for interdevice communication
3835
message InterdeviceMessage {
3936
// The message data
4037
oneof data {
4138
string nmea = 1;
42-
SensorData sensor = 2;
39+
I2CCommand i2c_command = 2;
40+
I2CResponse i2c_response = 3;
41+
uint32 beep = 4;
4342
}
4443
}

0 commit comments

Comments
 (0)