blob: 541334321f66ef38fdcf63588969085cf0c46e6c (
plain)
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
|
package openxc;
option java_package = "com.openxc";
option java_outer_classname = "BinaryMessages";
message VehicleMessage {
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 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;
}
message StringMessage {
optional string name = 1;
optional string value = 2;
}
message NumericMessage {
optional string name = 1;
optional double value = 2;
}
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
// message defined as a protobuf
|