X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=openxc.proto;h=97a6ebb6a8d0146aa1981e6231de23e3fb13e11d;hb=e3162f7da4b6b5ad422bccdb9b2a4e1b144ab9c9;hp=cc135a6c7a4af1819b26dc0386a6b095f1583ed5;hpb=ad6058e1fcaa780fe2f6537412fd6663df9f5cc6;p=apps%2Fagl-service-can-low-level.git diff --git a/openxc.proto b/openxc.proto index cc135a6c..97a6ebb6 100644 --- a/openxc.proto +++ b/openxc.proto @@ -4,21 +4,90 @@ option java_package = "com.openxc"; option java_outer_classname = "BinaryMessages"; message VehicleMessage { - enum Type { RAW = 1; TRANSLATED = 2; DIAGNOSTIC = 3; } + enum Type { RAW = 1; TRANSLATED = 2; DIAGNOSTIC = 3; CONTROL_COMMAND = 4; + COMMAND_RESPONSE = 5; } optional Type type = 1; optional RawMessage raw_message = 2; optional TranslatedMessage translated_message = 3; - optional DiagnosticMessage diagnostic_message = 4; + optional DiagnosticResponse diagnostic_response = 4; + optional ControlCommand control_command = 5; + optional CommandResponse command_response = 6; } message RawMessage { optional int32 bus = 1; optional uint32 message_id = 2; - optional uint64 data = 3; + optional bytes data = 3; } -message DiagnosticMessage { +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; +} + +message DiagnosticResponse { optional int32 bus = 1; optional uint32 message_id = 2; optional uint32 mode = 3; @@ -28,6 +97,16 @@ message DiagnosticMessage { // TODO we are capping this at 8 bytes for now - need to change when we // support multi-frame responses optional bytes payload = 7; + optional double value = 8; +} + +message DynamicField { + enum Type { STRING = 1; NUM = 2; BOOL = 3; } + + optional Type type = 1; + optional string string_value = 2; + optional double numeric_value = 3; + optional bool boolean_value = 4; } message TranslatedMessage { @@ -36,14 +115,8 @@ message TranslatedMessage { optional Type type = 1; optional string name = 2; - - optional string string_value = 3; - optional double numeric_value = 4; - optional bool boolean_value = 5; - - optional string string_event = 6; - optional double numeric_event = 7; - optional bool boolean_event = 8; + optional DynamicField value = 3; + optional DynamicField event = 4; } // TODO we should also consider having an enum type, having each specific