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 {
30 ACCEPTANCE_FILTER_BYPASS = 5;
34 optional Type type = 1;
35 optional DiagnosticControlCommand diagnostic_request = 2;
36 optional PassthroughModeControlCommand passthrough_mode_request = 3;
37 optional AcceptanceFilterBypassCommand acceptance_filter_bypass_command = 4;
38 optional MessageFormatCommand message_format_command = 5;
41 message DiagnosticControlCommand {
42 enum Action { ADD = 1; CANCEL = 2; }
44 optional DiagnosticRequest request = 1;
45 optional Action action = 2;
48 message PassthroughModeControlCommand {
49 optional int32 bus = 1;
50 optional bool enabled = 2;
53 message AcceptanceFilterBypassCommand {
54 optional int32 bus = 1;
55 optional bool bypass = 2;
58 message MessageFormatCommand {
64 optional int32 bus = 1;
65 optional MessageFormat format = 2;
68 message CommandResponse {
69 optional ControlCommand.Type type = 1;
70 optional string message = 2;
71 optional bool status = 3;
74 message DiagnosticRequest {
75 enum DecodedType { NONE = 1; OBD2 = 2; }
77 optional int32 bus = 1;
78 optional uint32 message_id = 2;
79 optional uint32 mode = 3;
80 optional uint32 pid = 4;
81 // TODO we are capping this at 8 bytes for now - need to change when we
82 // support multi-frame responses
83 optional bytes payload = 5;
84 optional bool multiple_responses = 6;
85 optional double frequency = 7;
86 optional string name = 8;
87 optional DecodedType decoded_type = 9;
90 message DiagnosticResponse {
91 optional int32 bus = 1;
92 optional uint32 message_id = 2;
93 optional uint32 mode = 3;
94 optional uint32 pid = 4;
95 optional bool success = 5;
96 optional uint32 negative_response_code = 6;
97 // TODO we are capping this at 8 bytes for now - need to change when we
98 // support multi-frame responses
99 optional bytes payload = 7;
100 optional double value = 8;
103 message DynamicField {
104 enum Type { STRING = 1; NUM = 2; BOOL = 3; }
106 optional Type type = 1;
107 optional string string_value = 2;
108 optional double numeric_value = 3;
109 optional bool boolean_value = 4;
112 message TranslatedMessage {
113 enum Type { STRING = 1; NUM = 2; BOOL = 3;
114 EVENTED_STRING = 4; EVENTED_NUM = 5; EVENTED_BOOL = 6;}
116 optional Type type = 1;
117 optional string name = 2;
118 optional DynamicField value = 3;
119 optional DynamicField event = 4;
122 // TODO we should also consider having an enum type, having each specific
123 // message defined as a protobuf