diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2013-10-23 09:02:33 -0400 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-07 13:18:10 -0500 |
commit | da1d41840879bc75a9df06972e1ec191bbfd3691 (patch) | |
tree | d25f57f7872963396f83ca0f10f2aa4c73b29d04 /gen/python/openxc_pb2.py | |
parent | 4904749890b1f2570f9197da99a07a76471e8400 (diff) |
Switch back to many subtypes for binary messages.
Some protobuf libraries don't support checking if a field exists (they
always return a default value), so although this style has more code it
is easier to support.
Diffstat (limited to 'gen/python/openxc_pb2.py')
-rw-r--r-- | gen/python/openxc_pb2.py | 319 |
1 files changed, 284 insertions, 35 deletions
diff --git a/gen/python/openxc_pb2.py b/gen/python/openxc_pb2.py index 5b311a2e..6c773033 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\"\xbc\x01\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\"\x1f\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\";\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(\x04\"\xad\x01\n\x11TranslatedMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cstring_value\x18\x02 \x01(\t\x12\x17\n\x0fnumerical_value\x18\x03 \x01(\x01\x12\x15\n\rboolean_value\x18\x04 \x01(\x08\x12\x14\n\x0cstring_event\x18\x05 \x01(\t\x12\x17\n\x0fnumerical_event\x18\x06 \x01(\x01\x12\x15\n\rboolean_event\x18\x07 \x01(\x08\x42\x1c\n\ncom.openxcB\x0e\x42inaryMessages') + serialized_pb='\n\x0copenxc.proto\x12\x06openxc\"\x9a\x04\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-\n\x0estring_message\x18\x03 \x01(\x0b\x32\x15.openxc.StringMessage\x12/\n\x0fnumeric_message\x18\x04 \x01(\x0b\x32\x16.openxc.NumericMessage\x12/\n\x0f\x62oolean_message\x18\x05 \x01(\x0b\x32\x16.openxc.BooleanMessage\x12<\n\x16\x65vented_string_message\x18\x06 \x01(\x0b\x32\x1c.openxc.EventedStringMessage\x12>\n\x17\x65vented_boolean_message\x18\x07 \x01(\x0b\x32\x1d.openxc.EventedBooleanMessage\x12>\n\x17\x65vented_numeric_message\x18\x08 \x01(\x0b\x32\x1d.openxc.EventedNumericMessage\"e\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\n\n\x06STRING\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\x07\n\x03NUM\x10\x04\x12\x0f\n\x0b\x45VENTED_NUM\x10\x05\x12\x12\n\x0e\x45VENTED_STRING\x10\x06\x12\x10\n\x0c\x45VENTED_BOOL\x10\x07\"-\n\nRawMessage\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\",\n\rStringMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"-\n\x0eNumericMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01\"-\n\x0e\x42ooleanMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x08\"B\n\x14\x45ventedStringMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\r\n\x05\x65vent\x18\x03 \x01(\t\"C\n\x15\x45ventedBooleanMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\r\n\x05\x65vent\x18\x03 \x01(\x08\"C\n\x15\x45ventedNumericMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\r\n\x05\x65vent\x18\x03 \x01(\x01\x42\x1c\n\ncom.openxcB\x0e\x42inaryMessages') @@ -28,14 +28,34 @@ _VEHICLEMESSAGE_TYPE = _descriptor.EnumDescriptor( options=None, type=None), _descriptor.EnumValueDescriptor( - name='TRANSLATED', index=1, number=2, + name='STRING', index=1, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BOOL', index=2, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NUM', index=3, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EVENTED_NUM', index=4, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EVENTED_STRING', index=5, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EVENTED_BOOL', index=6, number=7, options=None, type=None), ], containing_type=None, options=None, - serialized_start=182, - serialized_end=213, + serialized_start=462, + serialized_end=563, ) @@ -61,12 +81,47 @@ _VEHICLEMESSAGE = _descriptor.Descriptor( is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='translated_message', full_name='openxc.VehicleMessage.translated_message', index=2, + name='string_message', full_name='openxc.VehicleMessage.string_message', 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='numeric_message', full_name='openxc.VehicleMessage.numeric_message', 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), + _descriptor.FieldDescriptor( + name='boolean_message', full_name='openxc.VehicleMessage.boolean_message', index=4, + number=5, 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='evented_string_message', full_name='openxc.VehicleMessage.evented_string_message', index=5, + number=6, 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='evented_boolean_message', full_name='openxc.VehicleMessage.evented_boolean_message', index=6, + number=7, 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='evented_numeric_message', full_name='openxc.VehicleMessage.evented_numeric_message', index=7, + number=8, 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), ], extensions=[ ], @@ -78,7 +133,7 @@ _VEHICLEMESSAGE = _descriptor.Descriptor( is_extendable=False, extension_ranges=[], serialized_start=25, - serialized_end=213, + serialized_end=563, ) @@ -103,9 +158,72 @@ _RAWMESSAGE = _descriptor.Descriptor( message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + extension_ranges=[], + serialized_start=565, + serialized_end=610, +) + + +_STRINGMESSAGE = _descriptor.Descriptor( + name='StringMessage', + full_name='openxc.StringMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='openxc.StringMessage.name', index=0, + number=1, 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='value', full_name='openxc.StringMessage.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), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + extension_ranges=[], + serialized_start=612, + serialized_end=656, +) + + +_NUMERICMESSAGE = _descriptor.Descriptor( + name='NumericMessage', + full_name='openxc.NumericMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ _descriptor.FieldDescriptor( - name='data', full_name='openxc.RawMessage.data', index=2, - number=3, type=4, cpp_type=4, label=1, + name='name', full_name='openxc.NumericMessage.name', index=0, + number=1, 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='value', full_name='openxc.NumericMessage.value', index=1, + number=2, 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, @@ -119,64 +237,155 @@ _RAWMESSAGE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=215, - serialized_end=274, + serialized_start=658, + serialized_end=703, +) + + +_BOOLEANMESSAGE = _descriptor.Descriptor( + name='BooleanMessage', + full_name='openxc.BooleanMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='openxc.BooleanMessage.name', index=0, + number=1, 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='value', full_name='openxc.BooleanMessage.value', index=1, + number=2, 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=[ + ], + options=None, + is_extendable=False, + extension_ranges=[], + serialized_start=705, + serialized_end=750, ) -_TRANSLATEDMESSAGE = _descriptor.Descriptor( - name='TranslatedMessage', - full_name='openxc.TranslatedMessage', +_EVENTEDSTRINGMESSAGE = _descriptor.Descriptor( + name='EventedStringMessage', + full_name='openxc.EventedStringMessage', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='name', full_name='openxc.TranslatedMessage.name', index=0, + name='name', full_name='openxc.EventedStringMessage.name', index=0, number=1, 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=1, + name='value', full_name='openxc.EventedStringMessage.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='numerical_value', full_name='openxc.TranslatedMessage.numerical_value', index=2, - number=3, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=0, + name='event', full_name='openxc.EventedStringMessage.event', index=2, + number=3, 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), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + extension_ranges=[], + serialized_start=752, + serialized_end=818, +) + + +_EVENTEDBOOLEANMESSAGE = _descriptor.Descriptor( + name='EventedBooleanMessage', + full_name='openxc.EventedBooleanMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ _descriptor.FieldDescriptor( - name='boolean_value', full_name='openxc.TranslatedMessage.boolean_value', index=3, - number=4, type=8, cpp_type=7, label=1, + name='name', full_name='openxc.EventedBooleanMessage.name', index=0, + number=1, 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='value', full_name='openxc.EventedBooleanMessage.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='event', full_name='openxc.EventedBooleanMessage.event', index=2, + number=3, 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=[ + ], + options=None, + is_extendable=False, + extension_ranges=[], + serialized_start=820, + serialized_end=887, +) + + +_EVENTEDNUMERICMESSAGE = _descriptor.Descriptor( + name='EventedNumericMessage', + full_name='openxc.EventedNumericMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ _descriptor.FieldDescriptor( - name='string_event', full_name='openxc.TranslatedMessage.string_event', index=4, - number=5, type=9, cpp_type=9, label=1, + name='name', full_name='openxc.EventedNumericMessage.name', index=0, + number=1, 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='numerical_event', full_name='openxc.TranslatedMessage.numerical_event', index=5, - number=6, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=0, + name='value', full_name='openxc.EventedNumericMessage.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='boolean_event', full_name='openxc.TranslatedMessage.boolean_event', index=6, - number=7, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, + name='event', full_name='openxc.EventedNumericMessage.event', 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), @@ -189,17 +398,27 @@ _TRANSLATEDMESSAGE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=277, - serialized_end=450, + serialized_start=889, + serialized_end=956, ) _VEHICLEMESSAGE.fields_by_name['type'].enum_type = _VEHICLEMESSAGE_TYPE _VEHICLEMESSAGE.fields_by_name['raw_message'].message_type = _RAWMESSAGE -_VEHICLEMESSAGE.fields_by_name['translated_message'].message_type = _TRANSLATEDMESSAGE +_VEHICLEMESSAGE.fields_by_name['string_message'].message_type = _STRINGMESSAGE +_VEHICLEMESSAGE.fields_by_name['numeric_message'].message_type = _NUMERICMESSAGE +_VEHICLEMESSAGE.fields_by_name['boolean_message'].message_type = _BOOLEANMESSAGE +_VEHICLEMESSAGE.fields_by_name['evented_string_message'].message_type = _EVENTEDSTRINGMESSAGE +_VEHICLEMESSAGE.fields_by_name['evented_boolean_message'].message_type = _EVENTEDBOOLEANMESSAGE +_VEHICLEMESSAGE.fields_by_name['evented_numeric_message'].message_type = _EVENTEDNUMERICMESSAGE _VEHICLEMESSAGE_TYPE.containing_type = _VEHICLEMESSAGE; DESCRIPTOR.message_types_by_name['VehicleMessage'] = _VEHICLEMESSAGE DESCRIPTOR.message_types_by_name['RawMessage'] = _RAWMESSAGE -DESCRIPTOR.message_types_by_name['TranslatedMessage'] = _TRANSLATEDMESSAGE +DESCRIPTOR.message_types_by_name['StringMessage'] = _STRINGMESSAGE +DESCRIPTOR.message_types_by_name['NumericMessage'] = _NUMERICMESSAGE +DESCRIPTOR.message_types_by_name['BooleanMessage'] = _BOOLEANMESSAGE +DESCRIPTOR.message_types_by_name['EventedStringMessage'] = _EVENTEDSTRINGMESSAGE +DESCRIPTOR.message_types_by_name['EventedBooleanMessage'] = _EVENTEDBOOLEANMESSAGE +DESCRIPTOR.message_types_by_name['EventedNumericMessage'] = _EVENTEDNUMERICMESSAGE class VehicleMessage(_message.Message): __metaclass__ = _reflection.GeneratedProtocolMessageType @@ -213,11 +432,41 @@ class RawMessage(_message.Message): # @@protoc_insertion_point(class_scope:openxc.RawMessage) -class TranslatedMessage(_message.Message): +class StringMessage(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType + DESCRIPTOR = _STRINGMESSAGE + + # @@protoc_insertion_point(class_scope:openxc.StringMessage) + +class NumericMessage(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType + DESCRIPTOR = _NUMERICMESSAGE + + # @@protoc_insertion_point(class_scope:openxc.NumericMessage) + +class BooleanMessage(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType + DESCRIPTOR = _BOOLEANMESSAGE + + # @@protoc_insertion_point(class_scope:openxc.BooleanMessage) + +class EventedStringMessage(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType + DESCRIPTOR = _EVENTEDSTRINGMESSAGE + + # @@protoc_insertion_point(class_scope:openxc.EventedStringMessage) + +class EventedBooleanMessage(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType + DESCRIPTOR = _EVENTEDBOOLEANMESSAGE + + # @@protoc_insertion_point(class_scope:openxc.EventedBooleanMessage) + +class EventedNumericMessage(_message.Message): __metaclass__ = _reflection.GeneratedProtocolMessageType - DESCRIPTOR = _TRANSLATEDMESSAGE + DESCRIPTOR = _EVENTEDNUMERICMESSAGE - # @@protoc_insertion_point(class_scope:openxc.TranslatedMessage) + # @@protoc_insertion_point(class_scope:openxc.EventedNumericMessage) DESCRIPTOR.has_options = True |