From 3e91f2023d1161432605aff4af6616a589e63b5c Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Tue, 4 Mar 2014 15:28:14 -0500 Subject: Condense string/number/bool trio into a field. --- gen/cpp/openxc.pb | 25 +- gen/cpp/openxc.pb.c | 24 +- gen/cpp/openxc.pb.h | 73 +- gen/java/com/openxc/BinaryMessages.java | 1608 +++++++++++++++++++++---------- gen/python/openxc_pb2.py | 112 ++- openxc.options | 3 +- openxc.proto | 19 +- 7 files changed, 1261 insertions(+), 603 deletions(-) diff --git a/gen/cpp/openxc.pb b/gen/cpp/openxc.pb index 50591abc..ada75a1f 100644 --- a/gen/cpp/openxc.pb +++ b/gen/cpp/openxc.pb @@ -1,5 +1,6 @@ -ñ +Ø + openxc.protoopenxc"Ë VehicleMessage) type (2.openxc.VehicleMessage.Type' @@ -48,16 +49,22 @@ message_id (  success ( negative_response_code (  payload (  -value ("µ +value ("¢ + DynamicField' +type (2.openxc.DynamicField.Type + string_value (  + numeric_value ( + boolean_value ("% +Type + +STRING +NUM +BOOL"÷ TranslatedMessage, type (2.openxc.TranslatedMessage.Type -name (  - string_value (  - numeric_value ( - boolean_value ( - string_event (  - numeric_event ( - boolean_event ("\ +name ( # +value ( 2.openxc.DynamicField# +event ( 2.openxc.DynamicField"\ Type STRING diff --git a/gen/cpp/openxc.pb.c b/gen/cpp/openxc.pb.c index 4f1fa5a3..72f1ce6a 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 Tue Mar 4 12:52:45 2014. */ +/* Generated by nanopb-0.2.5 at Tue Mar 4 15:25:22 2014. */ #include "openxc.pb.h" @@ -52,26 +52,30 @@ const pb_field_t openxc_DiagnosticResponse_fields[9] = { PB_LAST_FIELD }; -const pb_field_t openxc_TranslatedMessage_fields[9] = { +const pb_field_t openxc_DynamicField_fields[5] = { + PB_FIELD2( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_DynamicField, type, type, 0), + PB_FIELD2( 2, STRING , OPTIONAL, STATIC , OTHER, openxc_DynamicField, string_value, type, 0), + PB_FIELD2( 3, DOUBLE , OPTIONAL, STATIC , OTHER, openxc_DynamicField, numeric_value, string_value, 0), + PB_FIELD2( 4, BOOL , OPTIONAL, STATIC , OTHER, openxc_DynamicField, boolean_value, numeric_value, 0), + PB_LAST_FIELD +}; + +const pb_field_t openxc_TranslatedMessage_fields[5] = { PB_FIELD2( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_TranslatedMessage, type, type, 0), PB_FIELD2( 2, STRING , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, name, type, 0), - PB_FIELD2( 3, STRING , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, string_value, name, 0), - PB_FIELD2( 4, DOUBLE , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, numeric_value, string_value, 0), - PB_FIELD2( 5, BOOL , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, boolean_value, numeric_value, 0), - PB_FIELD2( 6, STRING , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, string_event, boolean_value, 0), - PB_FIELD2( 7, DOUBLE , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, numeric_event, string_event, 0), - PB_FIELD2( 8, BOOL , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, boolean_event, numeric_event, 0), + PB_FIELD2( 3, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, value, name, &openxc_DynamicField_fields), + PB_FIELD2( 4, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, event, value, &openxc_DynamicField_fields), PB_LAST_FIELD }; /* Check that field information fits in pb_field_t */ #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, raw_message) < 256 && pb_membersize(openxc_VehicleMessage, translated_message) < 256 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 256 && pb_membersize(openxc_VehicleMessage, control_command) < 256 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_RawMessage_openxc_ControlCommand_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_TranslatedMessage) +STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, raw_message) < 256 && pb_membersize(openxc_VehicleMessage, translated_message) < 256 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 256 && pb_membersize(openxc_VehicleMessage, control_command) < 256 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 256 && pb_membersize(openxc_TranslatedMessage, value) < 256 && pb_membersize(openxc_TranslatedMessage, event) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_RawMessage_openxc_ControlCommand_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_DynamicField_openxc_TranslatedMessage) #endif #if !defined(PB_FIELD_32BIT) -STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, raw_message) < 65536 && pb_membersize(openxc_VehicleMessage, translated_message) < 65536 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 65536 && pb_membersize(openxc_VehicleMessage, control_command) < 65536 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_RawMessage_openxc_ControlCommand_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_TranslatedMessage) +STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, raw_message) < 65536 && pb_membersize(openxc_VehicleMessage, translated_message) < 65536 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 65536 && pb_membersize(openxc_VehicleMessage, control_command) < 65536 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 65536 && pb_membersize(openxc_TranslatedMessage, value) < 65536 && pb_membersize(openxc_TranslatedMessage, event) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_RawMessage_openxc_ControlCommand_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_DynamicField_openxc_TranslatedMessage) #endif /* On some platforms (such as AVR), double is really float. diff --git a/gen/cpp/openxc.pb.h b/gen/cpp/openxc.pb.h index 3363d474..e9c01935 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 Tue Mar 4 12:52:45 2014. */ +/* Generated by nanopb-0.2.5 at Tue Mar 4 15:25:22 2014. */ #ifndef _PB_OPENXC_PB_H_ #define _PB_OPENXC_PB_H_ @@ -23,6 +23,12 @@ typedef enum _openxc_ControlCommand_Type { openxc_ControlCommand_Type_DIAGNOSTIC = 3 } openxc_ControlCommand_Type; +typedef enum _openxc_DynamicField_Type { + openxc_DynamicField_Type_STRING = 1, + openxc_DynamicField_Type_NUM = 2, + openxc_DynamicField_Type_BOOL = 3 +} openxc_DynamicField_Type; + typedef enum _openxc_TranslatedMessage_Type { openxc_TranslatedMessage_Type_STRING = 1, openxc_TranslatedMessage_Type_NUM = 2, @@ -83,6 +89,17 @@ typedef struct _openxc_DiagnosticResponse { double value; } openxc_DiagnosticResponse; +typedef struct _openxc_DynamicField { + bool has_type; + openxc_DynamicField_Type type; + bool has_string_value; + char string_value[100]; + bool has_numeric_value; + double numeric_value; + bool has_boolean_value; + bool boolean_value; +} openxc_DynamicField; + typedef struct { size_t size; uint8_t bytes[8]; @@ -97,25 +114,6 @@ typedef struct _openxc_RawMessage { openxc_RawMessage_data_t data; } openxc_RawMessage; -typedef struct _openxc_TranslatedMessage { - bool has_type; - openxc_TranslatedMessage_Type type; - bool has_name; - char name[100]; - bool has_string_value; - char string_value[100]; - bool has_numeric_value; - double numeric_value; - bool has_boolean_value; - bool boolean_value; - bool has_string_event; - char string_event[100]; - bool has_numeric_event; - double numeric_event; - bool has_boolean_event; - bool boolean_event; -} openxc_TranslatedMessage; - typedef struct _openxc_ControlCommand { bool has_type; openxc_ControlCommand_Type type; @@ -123,6 +121,17 @@ typedef struct _openxc_ControlCommand { openxc_DiagnosticRequest diagnostic_request; } openxc_ControlCommand; +typedef struct _openxc_TranslatedMessage { + bool has_type; + openxc_TranslatedMessage_Type type; + bool has_name; + char name[100]; + bool has_value; + openxc_DynamicField value; + bool has_event; + openxc_DynamicField event; +} openxc_TranslatedMessage; + typedef struct _openxc_VehicleMessage { bool has_type; openxc_VehicleMessage_Type type; @@ -156,19 +165,19 @@ 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_DynamicField_type_tag 1 +#define openxc_DynamicField_string_value_tag 2 +#define openxc_DynamicField_numeric_value_tag 3 +#define openxc_DynamicField_boolean_value_tag 4 #define openxc_RawMessage_bus_tag 1 #define openxc_RawMessage_message_id_tag 2 #define openxc_RawMessage_data_tag 3 -#define openxc_TranslatedMessage_type_tag 1 -#define openxc_TranslatedMessage_name_tag 2 -#define openxc_TranslatedMessage_string_value_tag 3 -#define openxc_TranslatedMessage_numeric_value_tag 4 -#define openxc_TranslatedMessage_boolean_value_tag 5 -#define openxc_TranslatedMessage_string_event_tag 6 -#define openxc_TranslatedMessage_numeric_event_tag 7 -#define openxc_TranslatedMessage_boolean_event_tag 8 #define openxc_ControlCommand_type_tag 1 #define openxc_ControlCommand_diagnostic_request_tag 2 +#define openxc_TranslatedMessage_type_tag 1 +#define openxc_TranslatedMessage_name_tag 2 +#define openxc_TranslatedMessage_value_tag 3 +#define openxc_TranslatedMessage_event_tag 4 #define openxc_VehicleMessage_type_tag 1 #define openxc_VehicleMessage_raw_message_tag 2 #define openxc_VehicleMessage_translated_message_tag 3 @@ -181,15 +190,17 @@ extern const pb_field_t openxc_RawMessage_fields[4]; extern const pb_field_t openxc_ControlCommand_fields[3]; extern const pb_field_t openxc_DiagnosticRequest_fields[10]; extern const pb_field_t openxc_DiagnosticResponse_fields[9]; -extern const pb_field_t openxc_TranslatedMessage_fields[9]; +extern const pb_field_t openxc_DynamicField_fields[5]; +extern const pb_field_t openxc_TranslatedMessage_fields[5]; /* Maximum encoded size of messages (where known) */ -#define openxc_VehicleMessage_size 508 +#define openxc_VehicleMessage_size 524 #define openxc_RawMessage_size 27 #define openxc_ControlCommand_size 76 #define openxc_DiagnosticRequest_size 68 #define openxc_DiagnosticResponse_size 56 -#define openxc_TranslatedMessage_size 334 +#define openxc_DynamicField_size 119 +#define openxc_TranslatedMessage_size 350 #ifdef __cplusplus } /* extern "C" */ diff --git a/gen/java/com/openxc/BinaryMessages.java b/gen/java/com/openxc/BinaryMessages.java index dc44febc..28322449 100644 --- a/gen/java/com/openxc/BinaryMessages.java +++ b/gen/java/com/openxc/BinaryMessages.java @@ -4623,6 +4623,820 @@ public final class BinaryMessages { // @@protoc_insertion_point(class_scope:openxc.DiagnosticResponse) } + public interface DynamicFieldOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional .openxc.DynamicField.Type type = 1; + /** + * optional .openxc.DynamicField.Type type = 1; + */ + boolean hasType(); + /** + * optional .openxc.DynamicField.Type type = 1; + */ + com.openxc.BinaryMessages.DynamicField.Type getType(); + + // optional string string_value = 2; + /** + * optional string string_value = 2; + */ + boolean hasStringValue(); + /** + * optional string string_value = 2; + */ + java.lang.String getStringValue(); + /** + * optional string string_value = 2; + */ + com.google.protobuf.ByteString + getStringValueBytes(); + + // optional double numeric_value = 3; + /** + * optional double numeric_value = 3; + */ + boolean hasNumericValue(); + /** + * optional double numeric_value = 3; + */ + double getNumericValue(); + + // optional bool boolean_value = 4; + /** + * optional bool boolean_value = 4; + */ + boolean hasBooleanValue(); + /** + * optional bool boolean_value = 4; + */ + boolean getBooleanValue(); + } + /** + * Protobuf type {@code openxc.DynamicField} + */ + public static final class DynamicField extends + com.google.protobuf.GeneratedMessage + implements DynamicFieldOrBuilder { + // Use DynamicField.newBuilder() to construct. + private DynamicField(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private DynamicField(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final DynamicField defaultInstance; + public static DynamicField getDefaultInstance() { + return defaultInstance; + } + + public DynamicField getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DynamicField( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + com.openxc.BinaryMessages.DynamicField.Type value = com.openxc.BinaryMessages.DynamicField.Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = value; + } + break; + } + case 18: { + bitField0_ |= 0x00000002; + stringValue_ = input.readBytes(); + break; + } + case 25: { + bitField0_ |= 0x00000004; + numericValue_ = input.readDouble(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + booleanValue_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openxc.BinaryMessages.internal_static_openxc_DynamicField_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openxc.BinaryMessages.internal_static_openxc_DynamicField_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openxc.BinaryMessages.DynamicField.class, com.openxc.BinaryMessages.DynamicField.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public DynamicField parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DynamicField(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code openxc.DynamicField.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + * STRING = 1; + */ + STRING(0, 1), + /** + * NUM = 2; + */ + NUM(1, 2), + /** + * BOOL = 3; + */ + BOOL(2, 3), + ; + + /** + * STRING = 1; + */ + public static final int STRING_VALUE = 1; + /** + * NUM = 2; + */ + public static final int NUM_VALUE = 2; + /** + * BOOL = 3; + */ + public static final int BOOL_VALUE = 3; + + + public final int getNumber() { return value; } + + public static Type valueOf(int value) { + switch (value) { + case 1: return STRING; + case 2: return NUM; + case 3: return BOOL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.openxc.BinaryMessages.DynamicField.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private Type(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:openxc.DynamicField.Type) + } + + private int bitField0_; + // optional .openxc.DynamicField.Type type = 1; + public static final int TYPE_FIELD_NUMBER = 1; + private com.openxc.BinaryMessages.DynamicField.Type type_; + /** + * optional .openxc.DynamicField.Type type = 1; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .openxc.DynamicField.Type type = 1; + */ + public com.openxc.BinaryMessages.DynamicField.Type getType() { + return type_; + } + + // optional string string_value = 2; + public static final int STRING_VALUE_FIELD_NUMBER = 2; + private java.lang.Object stringValue_; + /** + * optional string string_value = 2; + */ + public boolean hasStringValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string string_value = 2; + */ + public java.lang.String getStringValue() { + java.lang.Object ref = stringValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + stringValue_ = s; + } + return s; + } + } + /** + * optional string string_value = 2; + */ + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = stringValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stringValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional double numeric_value = 3; + public static final int NUMERIC_VALUE_FIELD_NUMBER = 3; + private double numericValue_; + /** + * optional double numeric_value = 3; + */ + public boolean hasNumericValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional double numeric_value = 3; + */ + public double getNumericValue() { + return numericValue_; + } + + // optional bool boolean_value = 4; + public static final int BOOLEAN_VALUE_FIELD_NUMBER = 4; + private boolean booleanValue_; + /** + * optional bool boolean_value = 4; + */ + public boolean hasBooleanValue() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional bool boolean_value = 4; + */ + public boolean getBooleanValue() { + return booleanValue_; + } + + private void initFields() { + type_ = com.openxc.BinaryMessages.DynamicField.Type.STRING; + stringValue_ = ""; + numericValue_ = 0D; + booleanValue_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, type_.getNumber()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getStringValueBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeDouble(3, numericValue_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBool(4, booleanValue_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_.getNumber()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getStringValueBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, numericValue_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, booleanValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.openxc.BinaryMessages.DynamicField parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openxc.BinaryMessages.DynamicField parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openxc.BinaryMessages.DynamicField parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openxc.BinaryMessages.DynamicField parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openxc.BinaryMessages.DynamicField parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.openxc.BinaryMessages.DynamicField parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.openxc.BinaryMessages.DynamicField parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.openxc.BinaryMessages.DynamicField parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.openxc.BinaryMessages.DynamicField parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.openxc.BinaryMessages.DynamicField parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.openxc.BinaryMessages.DynamicField prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code openxc.DynamicField} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements com.openxc.BinaryMessages.DynamicFieldOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openxc.BinaryMessages.internal_static_openxc_DynamicField_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openxc.BinaryMessages.internal_static_openxc_DynamicField_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openxc.BinaryMessages.DynamicField.class, com.openxc.BinaryMessages.DynamicField.Builder.class); + } + + // Construct using com.openxc.BinaryMessages.DynamicField.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + type_ = com.openxc.BinaryMessages.DynamicField.Type.STRING; + bitField0_ = (bitField0_ & ~0x00000001); + stringValue_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + numericValue_ = 0D; + bitField0_ = (bitField0_ & ~0x00000004); + booleanValue_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openxc.BinaryMessages.internal_static_openxc_DynamicField_descriptor; + } + + public com.openxc.BinaryMessages.DynamicField getDefaultInstanceForType() { + return com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); + } + + public com.openxc.BinaryMessages.DynamicField build() { + com.openxc.BinaryMessages.DynamicField result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.openxc.BinaryMessages.DynamicField buildPartial() { + com.openxc.BinaryMessages.DynamicField result = new com.openxc.BinaryMessages.DynamicField(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.stringValue_ = stringValue_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.numericValue_ = numericValue_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.booleanValue_ = booleanValue_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openxc.BinaryMessages.DynamicField) { + return mergeFrom((com.openxc.BinaryMessages.DynamicField)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openxc.BinaryMessages.DynamicField other) { + if (other == com.openxc.BinaryMessages.DynamicField.getDefaultInstance()) return this; + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasStringValue()) { + bitField0_ |= 0x00000002; + stringValue_ = other.stringValue_; + onChanged(); + } + if (other.hasNumericValue()) { + setNumericValue(other.getNumericValue()); + } + if (other.hasBooleanValue()) { + setBooleanValue(other.getBooleanValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.openxc.BinaryMessages.DynamicField parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.openxc.BinaryMessages.DynamicField) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional .openxc.DynamicField.Type type = 1; + private com.openxc.BinaryMessages.DynamicField.Type type_ = com.openxc.BinaryMessages.DynamicField.Type.STRING; + /** + * optional .openxc.DynamicField.Type type = 1; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .openxc.DynamicField.Type type = 1; + */ + public com.openxc.BinaryMessages.DynamicField.Type getType() { + return type_; + } + /** + * optional .openxc.DynamicField.Type type = 1; + */ + public Builder setType(com.openxc.BinaryMessages.DynamicField.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value; + onChanged(); + return this; + } + /** + * optional .openxc.DynamicField.Type type = 1; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = com.openxc.BinaryMessages.DynamicField.Type.STRING; + onChanged(); + return this; + } + + // optional string string_value = 2; + private java.lang.Object stringValue_ = ""; + /** + * optional string string_value = 2; + */ + public boolean hasStringValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string string_value = 2; + */ + public java.lang.String getStringValue() { + java.lang.Object ref = stringValue_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + stringValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string string_value = 2; + */ + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = stringValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + stringValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string string_value = 2; + */ + public Builder setStringValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + stringValue_ = value; + onChanged(); + return this; + } + /** + * optional string string_value = 2; + */ + public Builder clearStringValue() { + bitField0_ = (bitField0_ & ~0x00000002); + stringValue_ = getDefaultInstance().getStringValue(); + onChanged(); + return this; + } + /** + * optional string string_value = 2; + */ + public Builder setStringValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + stringValue_ = value; + onChanged(); + return this; + } + + // optional double numeric_value = 3; + private double numericValue_ ; + /** + * optional double numeric_value = 3; + */ + public boolean hasNumericValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional double numeric_value = 3; + */ + public double getNumericValue() { + return numericValue_; + } + /** + * optional double numeric_value = 3; + */ + public Builder setNumericValue(double value) { + bitField0_ |= 0x00000004; + numericValue_ = value; + onChanged(); + return this; + } + /** + * optional double numeric_value = 3; + */ + public Builder clearNumericValue() { + bitField0_ = (bitField0_ & ~0x00000004); + numericValue_ = 0D; + onChanged(); + return this; + } + + // optional bool boolean_value = 4; + private boolean booleanValue_ ; + /** + * optional bool boolean_value = 4; + */ + public boolean hasBooleanValue() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional bool boolean_value = 4; + */ + public boolean getBooleanValue() { + return booleanValue_; + } + /** + * optional bool boolean_value = 4; + */ + public Builder setBooleanValue(boolean value) { + bitField0_ |= 0x00000008; + booleanValue_ = value; + onChanged(); + return this; + } + /** + * optional bool boolean_value = 4; + */ + public Builder clearBooleanValue() { + bitField0_ = (bitField0_ & ~0x00000008); + booleanValue_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:openxc.DynamicField) + } + + static { + defaultInstance = new DynamicField(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:openxc.DynamicField) + } + public interface TranslatedMessageOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -4651,75 +5465,33 @@ public final class BinaryMessages { com.google.protobuf.ByteString getNameBytes(); - // optional string string_value = 3; - /** - * optional string string_value = 3; - */ - boolean hasStringValue(); - /** - * optional string string_value = 3; - */ - java.lang.String getStringValue(); - /** - * optional string string_value = 3; - */ - com.google.protobuf.ByteString - getStringValueBytes(); - - // optional double numeric_value = 4; - /** - * optional double numeric_value = 4; - */ - boolean hasNumericValue(); - /** - * optional double numeric_value = 4; - */ - double getNumericValue(); - - // optional bool boolean_value = 5; - /** - * optional bool boolean_value = 5; - */ - boolean hasBooleanValue(); - /** - * optional bool boolean_value = 5; - */ - boolean getBooleanValue(); - - // optional string string_event = 6; + // optional .openxc.DynamicField value = 3; /** - * optional string string_event = 6; + * optional .openxc.DynamicField value = 3; */ - boolean hasStringEvent(); + boolean hasValue(); /** - * optional string string_event = 6; + * optional .openxc.DynamicField value = 3; */ - java.lang.String getStringEvent(); + com.openxc.BinaryMessages.DynamicField getValue(); /** - * optional string string_event = 6; + * optional .openxc.DynamicField value = 3; */ - com.google.protobuf.ByteString - getStringEventBytes(); + com.openxc.BinaryMessages.DynamicFieldOrBuilder getValueOrBuilder(); - // optional double numeric_event = 7; - /** - * optional double numeric_event = 7; - */ - boolean hasNumericEvent(); + // optional .openxc.DynamicField event = 4; /** - * optional double numeric_event = 7; + * optional .openxc.DynamicField event = 4; */ - double getNumericEvent(); - - // optional bool boolean_event = 8; + boolean hasEvent(); /** - * optional bool boolean_event = 8; + * optional .openxc.DynamicField event = 4; */ - boolean hasBooleanEvent(); + com.openxc.BinaryMessages.DynamicField getEvent(); /** - * optional bool boolean_event = 8; + * optional .openxc.DynamicField event = 4; */ - boolean getBooleanEvent(); + com.openxc.BinaryMessages.DynamicFieldOrBuilder getEventOrBuilder(); } /** * Protobuf type {@code openxc.TranslatedMessage} @@ -4789,33 +5561,29 @@ public final class BinaryMessages { break; } case 26: { + com.openxc.BinaryMessages.DynamicField.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = value_.toBuilder(); + } + value_ = input.readMessage(com.openxc.BinaryMessages.DynamicField.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(value_); + value_ = subBuilder.buildPartial(); + } bitField0_ |= 0x00000004; - stringValue_ = input.readBytes(); break; } - case 33: { + case 34: { + com.openxc.BinaryMessages.DynamicField.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(com.openxc.BinaryMessages.DynamicField.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } bitField0_ |= 0x00000008; - numericValue_ = input.readDouble(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - booleanValue_ = input.readBool(); - break; - } - case 50: { - bitField0_ |= 0x00000020; - stringEvent_ = input.readBytes(); - break; - } - case 57: { - bitField0_ |= 0x00000040; - numericEvent_ = input.readDouble(); - break; - } - case 64: { - bitField0_ |= 0x00000080; - booleanEvent_ = input.readBool(); break; } } @@ -5035,165 +5803,55 @@ public final class BinaryMessages { } } - // optional string string_value = 3; - public static final int STRING_VALUE_FIELD_NUMBER = 3; - private java.lang.Object stringValue_; + // optional .openxc.DynamicField value = 3; + public static final int VALUE_FIELD_NUMBER = 3; + private com.openxc.BinaryMessages.DynamicField value_; /** - * optional string string_value = 3; + * optional .openxc.DynamicField value = 3; */ - public boolean hasStringValue() { + public boolean hasValue() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional string string_value = 3; + * optional .openxc.DynamicField value = 3; */ - public java.lang.String getStringValue() { - java.lang.Object ref = stringValue_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - stringValue_ = s; - } - return s; - } + public com.openxc.BinaryMessages.DynamicField getValue() { + return value_; } /** - * optional string string_value = 3; + * optional .openxc.DynamicField value = 3; */ - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = stringValue_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - stringValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public com.openxc.BinaryMessages.DynamicFieldOrBuilder getValueOrBuilder() { + return value_; } - // optional double numeric_value = 4; - public static final int NUMERIC_VALUE_FIELD_NUMBER = 4; - private double numericValue_; + // optional .openxc.DynamicField event = 4; + public static final int EVENT_FIELD_NUMBER = 4; + private com.openxc.BinaryMessages.DynamicField event_; /** - * optional double numeric_value = 4; + * optional .openxc.DynamicField event = 4; */ - public boolean hasNumericValue() { + public boolean hasEvent() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional double numeric_value = 4; - */ - public double getNumericValue() { - return numericValue_; - } - - // optional bool boolean_value = 5; - public static final int BOOLEAN_VALUE_FIELD_NUMBER = 5; - private boolean booleanValue_; - /** - * optional bool boolean_value = 5; - */ - public boolean hasBooleanValue() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional bool boolean_value = 5; - */ - public boolean getBooleanValue() { - return booleanValue_; - } - - // optional string string_event = 6; - public static final int STRING_EVENT_FIELD_NUMBER = 6; - private java.lang.Object stringEvent_; - /** - * optional string string_event = 6; - */ - public boolean hasStringEvent() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional string string_event = 6; - */ - public java.lang.String getStringEvent() { - java.lang.Object ref = stringEvent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - stringEvent_ = s; - } - return s; - } - } - /** - * optional string string_event = 6; - */ - public com.google.protobuf.ByteString - getStringEventBytes() { - java.lang.Object ref = stringEvent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - stringEvent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // optional double numeric_event = 7; - public static final int NUMERIC_EVENT_FIELD_NUMBER = 7; - private double numericEvent_; - /** - * optional double numeric_event = 7; - */ - public boolean hasNumericEvent() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional double numeric_event = 7; - */ - public double getNumericEvent() { - return numericEvent_; - } - - // optional bool boolean_event = 8; - public static final int BOOLEAN_EVENT_FIELD_NUMBER = 8; - private boolean booleanEvent_; - /** - * optional bool boolean_event = 8; + * optional .openxc.DynamicField event = 4; */ - public boolean hasBooleanEvent() { - return ((bitField0_ & 0x00000080) == 0x00000080); + public com.openxc.BinaryMessages.DynamicField getEvent() { + return event_; } /** - * optional bool boolean_event = 8; + * optional .openxc.DynamicField event = 4; */ - public boolean getBooleanEvent() { - return booleanEvent_; + public com.openxc.BinaryMessages.DynamicFieldOrBuilder getEventOrBuilder() { + return event_; } private void initFields() { type_ = com.openxc.BinaryMessages.TranslatedMessage.Type.STRING; name_ = ""; - stringValue_ = ""; - numericValue_ = 0D; - booleanValue_ = false; - stringEvent_ = ""; - numericEvent_ = 0D; - booleanEvent_ = false; + value_ = com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); + event_ = com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -5214,22 +5872,10 @@ public final class BinaryMessages { output.writeBytes(2, getNameBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getStringValueBytes()); + output.writeMessage(3, value_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeDouble(4, numericValue_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBool(5, booleanValue_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBytes(6, getStringEventBytes()); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeDouble(7, numericEvent_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeBool(8, booleanEvent_); + output.writeMessage(4, event_); } getUnknownFields().writeTo(output); } @@ -5238,39 +5884,23 @@ public final class BinaryMessages { public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, type_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getNameBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getStringValueBytes()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(4, numericValue_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, booleanValue_); + .computeEnumSize(1, type_.getNumber()); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(6, getStringEventBytes()); + .computeBytesSize(2, getNameBytes()); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(7, numericEvent_); + .computeMessageSize(3, value_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, booleanEvent_); + .computeMessageSize(4, event_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -5380,6 +6010,8 @@ public final class BinaryMessages { } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getValueFieldBuilder(); + getEventFieldBuilder(); } } private static Builder create() { @@ -5392,18 +6024,18 @@ public final class BinaryMessages { bitField0_ = (bitField0_ & ~0x00000001); name_ = ""; bitField0_ = (bitField0_ & ~0x00000002); - stringValue_ = ""; + if (valueBuilder_ == null) { + value_ = com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); + } else { + valueBuilder_.clear(); + } bitField0_ = (bitField0_ & ~0x00000004); - numericValue_ = 0D; + if (eventBuilder_ == null) { + event_ = com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); + } else { + eventBuilder_.clear(); + } bitField0_ = (bitField0_ & ~0x00000008); - booleanValue_ = false; - bitField0_ = (bitField0_ & ~0x00000010); - stringEvent_ = ""; - bitField0_ = (bitField0_ & ~0x00000020); - numericEvent_ = 0D; - bitField0_ = (bitField0_ & ~0x00000040); - booleanEvent_ = false; - bitField0_ = (bitField0_ & ~0x00000080); return this; } @@ -5443,27 +6075,19 @@ public final class BinaryMessages { if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - result.stringValue_ = stringValue_; + if (valueBuilder_ == null) { + result.value_ = value_; + } else { + result.value_ = valueBuilder_.build(); + } if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } - result.numericValue_ = numericValue_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.booleanValue_ = booleanValue_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.stringEvent_ = stringEvent_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - result.numericEvent_ = numericEvent_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); } - result.booleanEvent_ = booleanEvent_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -5488,27 +6112,11 @@ public final class BinaryMessages { name_ = other.name_; onChanged(); } - if (other.hasStringValue()) { - bitField0_ |= 0x00000004; - stringValue_ = other.stringValue_; - onChanged(); - } - if (other.hasNumericValue()) { - setNumericValue(other.getNumericValue()); - } - if (other.hasBooleanValue()) { - setBooleanValue(other.getBooleanValue()); - } - if (other.hasStringEvent()) { - bitField0_ |= 0x00000020; - stringEvent_ = other.stringEvent_; - onChanged(); - } - if (other.hasNumericEvent()) { - setNumericEvent(other.getNumericEvent()); + if (other.hasValue()) { + mergeValue(other.getValue()); } - if (other.hasBooleanEvent()) { - setBooleanEvent(other.getBooleanEvent()); + if (other.hasEvent()) { + mergeEvent(other.getEvent()); } this.mergeUnknownFields(other.getUnknownFields()); return this; @@ -5647,284 +6255,238 @@ public final class BinaryMessages { return this; } - // optional string string_value = 3; - private java.lang.Object stringValue_ = ""; + // optional .openxc.DynamicField value = 3; + private com.openxc.BinaryMessages.DynamicField value_ = com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + com.openxc.BinaryMessages.DynamicField, com.openxc.BinaryMessages.DynamicField.Builder, com.openxc.BinaryMessages.DynamicFieldOrBuilder> valueBuilder_; /** - * optional string string_value = 3; + * optional .openxc.DynamicField value = 3; */ - public boolean hasStringValue() { + public boolean hasValue() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional string string_value = 3; + * optional .openxc.DynamicField value = 3; */ - public java.lang.String getStringValue() { - java.lang.Object ref = stringValue_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - stringValue_ = s; - return s; + public com.openxc.BinaryMessages.DynamicField getValue() { + if (valueBuilder_ == null) { + return value_; } else { - return (java.lang.String) ref; + return valueBuilder_.getMessage(); } } /** - * optional string string_value = 3; + * optional .openxc.DynamicField value = 3; */ - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = stringValue_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - stringValue_ = b; - return b; + public Builder setValue(com.openxc.BinaryMessages.DynamicField value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + valueBuilder_.setMessage(value); } - } - /** - * optional string string_value = 3; - */ - public Builder setStringValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - stringValue_ = value; - onChanged(); + bitField0_ |= 0x00000004; return this; } /** - * optional string string_value = 3; + * optional .openxc.DynamicField value = 3; */ - public Builder clearStringValue() { - bitField0_ = (bitField0_ & ~0x00000004); - stringValue_ = getDefaultInstance().getStringValue(); - onChanged(); + public Builder setValue( + com.openxc.BinaryMessages.DynamicField.Builder builderForValue) { + if (valueBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; return this; } /** - * optional string string_value = 3; + * optional .openxc.DynamicField value = 3; */ - public Builder setStringValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - stringValue_ = value; - onChanged(); + public Builder mergeValue(com.openxc.BinaryMessages.DynamicField value) { + if (valueBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + value_ != com.openxc.BinaryMessages.DynamicField.getDefaultInstance()) { + value_ = + com.openxc.BinaryMessages.DynamicField.newBuilder(value_).mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + valueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; return this; } - - // optional double numeric_value = 4; - private double numericValue_ ; - /** - * optional double numeric_value = 4; - */ - public boolean hasNumericValue() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } /** - * optional double numeric_value = 4; + * optional .openxc.DynamicField value = 3; */ - public double getNumericValue() { - return numericValue_; - } - /** - * optional double numeric_value = 4; - */ - public Builder setNumericValue(double value) { - bitField0_ |= 0x00000008; - numericValue_ = value; - onChanged(); + public Builder clearValue() { + if (valueBuilder_ == null) { + value_ = com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); + onChanged(); + } else { + valueBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); return this; } /** - * optional double numeric_value = 4; + * optional .openxc.DynamicField value = 3; */ - public Builder clearNumericValue() { - bitField0_ = (bitField0_ & ~0x00000008); - numericValue_ = 0D; + public com.openxc.BinaryMessages.DynamicField.Builder getValueBuilder() { + bitField0_ |= 0x00000004; onChanged(); - return this; - } - - // optional bool boolean_value = 5; - private boolean booleanValue_ ; - /** - * optional bool boolean_value = 5; - */ - public boolean hasBooleanValue() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional bool boolean_value = 5; - */ - public boolean getBooleanValue() { - return booleanValue_; + return getValueFieldBuilder().getBuilder(); } /** - * optional bool boolean_value = 5; + * optional .openxc.DynamicField value = 3; */ - public Builder setBooleanValue(boolean value) { - bitField0_ |= 0x00000010; - booleanValue_ = value; - onChanged(); - return this; + public com.openxc.BinaryMessages.DynamicFieldOrBuilder getValueOrBuilder() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilder(); + } else { + return value_; + } } /** - * optional bool boolean_value = 5; + * optional .openxc.DynamicField value = 3; */ - public Builder clearBooleanValue() { - bitField0_ = (bitField0_ & ~0x00000010); - booleanValue_ = false; - onChanged(); - return this; + private com.google.protobuf.SingleFieldBuilder< + com.openxc.BinaryMessages.DynamicField, com.openxc.BinaryMessages.DynamicField.Builder, com.openxc.BinaryMessages.DynamicFieldOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openxc.BinaryMessages.DynamicField, com.openxc.BinaryMessages.DynamicField.Builder, com.openxc.BinaryMessages.DynamicFieldOrBuilder>( + value_, + getParentForChildren(), + isClean()); + value_ = null; + } + return valueBuilder_; } - // optional string string_event = 6; - private java.lang.Object stringEvent_ = ""; + // optional .openxc.DynamicField event = 4; + private com.openxc.BinaryMessages.DynamicField event_ = com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + com.openxc.BinaryMessages.DynamicField, com.openxc.BinaryMessages.DynamicField.Builder, com.openxc.BinaryMessages.DynamicFieldOrBuilder> eventBuilder_; /** - * optional string string_event = 6; + * optional .openxc.DynamicField event = 4; */ - public boolean hasStringEvent() { - return ((bitField0_ & 0x00000020) == 0x00000020); + public boolean hasEvent() { + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional string string_event = 6; + * optional .openxc.DynamicField event = 4; */ - public java.lang.String getStringEvent() { - java.lang.Object ref = stringEvent_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - stringEvent_ = s; - return s; + public com.openxc.BinaryMessages.DynamicField getEvent() { + if (eventBuilder_ == null) { + return event_; } else { - return (java.lang.String) ref; + return eventBuilder_.getMessage(); } } /** - * optional string string_event = 6; + * optional .openxc.DynamicField event = 4; */ - public com.google.protobuf.ByteString - getStringEventBytes() { - java.lang.Object ref = stringEvent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - stringEvent_ = b; - return b; + public Builder setEvent(com.openxc.BinaryMessages.DynamicField value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + eventBuilder_.setMessage(value); } - } - /** - * optional string string_event = 6; - */ - public Builder setStringEvent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - stringEvent_ = value; - onChanged(); + bitField0_ |= 0x00000008; return this; } /** - * optional string string_event = 6; + * optional .openxc.DynamicField event = 4; */ - public Builder clearStringEvent() { - bitField0_ = (bitField0_ & ~0x00000020); - stringEvent_ = getDefaultInstance().getStringEvent(); - onChanged(); + public Builder setEvent( + com.openxc.BinaryMessages.DynamicField.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; return this; } /** - * optional string string_event = 6; + * optional .openxc.DynamicField event = 4; */ - public Builder setStringEventBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - stringEvent_ = value; - onChanged(); + public Builder mergeEvent(com.openxc.BinaryMessages.DynamicField value) { + if (eventBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + event_ != com.openxc.BinaryMessages.DynamicField.getDefaultInstance()) { + event_ = + com.openxc.BinaryMessages.DynamicField.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; return this; } - - // optional double numeric_event = 7; - private double numericEvent_ ; - /** - * optional double numeric_event = 7; - */ - public boolean hasNumericEvent() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional double numeric_event = 7; - */ - public double getNumericEvent() { - return numericEvent_; - } /** - * optional double numeric_event = 7; + * optional .openxc.DynamicField event = 4; */ - public Builder setNumericEvent(double value) { - bitField0_ |= 0x00000040; - numericEvent_ = value; - onChanged(); + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = com.openxc.BinaryMessages.DynamicField.getDefaultInstance(); + onChanged(); + } else { + eventBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); return this; } /** - * optional double numeric_event = 7; + * optional .openxc.DynamicField event = 4; */ - public Builder clearNumericEvent() { - bitField0_ = (bitField0_ & ~0x00000040); - numericEvent_ = 0D; + public com.openxc.BinaryMessages.DynamicField.Builder getEventBuilder() { + bitField0_ |= 0x00000008; onChanged(); - return this; - } - - // optional bool boolean_event = 8; - private boolean booleanEvent_ ; - /** - * optional bool boolean_event = 8; - */ - public boolean hasBooleanEvent() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional bool boolean_event = 8; - */ - public boolean getBooleanEvent() { - return booleanEvent_; + return getEventFieldBuilder().getBuilder(); } /** - * optional bool boolean_event = 8; + * optional .openxc.DynamicField event = 4; */ - public Builder setBooleanEvent(boolean value) { - bitField0_ |= 0x00000080; - booleanEvent_ = value; - onChanged(); - return this; + public com.openxc.BinaryMessages.DynamicFieldOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_; + } } /** - * optional bool boolean_event = 8; + * optional .openxc.DynamicField event = 4; */ - public Builder clearBooleanEvent() { - bitField0_ = (bitField0_ & ~0x00000080); - booleanEvent_ = false; - onChanged(); - return this; + private com.google.protobuf.SingleFieldBuilder< + com.openxc.BinaryMessages.DynamicField, com.openxc.BinaryMessages.DynamicField.Builder, com.openxc.BinaryMessages.DynamicFieldOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openxc.BinaryMessages.DynamicField, com.openxc.BinaryMessages.DynamicField.Builder, com.openxc.BinaryMessages.DynamicFieldOrBuilder>( + event_, + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; } // @@protoc_insertion_point(builder_scope:openxc.TranslatedMessage) @@ -5963,6 +6525,11 @@ public final class BinaryMessages { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_openxc_DiagnosticResponse_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_openxc_DynamicField_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_openxc_DynamicField_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_openxc_TranslatedMessage_descriptor; private static @@ -6000,15 +6567,18 @@ public final class BinaryMessages { "essage_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\007payload\030\007 \001(\014\022\r\n\005value\030\010 " + - "\001(\001\"\265\002\n\021TranslatedMessage\022,\n\004type\030\001 \001(\0162" + - "\036.openxc.TranslatedMessage.Type\022\014\n\004name\030" + - "\002 \001(\t\022\024\n\014string_value\030\003 \001(\t\022\025\n\rnumeric_v" + - "alue\030\004 \001(\001\022\025\n\rboolean_value\030\005 \001(\010\022\024\n\014str" + - "ing_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\004BOOL\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\nc" + - "om.openxcB\016BinaryMessages" + "\001(\001\"\242\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\"%\n\004Type\022\n\n\006STRING\020\001\022\007\n\003NUM\020\002\022\010" + + "\n\004BOOL\020\003\"\367\001\n\021TranslatedMessage\022,\n\004type\030\001" + + " \001(\0162\036.openxc.TranslatedMessage.Type\022\014\n\004" + + "name\030\002 \001(\t\022#\n\005value\030\003 \001(\0132\024.openxc.Dynam", + "icField\022#\n\005event\030\004 \001(\0132\024.openxc.DynamicF" + + "ield\"\\\n\004Type\022\n\n\006STRING\020\001\022\007\n\003NUM\020\002\022\010\n\004BOO" + + "L\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\016Binary" + + "Messages" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -6045,12 +6615,18 @@ public final class BinaryMessages { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_openxc_DiagnosticResponse_descriptor, new java.lang.String[] { "Bus", "MessageId", "Mode", "Pid", "Success", "NegativeResponseCode", "Payload", "Value", }); - internal_static_openxc_TranslatedMessage_descriptor = + internal_static_openxc_DynamicField_descriptor = getDescriptor().getMessageTypes().get(5); + internal_static_openxc_DynamicField_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_openxc_DynamicField_descriptor, + new java.lang.String[] { "Type", "StringValue", "NumericValue", "BooleanValue", }); + internal_static_openxc_TranslatedMessage_descriptor = + getDescriptor().getMessageTypes().get(6); internal_static_openxc_TranslatedMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_openxc_TranslatedMessage_descriptor, - new java.lang.String[] { "Type", "Name", "StringValue", "NumericValue", "BooleanValue", "StringEvent", "NumericEvent", "BooleanEvent", }); + new java.lang.String[] { "Type", "Name", "Value", "Event", }); return null; } }; diff --git a/gen/python/openxc_pb2.py b/gen/python/openxc_pb2.py index d1ea5cff..00caddbf 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\"\xcb\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\x37\n\x13\x64iagnostic_response\x18\x04 \x01(\x0b\x32\x1a.openxc.DiagnosticResponse\x12/\n\x0f\x63ontrol_command\x18\x05 \x01(\x0b\x32\x16.openxc.ControlCommand\"D\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\x12\x13\n\x0f\x43ONTROL_COMMAND\x10\x04\";\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\"\xa6\x01\n\x0e\x43ontrolCommand\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12\x35\n\x12\x64iagnostic_request\x18\x02 \x01(\x0b\x32\x19.openxc.DiagnosticRequest\"2\n\x04Type\x12\x0b\n\x07VERSION\x10\x01\x12\r\n\tDEVICE_ID\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\"\xaa\x01\n\x11\x44iagnosticRequest\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\x07payload\x18\x05 \x01(\x0c\x12\x15\n\rparse_payload\x18\x06 \x01(\x08\x12\x0e\n\x06\x66\x61\x63tor\x18\x07 \x01(\x01\x12\x0e\n\x06offset\x18\x08 \x01(\x01\x12\x11\n\tfrequency\x18\t \x01(\x01\"\xa1\x01\n\x12\x44iagnosticResponse\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') + serialized_pb='\n\x0copenxc.proto\x12\x06openxc\"\xcb\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\x37\n\x13\x64iagnostic_response\x18\x04 \x01(\x0b\x32\x1a.openxc.DiagnosticResponse\x12/\n\x0f\x63ontrol_command\x18\x05 \x01(\x0b\x32\x16.openxc.ControlCommand\"D\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\x12\x13\n\x0f\x43ONTROL_COMMAND\x10\x04\";\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\"\xa6\x01\n\x0e\x43ontrolCommand\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12\x35\n\x12\x64iagnostic_request\x18\x02 \x01(\x0b\x32\x19.openxc.DiagnosticRequest\"2\n\x04Type\x12\x0b\n\x07VERSION\x10\x01\x12\r\n\tDEVICE_ID\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\"\xaa\x01\n\x11\x44iagnosticRequest\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\x07payload\x18\x05 \x01(\x0c\x12\x15\n\rparse_payload\x18\x06 \x01(\x08\x12\x0e\n\x06\x66\x61\x63tor\x18\x07 \x01(\x01\x12\x0e\n\x06offset\x18\x08 \x01(\x01\x12\x11\n\tfrequency\x18\t \x01(\x01\"\xa1\x01\n\x12\x44iagnosticResponse\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\"\xa2\x01\n\x0c\x44ynamicField\x12\'\n\x04type\x18\x01 \x01(\x0e\x32\x19.openxc.DynamicField.Type\x12\x14\n\x0cstring_value\x18\x02 \x01(\t\x12\x15\n\rnumeric_value\x18\x03 \x01(\x01\x12\x15\n\rboolean_value\x18\x04 \x01(\x08\"%\n\x04Type\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03NUM\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\"\xf7\x01\n\x11TranslatedMessage\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.openxc.TranslatedMessage.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12#\n\x05value\x18\x03 \x01(\x0b\x32\x14.openxc.DynamicField\x12#\n\x05\x65vent\x18\x04 \x01(\x0b\x32\x14.openxc.DynamicField\"\\\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') @@ -71,6 +71,31 @@ _CONTROLCOMMAND_TYPE = _descriptor.EnumDescriptor( serialized_end=586, ) +_DYNAMICFIELD_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='openxc.DynamicField.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='STRING', index=0, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NUM', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BOOL', index=2, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=1051, + serialized_end=1088, +) + _TRANSLATEDMESSAGE_TYPE = _descriptor.EnumDescriptor( name='Type', full_name='openxc.TranslatedMessage.Type', @@ -104,8 +129,8 @@ _TRANSLATEDMESSAGE_TYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1143, - serialized_end=1235, + serialized_start=1246, + serialized_end=1338, ) @@ -405,66 +430,88 @@ _DIAGNOSTICRESPONSE = _descriptor.Descriptor( ) -_TRANSLATEDMESSAGE = _descriptor.Descriptor( - name='TranslatedMessage', - full_name='openxc.TranslatedMessage', +_DYNAMICFIELD = _descriptor.Descriptor( + name='DynamicField', + full_name='openxc.DynamicField', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='type', full_name='openxc.TranslatedMessage.type', index=0, + name='type', full_name='openxc.DynamicField.type', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='name', full_name='openxc.TranslatedMessage.name', index=1, + name='string_value', full_name='openxc.DynamicField.string_value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='string_value', full_name='openxc.TranslatedMessage.string_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=unicode("", "utf-8"), + name='numeric_value', full_name='openxc.DynamicField.numeric_value', index=2, + number=3, 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), _descriptor.FieldDescriptor( - name='numeric_value', full_name='openxc.TranslatedMessage.numeric_value', index=3, - number=4, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=0, + name='boolean_value', full_name='openxc.DynamicField.boolean_value', index=3, + number=4, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _DYNAMICFIELD_TYPE, + ], + options=None, + is_extendable=False, + extension_ranges=[], + serialized_start=926, + serialized_end=1088, +) + + +_TRANSLATEDMESSAGE = _descriptor.Descriptor( + name='TranslatedMessage', + full_name='openxc.TranslatedMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ _descriptor.FieldDescriptor( - name='boolean_value', full_name='openxc.TranslatedMessage.boolean_value', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, + name='type', full_name='openxc.TranslatedMessage.type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='string_event', full_name='openxc.TranslatedMessage.string_event', index=5, - number=6, type=9, cpp_type=9, label=1, + name='name', full_name='openxc.TranslatedMessage.name', index=1, + number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='numeric_event', full_name='openxc.TranslatedMessage.numeric_event', index=6, - number=7, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=0, + name='value', full_name='openxc.TranslatedMessage.value', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='boolean_event', full_name='openxc.TranslatedMessage.boolean_event', index=7, - number=8, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, + name='event', full_name='openxc.TranslatedMessage.event', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), @@ -478,8 +525,8 @@ _TRANSLATEDMESSAGE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=926, - serialized_end=1235, + serialized_start=1091, + serialized_end=1338, ) _VEHICLEMESSAGE.fields_by_name['type'].enum_type = _VEHICLEMESSAGE_TYPE @@ -491,13 +538,18 @@ _VEHICLEMESSAGE_TYPE.containing_type = _VEHICLEMESSAGE; _CONTROLCOMMAND.fields_by_name['type'].enum_type = _CONTROLCOMMAND_TYPE _CONTROLCOMMAND.fields_by_name['diagnostic_request'].message_type = _DIAGNOSTICREQUEST _CONTROLCOMMAND_TYPE.containing_type = _CONTROLCOMMAND; +_DYNAMICFIELD.fields_by_name['type'].enum_type = _DYNAMICFIELD_TYPE +_DYNAMICFIELD_TYPE.containing_type = _DYNAMICFIELD; _TRANSLATEDMESSAGE.fields_by_name['type'].enum_type = _TRANSLATEDMESSAGE_TYPE +_TRANSLATEDMESSAGE.fields_by_name['value'].message_type = _DYNAMICFIELD +_TRANSLATEDMESSAGE.fields_by_name['event'].message_type = _DYNAMICFIELD _TRANSLATEDMESSAGE_TYPE.containing_type = _TRANSLATEDMESSAGE; DESCRIPTOR.message_types_by_name['VehicleMessage'] = _VEHICLEMESSAGE DESCRIPTOR.message_types_by_name['RawMessage'] = _RAWMESSAGE DESCRIPTOR.message_types_by_name['ControlCommand'] = _CONTROLCOMMAND DESCRIPTOR.message_types_by_name['DiagnosticRequest'] = _DIAGNOSTICREQUEST DESCRIPTOR.message_types_by_name['DiagnosticResponse'] = _DIAGNOSTICRESPONSE +DESCRIPTOR.message_types_by_name['DynamicField'] = _DYNAMICFIELD DESCRIPTOR.message_types_by_name['TranslatedMessage'] = _TRANSLATEDMESSAGE class VehicleMessage(_message.Message): @@ -530,6 +582,12 @@ class DiagnosticResponse(_message.Message): # @@protoc_insertion_point(class_scope:openxc.DiagnosticResponse) +class DynamicField(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType + DESCRIPTOR = _DYNAMICFIELD + + # @@protoc_insertion_point(class_scope:openxc.DynamicField) + class TranslatedMessage(_message.Message): __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TRANSLATEDMESSAGE diff --git a/openxc.options b/openxc.options index 1f45bff7..92b8f5b7 100644 --- a/openxc.options +++ b/openxc.options @@ -1,6 +1,5 @@ openxc.TranslatedMessage.name max_size:100 -openxc.TranslatedMessage.string_value max_size:100 -openxc.TranslatedMessage.string_event max_size:100 +openxc.DynamicField.string_value max_size:100 openxc.DiagnosticResponse.payload max_size:8 openxc.DiagnosticRequest.payload max_size:8 openxc.RawMessage.data max_size:8 diff --git a/openxc.proto b/openxc.proto index c6177de0..27ea931f 100644 --- a/openxc.proto +++ b/openxc.proto @@ -53,20 +53,23 @@ message DiagnosticResponse { 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 { enum Type { STRING = 1; NUM = 2; BOOL = 3; EVENTED_STRING = 4; EVENTED_NUM = 5; EVENTED_BOOL = 6;} 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 -- cgit 1.2.3-korg