Store diagnostic response payload as a byte array in protobuf.
[apps/agl-service-can-low-level.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; }
8
9     optional Type type = 1;
10     optional RawMessage raw_message = 2;
11     optional TranslatedMessage translated_message = 3;
12 }
13
14 message RawMessage {
15     optional int32 bus = 1;
16     optional uint32 message_id = 2;
17     optional uint64 data = 3;
18 }
19
20 message DiagnosticMessage {
21     optional int32 bus = 1;
22     optional uint32 message_id = 2;
23     optional uint32 mode = 3;
24     optional uint32 pid = 4;
25     optional bool success = 5;
26     optional uint32 negative_response_code = 6;
27     // TODO we are capping this at 8 bytes for now - need to change when we
28     // support multi-frame responses
29     optional bytes payload = 7;
30 }
31
32 message TranslatedMessage {
33     enum Type { STRING = 1; NUM = 2; BOOL = 3;
34         EVENTED_STRING = 4; EVENTED_NUM = 5; EVENTED_BOOL = 6;}
35
36     optional Type type = 1;
37     optional string name = 2;
38
39     optional string string_value = 3;
40     optional double numeric_value = 4;
41     optional bool boolean_value = 5;
42
43     optional string string_event = 6;
44     optional double numeric_event = 7;
45     optional bool boolean_event = 8;
46 }
47
48 // TODO we should also consider having an enum type, having each specific
49 // message defined as a protobuf