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 PayloadFormatCommand payload_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 PayloadFormatCommand {
64 optional PayloadFormat format = 1;
67 message CommandResponse {
68 optional ControlCommand.Type type = 1;
69 optional string message = 2;
70 optional bool status = 3;
73 message DiagnosticRequest {
74 enum DecodedType { NONE = 1; OBD2 = 2; }
76 optional int32 bus = 1;
77 optional uint32 message_id = 2;
78 optional uint32 mode = 3;
79 optional uint32 pid = 4;
80 // TODO we are capping this at 8 bytes for now - need to change when we
81 // support multi-frame responses
82 optional bytes payload = 5;
83 optional bool multiple_responses = 6;
84 optional double frequency = 7;
85 optional string name = 8;
86 optional DecodedType decoded_type = 9;
89 message DiagnosticResponse {
90 optional int32 bus = 1;
91 optional uint32 message_id = 2;
92 optional uint32 mode = 3;
93 optional uint32 pid = 4;
94 optional bool success = 5;
95 optional uint32 negative_response_code = 6;
96 // TODO we are capping this at 8 bytes for now - need to change when we
97 // support multi-frame responses
98 optional bytes payload = 7;
99 optional double value = 8;
102 message DynamicField {
103 enum Type { STRING = 1; NUM = 2; BOOL = 3; }
105 optional Type type = 1;
106 optional string string_value = 2;
107 optional double numeric_value = 3;
108 optional bool boolean_value = 4;
111 message TranslatedMessage {
112 enum Type { STRING = 1; NUM = 2; BOOL = 3;
113 EVENTED_STRING = 4; EVENTED_NUM = 5; EVENTED_BOOL = 6;}
115 optional Type type = 1;
116 optional string name = 2;
117 optional DynamicField value = 3;
118 optional DynamicField event = 4;
121 // TODO we should also consider having an enum type, having each specific
122 // message defined as a protobuf