3 option java_package = "com.openxc";
4 option java_outer_classname = "BinaryMessages";
6 message VehicleMessage {
7 enum Type { RAW = 1; TRANSLATED = 2; DIAGNOSTIC = 3; CONTROL_COMMAND = 4;
8 COMMAND_RESPONSE = 5; }
10 optional Type type = 1;
11 optional RawMessage raw_message = 2;
12 optional TranslatedMessage translated_message = 3;
13 optional DiagnosticResponse diagnostic_response = 4;
14 optional ControlCommand control_command = 5;
15 optional CommandResponse command_response = 6;
19 optional int32 bus = 1;
20 optional uint32 message_id = 2;
21 optional bytes data = 3;
24 message ControlCommand {
32 optional Type type = 1;
33 optional DiagnosticControlCommand diagnostic_request = 2;
34 optional PassthroughModeControlCommand passthrough_mode_request = 3;
37 message DiagnosticControlCommand {
38 enum Action { ADD = 1; CANCEL = 2; }
40 optional DiagnosticRequest request = 1;
41 optional Action action = 2;
44 message PassthroughModeControlCommand {
45 enum PassthroughMode {
51 optional int32 bus = 1;
52 optional PassthroughMode mode = 2;
55 message CommandResponse {
56 optional ControlCommand.Type type = 1;
57 optional string message = 2;
58 optional bool status = 3;
61 message DiagnosticRequest {
62 enum DecodedType { NONE = 1; OBD2 = 2; }
64 optional int32 bus = 1;
65 optional uint32 message_id = 2;
66 optional uint32 mode = 3;
67 optional uint32 pid = 4;
68 // TODO we are capping this at 8 bytes for now - need to change when we
69 // support multi-frame responses
70 optional bytes payload = 5;
71 optional bool multiple_responses = 6;
72 optional double frequency = 7;
73 optional string name = 8;
74 optional DecodedType decoded_type = 9;
77 message DiagnosticResponse {
78 optional int32 bus = 1;
79 optional uint32 message_id = 2;
80 optional uint32 mode = 3;
81 optional uint32 pid = 4;
82 optional bool success = 5;
83 optional uint32 negative_response_code = 6;
84 // TODO we are capping this at 8 bytes for now - need to change when we
85 // support multi-frame responses
86 optional bytes payload = 7;
87 optional double value = 8;
90 message DynamicField {
91 enum Type { STRING = 1; NUM = 2; BOOL = 3; }
93 optional Type type = 1;
94 optional string string_value = 2;
95 optional double numeric_value = 3;
96 optional bool boolean_value = 4;
99 message TranslatedMessage {
100 enum Type { STRING = 1; NUM = 2; BOOL = 3;
101 EVENTED_STRING = 4; EVENTED_NUM = 5; EVENTED_BOOL = 6;}
103 optional Type type = 1;
104 optional string name = 2;
105 optional DynamicField value = 3;
106 optional DynamicField event = 4;
109 // TODO we should also consider having an enum type, having each specific
110 // message defined as a protobuf