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; }
9 optional Type type = 1;
10 optional RawMessage raw_message = 2;
11 optional TranslatedMessage translated_message = 3;
12 optional DiagnosticResponse diagnostic_response = 4;
13 optional ControlCommand control_command = 5;
17 optional int32 bus = 1;
18 optional uint32 message_id = 2;
19 optional bytes data = 3;
22 message ControlCommand {
23 enum Type { VERSION = 1; DEVICE_ID = 2; DIAGNOSTIC = 3; }
25 optional Type type = 1;
26 optional DiagnosticRequest diagnostic_request = 2;
29 message DiagnosticRequest {
30 optional int32 bus = 1;
31 optional uint32 message_id = 2;
32 optional uint32 mode = 3;
33 optional uint32 pid = 4;
34 // TODO we are capping this at 8 bytes for now - need to change when we
35 // support multi-frame responses
36 optional bytes payload = 5;
37 optional bool parse_payload = 6;
38 optional double factor = 7;
39 optional double offset = 8;
40 optional double frequency = 9;
43 message DiagnosticResponse {
44 optional int32 bus = 1;
45 optional uint32 message_id = 2;
46 optional uint32 mode = 3;
47 optional uint32 pid = 4;
48 optional bool success = 5;
49 optional uint32 negative_response_code = 6;
50 // TODO we are capping this at 8 bytes for now - need to change when we
51 // support multi-frame responses
52 optional bytes payload = 7;
53 optional double value = 8;
56 message DynamicField {
57 enum Type { STRING = 1; NUM = 2; BOOL = 3; }
59 optional Type type = 1;
60 optional string string_value = 2;
61 optional double numeric_value = 3;
62 optional bool boolean_value = 4;
65 message TranslatedMessage {
66 enum Type { STRING = 1; NUM = 2; BOOL = 3;
67 EVENTED_STRING = 4; EVENTED_NUM = 5; EVENTED_BOOL = 6;}
69 optional Type type = 1;
70 optional string name = 2;
71 optional DynamicField value = 3;
72 optional DynamicField event = 4;
75 // TODO we should also consider having an enum type, having each specific
76 // message defined as a protobuf