aboutsummaryrefslogtreecommitdiffstats
path: root/openxc.proto
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-10-23 09:02:33 -0400
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-07 13:18:10 -0500
commitda1d41840879bc75a9df06972e1ec191bbfd3691 (patch)
treed25f57f7872963396f83ca0f10f2aa4c73b29d04 /openxc.proto
parent4904749890b1f2570f9197da99a07a76471e8400 (diff)
Switch back to many subtypes for binary messages.
Some protobuf libraries don't support checking if a field exists (they always return a default value), so although this style has more code it is easier to support.
Diffstat (limited to 'openxc.proto')
-rw-r--r--openxc.proto52
1 files changed, 42 insertions, 10 deletions
diff --git a/openxc.proto b/openxc.proto
index 9f9046eb..54133432 100644
--- a/openxc.proto
+++ b/openxc.proto
@@ -4,30 +4,62 @@ option java_package = "com.openxc";
option java_outer_classname = "BinaryMessages";
message VehicleMessage {
- enum Type { RAW = 1; TRANSLATED = 2; }
+ enum Type { RAW = 1;
+ STRING = 2;
+ BOOL = 3;
+ NUM = 4;
+ EVENTED_NUM = 5;
+ EVENTED_STRING = 6;
+ EVENTED_BOOL = 7;
+ }
optional Type type = 1;
optional RawMessage raw_message = 2;
- optional TranslatedMessage translated_message = 3;
+ optional StringMessage string_message = 3;
+ optional NumericMessage numeric_message = 4;
+ optional BooleanMessage boolean_message = 5;
+ optional EventedStringMessage evented_string_message = 6;
+ optional EventedBooleanMessage evented_boolean_message = 7;
+ optional EventedNumericMessage evented_numeric_message = 8;
}
message RawMessage {
optional int32 bus = 1;
optional uint32 message_id = 2;
- optional uint64 data = 3;
}
-message TranslatedMessage {
+message StringMessage {
optional string name = 1;
+ optional string value = 2;
+}
- optional string string_value = 2;
- optional double numerical_value = 3;
- optional bool boolean_value = 4;
+message NumericMessage {
+ optional string name = 1;
+ optional double value = 2;
+}
- optional string string_event = 5;
- optional double numerical_event = 6;
- optional bool boolean_event = 7;
+message BooleanMessage {
+ optional string name = 1;
+ optional bool value = 2;
+}
+
+message EventedStringMessage {
+ optional string name = 1;
+ optional string value = 2;
+ optional string event = 3;
+}
+
+message EventedBooleanMessage {
+ optional string name = 1;
+ optional string value = 2;
+ optional bool event = 3;
+}
+
+message EventedNumericMessage {
+ optional string name = 1;
+ optional string value = 2;
+ optional double event = 3;
}
// TODO we should also consider having an enum type, having each specific