+ optional bytes data = 3;
+}
+
+message ControlCommand {
+ enum Type {
+ VERSION = 1;
+ DEVICE_ID = 2;
+ DIAGNOSTIC = 3;
+ PASSTHROUGH = 4;
+ ACCEPTANCE_FILTER_BYPASS = 5;
+ MESSAGE_FORMAT = 6;
+ }
+
+ optional Type type = 1;
+ optional DiagnosticControlCommand diagnostic_request = 2;
+ optional PassthroughModeControlCommand passthrough_mode_request = 3;
+ optional AcceptanceFilterBypassCommand acceptance_filter_bypass_command = 4;
+ optional MessageFormatCommand message_format_command = 5;
+}
+
+message DiagnosticControlCommand {
+ enum Action { ADD = 1; CANCEL = 2; }
+
+ optional DiagnosticRequest request = 1;
+ optional Action action = 2;
+}
+
+message PassthroughModeControlCommand {
+ optional int32 bus = 1;
+ optional bool enabled = 2;
+}
+
+message AcceptanceFilterBypassCommand {
+ optional int32 bus = 1;
+ optional bool bypass = 2;
+}
+
+message MessageFormatCommand {
+ enum MessageFormat {
+ JSON = 1;
+ BINARY = 2;
+ }
+
+ optional int32 bus = 1;
+ optional MessageFormat format = 2;
+}
+
+message CommandResponse {
+ optional ControlCommand.Type type = 1;
+ optional string message = 2;
+ optional bool status = 3;
+}
+
+message DiagnosticRequest {
+ enum DecodedType { NONE = 1; OBD2 = 2; }
+
+ optional int32 bus = 1;
+ optional uint32 message_id = 2;
+ optional uint32 mode = 3;
+ optional uint32 pid = 4;
+ // TODO we are capping this at 8 bytes for now - need to change when we
+ // support multi-frame responses
+ optional bytes payload = 5;
+ optional bool multiple_responses = 6;
+ optional double frequency = 7;
+ optional string name = 8;
+ optional DecodedType decoded_type = 9;