diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ad1b1..07aeafe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # OpenXC Message Format Changelog +## v0.8.0 + +* Feature: Support for GET_VIN command +* Improvements: Diagnostic Request structure enhanced to handle stitch frames +* Removed: MessagePack encoding removed + ## v0.7.0-dev * Improvement: Increase diagnostic response payload size to accommodate diff --git a/README.md b/README.md index 2608720..e81a73e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenXC Message Format Specification -Version: v0.7.0-dev +Version: v0.8.0 This specification is a part of the [OpenXC platform][OpenXC]. @@ -30,21 +30,6 @@ method (any protobuf library should support this). The binary format is best if you need to maximize the amount of data that can be sent from the VI, trading off flexibility for efficiency. -## Message Pack -MessagePack is an efficient binary serialization format. It lets you exchange data -among multiple languages like JSON, but it's faster and smaller. Small integers are -encoded into a single byte, and typical short strings require only one extra byte -in addition to the strings themselves - -For protocol specification visit: -https://github.com/msgpack/msgpack/blob/master/spec.md - -We are using the following lib: -https://github.com/camgunz/cmp - -MessagePack provides a binary alternative to ProtoBuf. There are pros & cons to each -so you can decide what works best for your project. - ## Trace File Format An OpenXC vehicle trace file is a plaintext file that contains JSON objects, @@ -176,7 +161,7 @@ found in the [OBD-II standard](http://en.wikipedia.org/wiki/OBD-II_PIDs#Mode_01) License ======= -Copyright (c) 2012-2014 Ford Motor Company +Copyright (c) 2012-2021 Ford Motor Company Licensed under the BSD license. diff --git a/gen/cpp/openxc.pb b/gen/cpp/openxc.pb index 92b8139..29495fd 100644 Binary files a/gen/cpp/openxc.pb and b/gen/cpp/openxc.pb differ diff --git a/gen/cpp/openxc.pb.c b/gen/cpp/openxc.pb.c index 4b03c41..62a2428 100644 --- a/gen/cpp/openxc.pb.c +++ b/gen/cpp/openxc.pb.c @@ -59,9 +59,6 @@ PB_BIND(openxc_DiagnosticRequest, openxc_DiagnosticRequest, AUTO) PB_BIND(openxc_DiagnosticResponse, openxc_DiagnosticResponse, 2) -PB_BIND(openxc_DiagnosticStitchResponse, openxc_DiagnosticStitchResponse, AUTO) - - PB_BIND(openxc_DynamicField, openxc_DynamicField, AUTO) diff --git a/gen/cpp/openxc.pb.h b/gen/cpp/openxc.pb.h index c6a9004..762513c 100644 --- a/gen/cpp/openxc.pb.h +++ b/gen/cpp/openxc.pb.h @@ -21,12 +21,11 @@ typedef enum _openxc_VehicleMessage_Type { openxc_VehicleMessage_Type_SIMPLE = 2, openxc_VehicleMessage_Type_DIAGNOSTIC = 3, openxc_VehicleMessage_Type_CONTROL_COMMAND = 4, - openxc_VehicleMessage_Type_COMMAND_RESPONSE = 5, - openxc_VehicleMessage_Type_DIAGNOSTIC_STITCH = 6 + openxc_VehicleMessage_Type_COMMAND_RESPONSE = 5 } openxc_VehicleMessage_Type; #define _openxc_VehicleMessage_Type_MIN openxc_VehicleMessage_Type_UNUSED -#define _openxc_VehicleMessage_Type_MAX openxc_VehicleMessage_Type_DIAGNOSTIC_STITCH -#define _openxc_VehicleMessage_Type_ARRAYSIZE ((openxc_VehicleMessage_Type)(openxc_VehicleMessage_Type_DIAGNOSTIC_STITCH+1)) +#define _openxc_VehicleMessage_Type_MAX openxc_VehicleMessage_Type_COMMAND_RESPONSE +#define _openxc_VehicleMessage_Type_ARRAYSIZE ((openxc_VehicleMessage_Type)(openxc_VehicleMessage_Type_COMMAND_RESPONSE+1)) typedef enum _openxc_CanMessage_FrameFormat { openxc_CanMessage_FrameFormat_UNUSED = 0, @@ -49,11 +48,12 @@ typedef enum _openxc_ControlCommand_Type { openxc_ControlCommand_Type_MODEM_CONFIGURATION = 8, openxc_ControlCommand_Type_RTC_CONFIGURATION = 9, openxc_ControlCommand_Type_SD_MOUNT_STATUS = 10, - openxc_ControlCommand_Type_PLATFORM = 11 + openxc_ControlCommand_Type_PLATFORM = 11, + openxc_ControlCommand_Type_GET_VIN = 12 } openxc_ControlCommand_Type; #define _openxc_ControlCommand_Type_MIN openxc_ControlCommand_Type_UNUSED -#define _openxc_ControlCommand_Type_MAX openxc_ControlCommand_Type_PLATFORM -#define _openxc_ControlCommand_Type_ARRAYSIZE ((openxc_ControlCommand_Type)(openxc_ControlCommand_Type_PLATFORM+1)) +#define _openxc_ControlCommand_Type_MAX openxc_ControlCommand_Type_GET_VIN +#define _openxc_ControlCommand_Type_ARRAYSIZE ((openxc_ControlCommand_Type)(openxc_ControlCommand_Type_GET_VIN+1)) typedef enum _openxc_DiagnosticControlCommand_Action { openxc_DiagnosticControlCommand_Action_UNUSED = 0, @@ -67,12 +67,11 @@ typedef enum _openxc_DiagnosticControlCommand_Action { typedef enum _openxc_PayloadFormatCommand_PayloadFormat { openxc_PayloadFormatCommand_PayloadFormat_UNUSED = 0, openxc_PayloadFormatCommand_PayloadFormat_JSON = 1, - openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF = 2, - openxc_PayloadFormatCommand_PayloadFormat_MESSAGEPACK = 3 + openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF = 2 } openxc_PayloadFormatCommand_PayloadFormat; #define _openxc_PayloadFormatCommand_PayloadFormat_MIN openxc_PayloadFormatCommand_PayloadFormat_UNUSED -#define _openxc_PayloadFormatCommand_PayloadFormat_MAX openxc_PayloadFormatCommand_PayloadFormat_MESSAGEPACK -#define _openxc_PayloadFormatCommand_PayloadFormat_ARRAYSIZE ((openxc_PayloadFormatCommand_PayloadFormat)(openxc_PayloadFormatCommand_PayloadFormat_MESSAGEPACK+1)) +#define _openxc_PayloadFormatCommand_PayloadFormat_MAX openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF +#define _openxc_PayloadFormatCommand_PayloadFormat_ARRAYSIZE ((openxc_PayloadFormatCommand_PayloadFormat)(openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF+1)) typedef enum _openxc_NetworkOperatorSettings_OperatorSelectMode { openxc_NetworkOperatorSettings_OperatorSelectMode_AUTOMATIC = 0, @@ -224,24 +223,10 @@ typedef struct _openxc_DiagnosticResponse { uint32_t negative_response_code; openxc_DiagnosticResponse_payload_t payload; openxc_DynamicField value; -/* @@protoc_insertion_point(struct:openxc_DiagnosticResponse) */ -} openxc_DiagnosticResponse; - - -typedef PB_BYTES_ARRAY_T(14) openxc_DiagnosticStitchResponse_payload_t; -typedef struct _openxc_DiagnosticStitchResponse { - int32_t bus; - uint32_t message_id; - uint32_t mode; - uint32_t pid; - bool success; - uint32_t negative_response_code; - openxc_DiagnosticStitchResponse_payload_t payload; - openxc_DynamicField value; int32_t frame; uint32_t total_size; -/* @@protoc_insertion_point(struct:openxc_DiagnosticStitchResponse) */ -} openxc_DiagnosticStitchResponse; +/* @@protoc_insertion_point(struct:openxc_DiagnosticResponse) */ +} openxc_DiagnosticResponse; typedef struct _openxc_NetworkOperatorSettings { @@ -288,14 +273,13 @@ typedef struct _openxc_VehicleMessage { openxc_DiagnosticResponse diagnostic_response; openxc_ControlCommand control_command; openxc_CommandResponse command_response; - openxc_DiagnosticStitchResponse diagnostic_stitch_response; uint64_t timestamp; /* @@protoc_insertion_point(struct:openxc_VehicleMessage) */ } openxc_VehicleMessage; /* Initializer values for message structs */ -#define openxc_VehicleMessage_init_default {_openxc_VehicleMessage_Type_MIN, openxc_CanMessage_init_default, openxc_SimpleMessage_init_default, openxc_DiagnosticResponse_init_default, openxc_ControlCommand_init_default, openxc_CommandResponse_init_default, openxc_DiagnosticStitchResponse_init_default, 0} +#define openxc_VehicleMessage_init_default {_openxc_VehicleMessage_Type_MIN, openxc_CanMessage_init_default, openxc_SimpleMessage_init_default, openxc_DiagnosticResponse_init_default, openxc_ControlCommand_init_default, openxc_CommandResponse_init_default, 0} #define openxc_CanMessage_init_default {0, 0, {0, {0}}, _openxc_CanMessage_FrameFormat_MIN} #define openxc_ControlCommand_init_default {_openxc_ControlCommand_Type_MIN, openxc_DiagnosticControlCommand_init_default, openxc_PassthroughModeControlCommand_init_default, openxc_AcceptanceFilterBypassCommand_init_default, openxc_PayloadFormatCommand_init_default, openxc_PredefinedObd2RequestsCommand_init_default, openxc_ModemConfigurationCommand_init_default, openxc_RTCConfigurationCommand_init_default} #define openxc_DiagnosticControlCommand_init_default {openxc_DiagnosticRequest_init_default, _openxc_DiagnosticControlCommand_Action_MIN} @@ -311,11 +295,10 @@ typedef struct _openxc_VehicleMessage { #define openxc_RTCConfigurationCommand_init_default {0} #define openxc_CommandResponse_init_default {_openxc_ControlCommand_Type_MIN, "", 0} #define openxc_DiagnosticRequest_init_default {0, 0, 0, 0, {0, {0}}, 0, 0, "", _openxc_DiagnosticRequest_DecodedType_MIN} -#define openxc_DiagnosticResponse_init_default {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_default} -#define openxc_DiagnosticStitchResponse_init_default {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_default, 0, 0} +#define openxc_DiagnosticResponse_init_default {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_default, 0, 0} #define openxc_DynamicField_init_default {_openxc_DynamicField_Type_MIN, "", 0, 0} #define openxc_SimpleMessage_init_default {"", openxc_DynamicField_init_default, openxc_DynamicField_init_default} -#define openxc_VehicleMessage_init_zero {_openxc_VehicleMessage_Type_MIN, openxc_CanMessage_init_zero, openxc_SimpleMessage_init_zero, openxc_DiagnosticResponse_init_zero, openxc_ControlCommand_init_zero, openxc_CommandResponse_init_zero, openxc_DiagnosticStitchResponse_init_zero, 0} +#define openxc_VehicleMessage_init_zero {_openxc_VehicleMessage_Type_MIN, openxc_CanMessage_init_zero, openxc_SimpleMessage_init_zero, openxc_DiagnosticResponse_init_zero, openxc_ControlCommand_init_zero, openxc_CommandResponse_init_zero, 0} #define openxc_CanMessage_init_zero {0, 0, {0, {0}}, _openxc_CanMessage_FrameFormat_MIN} #define openxc_ControlCommand_init_zero {_openxc_ControlCommand_Type_MIN, openxc_DiagnosticControlCommand_init_zero, openxc_PassthroughModeControlCommand_init_zero, openxc_AcceptanceFilterBypassCommand_init_zero, openxc_PayloadFormatCommand_init_zero, openxc_PredefinedObd2RequestsCommand_init_zero, openxc_ModemConfigurationCommand_init_zero, openxc_RTCConfigurationCommand_init_zero} #define openxc_DiagnosticControlCommand_init_zero {openxc_DiagnosticRequest_init_zero, _openxc_DiagnosticControlCommand_Action_MIN} @@ -331,8 +314,7 @@ typedef struct _openxc_VehicleMessage { #define openxc_RTCConfigurationCommand_init_zero {0} #define openxc_CommandResponse_init_zero {_openxc_ControlCommand_Type_MIN, "", 0} #define openxc_DiagnosticRequest_init_zero {0, 0, 0, 0, {0, {0}}, 0, 0, "", _openxc_DiagnosticRequest_DecodedType_MIN} -#define openxc_DiagnosticResponse_init_zero {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_zero} -#define openxc_DiagnosticStitchResponse_init_zero {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_zero, 0, 0} +#define openxc_DiagnosticResponse_init_zero {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_zero, 0, 0} #define openxc_DynamicField_init_zero {_openxc_DynamicField_Type_MIN, "", 0, 0} #define openxc_SimpleMessage_init_zero {"", openxc_DynamicField_init_zero, openxc_DynamicField_init_zero} @@ -379,16 +361,8 @@ typedef struct _openxc_VehicleMessage { #define openxc_DiagnosticResponse_negative_response_code_tag 6 #define openxc_DiagnosticResponse_payload_tag 7 #define openxc_DiagnosticResponse_value_tag 8 -#define openxc_DiagnosticStitchResponse_bus_tag 1 -#define openxc_DiagnosticStitchResponse_message_id_tag 2 -#define openxc_DiagnosticStitchResponse_mode_tag 3 -#define openxc_DiagnosticStitchResponse_pid_tag 4 -#define openxc_DiagnosticStitchResponse_success_tag 5 -#define openxc_DiagnosticStitchResponse_negative_response_code_tag 6 -#define openxc_DiagnosticStitchResponse_payload_tag 7 -#define openxc_DiagnosticStitchResponse_value_tag 8 -#define openxc_DiagnosticStitchResponse_frame_tag 9 -#define openxc_DiagnosticStitchResponse_total_size_tag 10 +#define openxc_DiagnosticResponse_frame_tag 9 +#define openxc_DiagnosticResponse_total_size_tag 10 #define openxc_NetworkOperatorSettings_allowDataRoaming_tag 1 #define openxc_NetworkOperatorSettings_operatorSelectMode_tag 2 #define openxc_NetworkOperatorSettings_networkDescriptor_tag 3 @@ -412,8 +386,7 @@ typedef struct _openxc_VehicleMessage { #define openxc_VehicleMessage_diagnostic_response_tag 4 #define openxc_VehicleMessage_control_command_tag 5 #define openxc_VehicleMessage_command_response_tag 6 -#define openxc_VehicleMessage_diagnostic_stitch_response_tag 7 -#define openxc_VehicleMessage_timestamp_tag 8 +#define openxc_VehicleMessage_timestamp_tag 7 /* Struct field encoding specification for nanopb */ #define openxc_VehicleMessage_FIELDLIST(X, a) \ @@ -423,8 +396,7 @@ X(a, STATIC, SINGULAR, MESSAGE, simple_message, 3) \ X(a, STATIC, SINGULAR, MESSAGE, diagnostic_response, 4) \ X(a, STATIC, SINGULAR, MESSAGE, control_command, 5) \ X(a, STATIC, SINGULAR, MESSAGE, command_response, 6) \ -X(a, STATIC, SINGULAR, MESSAGE, diagnostic_stitch_response, 7) \ -X(a, STATIC, SINGULAR, UINT64, timestamp, 8) +X(a, STATIC, SINGULAR, UINT64, timestamp, 7) #define openxc_VehicleMessage_CALLBACK NULL #define openxc_VehicleMessage_DEFAULT NULL #define openxc_VehicleMessage_can_message_MSGTYPE openxc_CanMessage @@ -432,7 +404,6 @@ X(a, STATIC, SINGULAR, UINT64, timestamp, 8) #define openxc_VehicleMessage_diagnostic_response_MSGTYPE openxc_DiagnosticResponse #define openxc_VehicleMessage_control_command_MSGTYPE openxc_ControlCommand #define openxc_VehicleMessage_command_response_MSGTYPE openxc_CommandResponse -#define openxc_VehicleMessage_diagnostic_stitch_response_MSGTYPE openxc_DiagnosticStitchResponse #define openxc_CanMessage_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, INT32, bus, 1) \ @@ -558,25 +529,12 @@ X(a, STATIC, SINGULAR, UINT32, pid, 4) \ X(a, STATIC, SINGULAR, BOOL, success, 5) \ X(a, STATIC, SINGULAR, UINT32, negative_response_code, 6) \ X(a, STATIC, SINGULAR, BYTES, payload, 7) \ -X(a, STATIC, SINGULAR, MESSAGE, value, 8) -#define openxc_DiagnosticResponse_CALLBACK NULL -#define openxc_DiagnosticResponse_DEFAULT NULL -#define openxc_DiagnosticResponse_value_MSGTYPE openxc_DynamicField - -#define openxc_DiagnosticStitchResponse_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, INT32, bus, 1) \ -X(a, STATIC, SINGULAR, UINT32, message_id, 2) \ -X(a, STATIC, SINGULAR, UINT32, mode, 3) \ -X(a, STATIC, SINGULAR, UINT32, pid, 4) \ -X(a, STATIC, SINGULAR, BOOL, success, 5) \ -X(a, STATIC, SINGULAR, UINT32, negative_response_code, 6) \ -X(a, STATIC, SINGULAR, BYTES, payload, 7) \ X(a, STATIC, SINGULAR, MESSAGE, value, 8) \ X(a, STATIC, SINGULAR, INT32, frame, 9) \ X(a, STATIC, SINGULAR, UINT32, total_size, 10) -#define openxc_DiagnosticStitchResponse_CALLBACK NULL -#define openxc_DiagnosticStitchResponse_DEFAULT NULL -#define openxc_DiagnosticStitchResponse_value_MSGTYPE openxc_DynamicField +#define openxc_DiagnosticResponse_CALLBACK NULL +#define openxc_DiagnosticResponse_DEFAULT NULL +#define openxc_DiagnosticResponse_value_MSGTYPE openxc_DynamicField #define openxc_DynamicField_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, type, 1) \ @@ -612,7 +570,6 @@ extern const pb_msgdesc_t openxc_RTCConfigurationCommand_msg; extern const pb_msgdesc_t openxc_CommandResponse_msg; extern const pb_msgdesc_t openxc_DiagnosticRequest_msg; extern const pb_msgdesc_t openxc_DiagnosticResponse_msg; -extern const pb_msgdesc_t openxc_DiagnosticStitchResponse_msg; extern const pb_msgdesc_t openxc_DynamicField_msg; extern const pb_msgdesc_t openxc_SimpleMessage_msg; @@ -634,12 +591,11 @@ extern const pb_msgdesc_t openxc_SimpleMessage_msg; #define openxc_CommandResponse_fields &openxc_CommandResponse_msg #define openxc_DiagnosticRequest_fields &openxc_DiagnosticRequest_msg #define openxc_DiagnosticResponse_fields &openxc_DiagnosticResponse_msg -#define openxc_DiagnosticStitchResponse_fields &openxc_DiagnosticStitchResponse_msg #define openxc_DynamicField_fields &openxc_DynamicField_msg #define openxc_SimpleMessage_fields &openxc_SimpleMessage_msg /* Maximum encoded size of messages (where known) */ -#define openxc_VehicleMessage_size 1585 +#define openxc_VehicleMessage_size 1383 #define openxc_CanMessage_size 29 #define openxc_ControlCommand_size 342 #define openxc_DiagnosticControlCommand_size 67 @@ -655,8 +611,7 @@ extern const pb_msgdesc_t openxc_SimpleMessage_msg; #define openxc_RTCConfigurationCommand_size 6 #define openxc_CommandResponse_size 134 #define openxc_DiagnosticRequest_size 63 -#define openxc_DiagnosticResponse_size 441 -#define openxc_DiagnosticStitchResponse_size 216 +#define openxc_DiagnosticResponse_size 458 #define openxc_DynamicField_size 143 #define openxc_SimpleMessage_size 393 diff --git a/gen/go/openxc.pb.go b/gen/go/openxc.pb.go index 78f7fab..26f3f11 100644 --- a/gen/go/openxc.pb.go +++ b/gen/go/openxc.pb.go @@ -221,19 +221,16 @@ type PayloadFormatCommand_PayloadFormat int32 const ( PayloadFormatCommand_JSON PayloadFormatCommand_PayloadFormat = 1 PayloadFormatCommand_PROTOBUF PayloadFormatCommand_PayloadFormat = 2 - PayloadFormatCommand_MESSAGEPACK PayloadFormatCommand_PayloadFormat = 3 ) var PayloadFormatCommand_PayloadFormat_name = map[int32]string{ 1: "JSON", 2: "PROTOBUF", - 3: "MESSAGEPACK", } var PayloadFormatCommand_PayloadFormat_value = map[string]int32{ "JSON": 1, "PROTOBUF": 2, - "MESSAGEPACK": 3, } func (x PayloadFormatCommand_PayloadFormat) Enum() *PayloadFormatCommand_PayloadFormat { diff --git a/gen/java/com/openxc/BinaryMessages.java b/gen/java/com/openxc/BinaryMessages.java index 43f3adf..bcf120c 100644 --- a/gen/java/com/openxc/BinaryMessages.java +++ b/gen/java/com/openxc/BinaryMessages.java @@ -12916,6 +12916,16 @@ public interface DiagnosticResponseOrBuilder extends * .openxc.DynamicField value = 8; */ com.openxc.BinaryMessages.DynamicFieldOrBuilder getValueOrBuilder(); + + /** + * int32 frame = 9; + */ + int getFrame(); + + /** + * uint32 total_size = 10; + */ + int getTotalSize(); } /** * Protobuf type {@code openxc.DiagnosticResponse} @@ -12936,6 +12946,8 @@ private DiagnosticResponse() { success_ = false; negativeResponseCode_ = 0; payload_ = com.google.protobuf.ByteString.EMPTY; + frame_ = 0; + totalSize_ = 0; } @java.lang.Override @@ -13011,6 +13023,16 @@ private DiagnosticResponse( break; } + case 72: { + + frame_ = input.readInt32(); + break; + } + case 80: { + + totalSize_ = input.readUInt32(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -13118,6 +13140,24 @@ public com.openxc.BinaryMessages.DynamicFieldOrBuilder getValueOrBuilder() { return getValue(); } + public static final int FRAME_FIELD_NUMBER = 9; + private int frame_; + /** + * int32 frame = 9; + */ + public int getFrame() { + return frame_; + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 10; + private int totalSize_; + /** + * uint32 total_size = 10; + */ + public int getTotalSize() { + return totalSize_; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; @@ -13154,6 +13194,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (value_ != null) { output.writeMessage(8, getValue()); } + if (frame_ != 0) { + output.writeInt32(9, frame_); + } + if (totalSize_ != 0) { + output.writeUInt32(10, totalSize_); + } } public int getSerializedSize() { @@ -13193,6 +13239,14 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(8, getValue()); } + if (frame_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, frame_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(10, totalSize_); + } memoizedSize = size; return size; } @@ -13228,6 +13282,10 @@ public boolean equals(final java.lang.Object obj) { result = result && getValue() .equals(other.getValue()); } + result = result && (getFrame() + == other.getFrame()); + result = result && (getTotalSize() + == other.getTotalSize()); return result; } @@ -13257,6 +13315,10 @@ public int hashCode() { hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); } + hash = (37 * hash) + FRAME_FIELD_NUMBER; + hash = (53 * hash) + getFrame(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -13395,6 +13457,10 @@ public Builder clear() { value_ = null; valueBuilder_ = null; } + frame_ = 0; + + totalSize_ = 0; + return this; } @@ -13429,6 +13495,8 @@ public com.openxc.BinaryMessages.DiagnosticResponse buildPartial() { } else { result.value_ = valueBuilder_.build(); } + result.frame_ = frame_; + result.totalSize_ = totalSize_; onBuilt(); return result; } @@ -13494,6 +13562,12 @@ public Builder mergeFrom(com.openxc.BinaryMessages.DiagnosticResponse other) { if (other.hasValue()) { mergeValue(other.getValue()); } + if (other.getFrame() != 0) { + setFrame(other.getFrame()); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } onChanged(); return this; } @@ -13821,6 +13895,58 @@ public com.openxc.BinaryMessages.DynamicFieldOrBuilder getValueOrBuilder() { } return valueBuilder_; } + + private int frame_ ; + /** + * int32 frame = 9; + */ + public int getFrame() { + return frame_; + } + /** + * int32 frame = 9; + */ + public Builder setFrame(int value) { + + frame_ = value; + onChanged(); + return this; + } + /** + * int32 frame = 9; + */ + public Builder clearFrame() { + + frame_ = 0; + onChanged(); + return this; + } + + private int totalSize_ ; + /** + * uint32 total_size = 10; + */ + public int getTotalSize() { + return totalSize_; + } + /** + * uint32 total_size = 10; + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * uint32 total_size = 10; + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; @@ -15783,20 +15909,21 @@ public com.openxc.BinaryMessages.SimpleMessage getDefaultInstanceForType() { "\010\022\021\n\tfrequency\030\007 \001(\001\022\014\n\004name\030\010 \001(\t\022;\n\014de" + "coded_type\030\t \001(\0162%.openxc.DiagnosticRequ" + "est.DecodedType\"-\n\013DecodedType\022\n\n\006UNUSED" + - "\020\000\022\010\n\004NONE\020\001\022\010\n\004OBD2\020\002\"\267\001\n\022DiagnosticRes" + + "\020\000\022\010\n\004NONE\020\001\022\010\n\004OBD2\020\002\"\332\001\n\022DiagnosticRes" + "ponse\022\013\n\003bus\030\001 \001(\005\022\022\n\nmessage_id\030\002 \001(\r\022\014" + "\n\004mode\030\003 \001(\r\022\013\n\003pid\030\004 \001(\r\022\017\n\007success\030\005 \001", "(\010\022\036\n\026negative_response_code\030\006 \001(\r\022\017\n\007pa" + "yload\030\007 \001(\014\022#\n\005value\030\010 \001(\0132\024.openxc.Dyna" + - "micField\"\256\001\n\014DynamicField\022\'\n\004type\030\001 \001(\0162" + - "\031.openxc.DynamicField.Type\022\024\n\014string_val" + - "ue\030\002 \001(\t\022\025\n\rnumeric_value\030\003 \001(\001\022\025\n\rboole" + - "an_value\030\004 \001(\010\"1\n\004Type\022\n\n\006UNUSED\020\000\022\n\n\006ST" + - "RING\020\001\022\007\n\003NUM\020\002\022\010\n\004BOOL\020\003\"g\n\rSimpleMessa" + - "ge\022\014\n\004name\030\001 \001(\t\022#\n\005value\030\002 \001(\0132\024.openxc" + - ".DynamicField\022#\n\005event\030\003 \001(\0132\024.openxc.Dy" + - "namicFieldB\034\n\ncom.openxcB\016BinaryMessages", - "b\006proto3" + "micField\022\r\n\005frame\030\t \001(\005\022\022\n\ntotal_size\030\n " + + "\001(\r\"\256\001\n\014DynamicField\022\'\n\004type\030\001 \001(\0162\031.ope" + + "nxc.DynamicField.Type\022\024\n\014string_value\030\002 " + + "\001(\t\022\025\n\rnumeric_value\030\003 \001(\001\022\025\n\rboolean_va" + + "lue\030\004 \001(\010\"1\n\004Type\022\n\n\006UNUSED\020\000\022\n\n\006STRING\020" + + "\001\022\007\n\003NUM\020\002\022\010\n\004BOOL\020\003\"g\n\rSimpleMessage\022\014\n" + + "\004name\030\001 \001(\t\022#\n\005value\030\002 \001(\0132\024.openxc.Dyna" + + "micField\022#\n\005event\030\003 \001(\0132\024.openxc.Dynamic", + "FieldB\034\n\ncom.openxcB\016BinaryMessagesb\006pro" + + "to3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -15911,7 +16038,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_openxc_DiagnosticResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_openxc_DiagnosticResponse_descriptor, - new java.lang.String[] { "Bus", "MessageId", "Mode", "Pid", "Success", "NegativeResponseCode", "Payload", "Value", }); + new java.lang.String[] { "Bus", "MessageId", "Mode", "Pid", "Success", "NegativeResponseCode", "Payload", "Value", "Frame", "TotalSize", }); internal_static_openxc_DynamicField_descriptor = getDescriptor().getMessageTypes().get(16); internal_static_openxc_DynamicField_fieldAccessorTable = new diff --git a/openxc.options b/openxc.options index 16a8580..02deb98 100644 --- a/openxc.options +++ b/openxc.options @@ -2,7 +2,6 @@ openxc.SimpleMessage.name max_size:100 openxc.DynamicField.string_value max_size:128 openxc.CommandResponse.message max_size:128 openxc.DiagnosticResponse.payload max_size:255 -openxc.DiagnosticStitchResponse.payload max_size:14 openxc.DiagnosticRequest.name max_size:10 openxc.DiagnosticRequest.payload max_size:8 openxc.CanMessage.data max_size:8 diff --git a/openxc.proto b/openxc.proto index fc6082f..4ef208c 100644 --- a/openxc.proto +++ b/openxc.proto @@ -7,7 +7,7 @@ option java_outer_classname = "BinaryMessages"; message VehicleMessage { enum Type { UNUSED = 0; CAN = 1; SIMPLE = 2; DIAGNOSTIC = 3; CONTROL_COMMAND = 4; - COMMAND_RESPONSE = 5; DIAGNOSTIC_STITCH = 6; } + COMMAND_RESPONSE = 5; } Type type = 1; CanMessage can_message = 2; @@ -15,8 +15,7 @@ message VehicleMessage { DiagnosticResponse diagnostic_response = 4; ControlCommand control_command = 5; CommandResponse command_response = 6; - DiagnosticStitchResponse diagnostic_stitch_response = 7; - uint64 timestamp = 8; + uint64 timestamp = 7; } message CanMessage { @@ -45,6 +44,7 @@ message ControlCommand { RTC_CONFIGURATION = 9; SD_MOUNT_STATUS = 10; PLATFORM = 11; + GET_VIN = 12; } Type type = 1; @@ -79,7 +79,6 @@ message PayloadFormatCommand { UNUSED = 0; JSON = 1; PROTOBUF = 2; - MESSAGEPACK = 3; } PayloadFormat format = 1; @@ -158,17 +157,6 @@ message DiagnosticResponse { uint32 negative_response_code = 6; bytes payload = 7; DynamicField value = 8; -} - -message DiagnosticStitchResponse { - int32 bus = 1; - uint32 message_id = 2; - uint32 mode = 3; - uint32 pid = 4; - bool success = 5; - uint32 negative_response_code = 6; - bytes payload = 7; - DynamicField value = 8; int32 frame = 9; uint32 total_size = 10; }