Merge branch 'master' into diagnostic
[apps/low-level-can-service.git] / openxc.proto
1 package openxc;
2
3 option java_package = "com.openxc";
4 option java_outer_classname = "BinaryMessages";
5
6 message VehicleMessage {
7     enum Type { RAW = 1; TRANSLATED = 2; DIAGNOSTIC = 3; }
8
9     optional Type type = 1;
10     optional RawMessage raw_message = 2;
11     optional TranslatedMessage translated_message = 3;
12     optional DiagnosticMessage diagnostic_message = 4;
13 }
14
15 message RawMessage {
16     optional int32 bus = 1;
17     optional uint32 message_id = 2;
18     optional uint64 data = 3;
19 }
20
21 message DiagnosticMessage {
22     optional int32 bus = 1;
23     optional uint32 message_id = 2;
24     optional uint32 mode = 3;
25     optional uint32 pid = 4;
26     optional bool success = 5;
27     optional uint32 negative_response_code = 6;
28     // TODO we are capping this at 8 bytes for now - need to change when we
29     // support multi-frame responses
30     optional bytes payload = 7;
31 }
32
33 message TranslatedMessage {
34     enum Type { STRING = 1; NUM = 2; BOOL = 3;
35         EVENTED_STRING = 4; EVENTED_NUM = 5; EVENTED_BOOL = 6;}
36
37     optional Type type = 1;
38     optional string name = 2;
39
40     optional string string_value = 3;
41     optional double numeric_value = 4;
42     optional bool boolean_value = 5;
43
44     optional string string_event = 6;
45     optional double numeric_event = 7;
46     optional bool boolean_event = 8;
47 }
48
49 // TODO we should also consider having an enum type, having each specific
50 // message defined as a protobuf