From: Christopher Peplin Date: Wed, 19 Feb 2014 21:05:59 +0000 (-0500) Subject: Add a value field to diagnostic responses for parsed payloads. X-Git-Tag: 5.0.2~275^2~36 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=a9e6edd6bc7952313997ec3cae5bfda3b2f62ee9;p=apps%2Fagl-service-can-low-level.git Add a value field to diagnostic responses for parsed payloads. --- diff --git a/gen/cpp/openxc.pb b/gen/cpp/openxc.pb index b4fd2f65..ead68af6 100644 --- a/gen/cpp/openxc.pb +++ b/gen/cpp/openxc.pb @@ -1,5 +1,5 @@ -Ã +Ò openxc.protoopenxc"ƒ VehicleMessage) type (2.openxc.VehicleMessage.Type' @@ -17,7 +17,7 @@ RawMessage bus ( message_id (  -data ( "‘ +data ( "  DiagnosticMessage bus ( @@ -26,7 +26,8 @@ message_id (  pid (  success ( negative_response_code (  -payload ( "µ +payload (  +value ("µ TranslatedMessage, type (2.openxc.TranslatedMessage.Type name (  diff --git a/gen/cpp/openxc.pb.c b/gen/cpp/openxc.pb.c index 84c87c7c..d473fd3b 100644 --- a/gen/cpp/openxc.pb.c +++ b/gen/cpp/openxc.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.2.5 at Fri Jan 17 16:33:23 2014. */ +/* Generated by nanopb-0.2.5 at Wed Feb 19 14:35:41 2014. */ #include "openxc.pb.h" @@ -20,7 +20,7 @@ const pb_field_t openxc_RawMessage_fields[4] = { PB_LAST_FIELD }; -const pb_field_t openxc_DiagnosticMessage_fields[8] = { +const pb_field_t openxc_DiagnosticMessage_fields[9] = { PB_FIELD2( 1, INT32 , OPTIONAL, STATIC , FIRST, openxc_DiagnosticMessage, bus, bus, 0), PB_FIELD2( 2, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, message_id, bus, 0), PB_FIELD2( 3, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, mode, message_id, 0), @@ -28,6 +28,7 @@ const pb_field_t openxc_DiagnosticMessage_fields[8] = { PB_FIELD2( 5, BOOL , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, success, pid, 0), PB_FIELD2( 6, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, negative_response_code, success, 0), PB_FIELD2( 7, BYTES , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, payload, negative_response_code, 0), + PB_FIELD2( 8, DOUBLE , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, value, payload, 0), PB_LAST_FIELD }; diff --git a/gen/cpp/openxc.pb.h b/gen/cpp/openxc.pb.h index 879dbb80..9e4c3a27 100644 --- a/gen/cpp/openxc.pb.h +++ b/gen/cpp/openxc.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.2.5 at Fri Jan 17 16:33:23 2014. */ +/* Generated by nanopb-0.2.5 at Wed Feb 19 14:35:41 2014. */ #ifndef _PB_OPENXC_PB_H_ #define _PB_OPENXC_PB_H_ @@ -46,6 +46,8 @@ typedef struct _openxc_DiagnosticMessage { uint32_t negative_response_code; bool has_payload; openxc_DiagnosticMessage_payload_t payload; + bool has_value; + double value; } openxc_DiagnosticMessage; typedef struct { @@ -102,6 +104,7 @@ typedef struct _openxc_VehicleMessage { #define openxc_DiagnosticMessage_success_tag 5 #define openxc_DiagnosticMessage_negative_response_code_tag 6 #define openxc_DiagnosticMessage_payload_tag 7 +#define openxc_DiagnosticMessage_value_tag 8 #define openxc_RawMessage_bus_tag 1 #define openxc_RawMessage_message_id_tag 2 #define openxc_RawMessage_data_tag 3 @@ -121,13 +124,13 @@ typedef struct _openxc_VehicleMessage { /* Struct field encoding specification for nanopb */ extern const pb_field_t openxc_VehicleMessage_fields[5]; extern const pb_field_t openxc_RawMessage_fields[4]; -extern const pb_field_t openxc_DiagnosticMessage_fields[8]; +extern const pb_field_t openxc_DiagnosticMessage_fields[9]; extern const pb_field_t openxc_TranslatedMessage_fields[9]; /* Maximum encoded size of messages (where known) */ -#define openxc_VehicleMessage_size 421 +#define openxc_VehicleMessage_size 430 #define openxc_RawMessage_size 27 -#define openxc_DiagnosticMessage_size 47 +#define openxc_DiagnosticMessage_size 56 #define openxc_TranslatedMessage_size 334 #ifdef __cplusplus diff --git a/gen/java/com/openxc/BinaryMessages.java b/gen/java/com/openxc/BinaryMessages.java index 2962fb65..33936050 100644 --- a/gen/java/com/openxc/BinaryMessages.java +++ b/gen/java/com/openxc/BinaryMessages.java @@ -1723,6 +1723,16 @@ public final class BinaryMessages { * */ com.google.protobuf.ByteString getPayload(); + + // optional double value = 8; + /** + * optional double value = 8; + */ + boolean hasValue(); + /** + * optional double value = 8; + */ + double getValue(); } /** * Protobuf type {@code openxc.DiagnosticMessage} @@ -1810,6 +1820,11 @@ public final class BinaryMessages { payload_ = input.readBytes(); break; } + case 65: { + bitField0_ |= 0x00000080; + value_ = input.readDouble(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -1972,6 +1987,22 @@ public final class BinaryMessages { return payload_; } + // optional double value = 8; + public static final int VALUE_FIELD_NUMBER = 8; + private double value_; + /** + * optional double value = 8; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional double value = 8; + */ + public double getValue() { + return value_; + } + private void initFields() { bus_ = 0; messageId_ = 0; @@ -1980,6 +2011,7 @@ public final class BinaryMessages { success_ = false; negativeResponseCode_ = 0; payload_ = com.google.protobuf.ByteString.EMPTY; + value_ = 0D; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -2014,6 +2046,9 @@ public final class BinaryMessages { if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeBytes(7, payload_); } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeDouble(8, value_); + } getUnknownFields().writeTo(output); } @@ -2051,6 +2086,10 @@ public final class BinaryMessages { size += com.google.protobuf.CodedOutputStream .computeBytesSize(7, payload_); } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(8, value_); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -2181,6 +2220,8 @@ public final class BinaryMessages { bitField0_ = (bitField0_ & ~0x00000020); payload_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000040); + value_ = 0D; + bitField0_ = (bitField0_ & ~0x00000080); return this; } @@ -2237,6 +2278,10 @@ public final class BinaryMessages { to_bitField0_ |= 0x00000040; } result.payload_ = payload_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.value_ = value_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -2274,6 +2319,9 @@ public final class BinaryMessages { if (other.hasPayload()) { setPayload(other.getPayload()); } + if (other.hasValue()) { + setValue(other.getValue()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -2555,6 +2603,39 @@ public final class BinaryMessages { return this; } + // optional double value = 8; + private double value_ ; + /** + * optional double value = 8; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional double value = 8; + */ + public double getValue() { + return value_; + } + /** + * optional double value = 8; + */ + public Builder setValue(double value) { + bitField0_ |= 0x00000080; + value_ = value; + onChanged(); + return this; + } + /** + * optional double value = 8; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000080); + value_ = 0D; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:openxc.DiagnosticMessage) } @@ -3918,19 +3999,20 @@ public final class BinaryMessages { "ge\030\004 \001(\0132\031.openxc.DiagnosticMessage\"/\n\004T" + "ype\022\007\n\003RAW\020\001\022\016\n\nTRANSLATED\020\002\022\016\n\nDIAGNOST" + "IC\020\003\";\n\nRawMessage\022\013\n\003bus\030\001 \001(\005\022\022\n\nmessa" + - "ge_id\030\002 \001(\r\022\014\n\004data\030\003 \001(\014\"\221\001\n\021Diagnostic" + + "ge_id\030\002 \001(\r\022\014\n\004data\030\003 \001(\014\"\240\001\n\021Diagnostic" + "Message\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\007" + - "payload\030\007 \001(\014\"\265\002\n\021TranslatedMessage\022,\n\004t" + - "ype\030\001 \001(\0162\036.openxc.TranslatedMessage.Typ" + - "e\022\014\n\004name\030\002 \001(\t\022\024\n\014string_value\030\003 \001(\t\022\025\n" + - "\rnumeric_value\030\004 \001(\001\022\025\n\rboolean_value\030\005 " + - "\001(\010\022\024\n\014string_event\030\006 \001(\t\022\025\n\rnumeric_eve" + - "nt\030\007 \001(\001\022\025\n\rboolean_event\030\010 \001(\010\"\\\n\004Type\022" + - "\n\n\006STRING\020\001\022\007\n\003NUM\020\002\022\010\n\004BOOL\020\003\022\022\n\016EVENTE" + - "D_STRING\020\004\022\017\n\013EVENTED_NUM\020\005\022\020\n\014EVENTED_B", - "OOL\020\006B\034\n\ncom.openxcB\016BinaryMessages" + "payload\030\007 \001(\014\022\r\n\005value\030\010 \001(\001\"\265\002\n\021Transla" + + "tedMessage\022,\n\004type\030\001 \001(\0162\036.openxc.Transl" + + "atedMessage.Type\022\014\n\004name\030\002 \001(\t\022\024\n\014string" + + "_value\030\003 \001(\t\022\025\n\rnumeric_value\030\004 \001(\001\022\025\n\rb" + + "oolean_value\030\005 \001(\010\022\024\n\014string_event\030\006 \001(\t" + + "\022\025\n\rnumeric_event\030\007 \001(\001\022\025\n\rboolean_event" + + "\030\010 \001(\010\"\\\n\004Type\022\n\n\006STRING\020\001\022\007\n\003NUM\020\002\022\010\n\004B" + + "OOL\020\003\022\022\n\016EVENTED_STRING\020\004\022\017\n\013EVENTED_NUM", + "\020\005\022\020\n\014EVENTED_BOOL\020\006B\034\n\ncom.openxcB\016Bina" + + "ryMessages" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -3954,7 +4036,7 @@ public final class BinaryMessages { internal_static_openxc_DiagnosticMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_openxc_DiagnosticMessage_descriptor, - new java.lang.String[] { "Bus", "MessageId", "Mode", "Pid", "Success", "NegativeResponseCode", "Payload", }); + new java.lang.String[] { "Bus", "MessageId", "Mode", "Pid", "Success", "NegativeResponseCode", "Payload", "Value", }); internal_static_openxc_TranslatedMessage_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_openxc_TranslatedMessage_fieldAccessorTable = new diff --git a/gen/python/openxc_pb2.py b/gen/python/openxc_pb2.py index 182d5f2c..7600beef 100644 --- a/gen/python/openxc_pb2.py +++ b/gen/python/openxc_pb2.py @@ -13,7 +13,7 @@ from google.protobuf import descriptor_pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='openxc.proto', package='openxc', - serialized_pb='\n\x0copenxc.proto\x12\x06openxc\"\x83\x02\n\x0eVehicleMessage\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.VehicleMessage.Type\x12\'\n\x0braw_message\x18\x02 \x01(\x0b\x32\x12.openxc.RawMessage\x12\x35\n\x12translated_message\x18\x03 \x01(\x0b\x32\x19.openxc.TranslatedMessage\x12\x35\n\x12\x64iagnostic_message\x18\x04 \x01(\x0b\x32\x19.openxc.DiagnosticMessage\"/\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\";\n\nRawMessage\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\"\x91\x01\n\x11\x44iagnosticMessage\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04mode\x18\x03 \x01(\r\x12\x0b\n\x03pid\x18\x04 \x01(\r\x12\x0f\n\x07success\x18\x05 \x01(\x08\x12\x1e\n\x16negative_response_code\x18\x06 \x01(\r\x12\x0f\n\x07payload\x18\x07 \x01(\x0c\"\xb5\x02\n\x11TranslatedMessage\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.openxc.TranslatedMessage.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x14\n\x0cstring_value\x18\x03 \x01(\t\x12\x15\n\rnumeric_value\x18\x04 \x01(\x01\x12\x15\n\rboolean_value\x18\x05 \x01(\x08\x12\x14\n\x0cstring_event\x18\x06 \x01(\t\x12\x15\n\rnumeric_event\x18\x07 \x01(\x01\x12\x15\n\rboolean_event\x18\x08 \x01(\x08\"\\\n\x04Type\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03NUM\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\x12\n\x0e\x45VENTED_STRING\x10\x04\x12\x0f\n\x0b\x45VENTED_NUM\x10\x05\x12\x10\n\x0c\x45VENTED_BOOL\x10\x06\x42\x1c\n\ncom.openxcB\x0e\x42inaryMessages') + serialized_pb='\n\x0copenxc.proto\x12\x06openxc\"\x83\x02\n\x0eVehicleMessage\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.VehicleMessage.Type\x12\'\n\x0braw_message\x18\x02 \x01(\x0b\x32\x12.openxc.RawMessage\x12\x35\n\x12translated_message\x18\x03 \x01(\x0b\x32\x19.openxc.TranslatedMessage\x12\x35\n\x12\x64iagnostic_message\x18\x04 \x01(\x0b\x32\x19.openxc.DiagnosticMessage\"/\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\";\n\nRawMessage\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\"\xa0\x01\n\x11\x44iagnosticMessage\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04mode\x18\x03 \x01(\r\x12\x0b\n\x03pid\x18\x04 \x01(\r\x12\x0f\n\x07success\x18\x05 \x01(\x08\x12\x1e\n\x16negative_response_code\x18\x06 \x01(\r\x12\x0f\n\x07payload\x18\x07 \x01(\x0c\x12\r\n\x05value\x18\x08 \x01(\x01\"\xb5\x02\n\x11TranslatedMessage\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.openxc.TranslatedMessage.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x14\n\x0cstring_value\x18\x03 \x01(\t\x12\x15\n\rnumeric_value\x18\x04 \x01(\x01\x12\x15\n\rboolean_value\x18\x05 \x01(\x08\x12\x14\n\x0cstring_event\x18\x06 \x01(\t\x12\x15\n\rnumeric_event\x18\x07 \x01(\x01\x12\x15\n\rboolean_event\x18\x08 \x01(\x08\"\\\n\x04Type\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03NUM\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\x12\n\x0e\x45VENTED_STRING\x10\x04\x12\x0f\n\x0b\x45VENTED_NUM\x10\x05\x12\x10\n\x0c\x45VENTED_BOOL\x10\x06\x42\x1c\n\ncom.openxcB\x0e\x42inaryMessages') @@ -75,8 +75,8 @@ _TRANSLATEDMESSAGE_TYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=713, - serialized_end=805, + serialized_start=728, + serialized_end=820, ) @@ -228,6 +228,13 @@ _DIAGNOSTICMESSAGE = _descriptor.Descriptor( message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='value', full_name='openxc.DiagnosticMessage.value', index=7, + number=8, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), ], extensions=[ ], @@ -238,7 +245,7 @@ _DIAGNOSTICMESSAGE = _descriptor.Descriptor( is_extendable=False, extension_ranges=[], serialized_start=348, - serialized_end=493, + serialized_end=508, ) @@ -315,8 +322,8 @@ _TRANSLATEDMESSAGE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=496, - serialized_end=805, + serialized_start=511, + serialized_end=820, ) _VEHICLEMESSAGE.fields_by_name['type'].enum_type = _VEHICLEMESSAGE_TYPE diff --git a/openxc.proto b/openxc.proto index a825e1c3..a562b49d 100644 --- a/openxc.proto +++ b/openxc.proto @@ -28,6 +28,7 @@ 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 TranslatedMessage {