00001 """autogenerated by genpy from clearpath_base/FirmwareInfo.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import std_msgs.msg
00008
00009 class FirmwareInfo(genpy.Message):
00010 _md5sum = "dd399eb9c7b3816e8bea664a45a7e9ea"
00011 _type = "clearpath_base/FirmwareInfo"
00012 _has_header = True
00013 _full_text = """Header header
00014 int8 firmware_major
00015 int8 firmware_minor
00016 int8 protocol_major
00017 int8 protocol_minor
00018 uint32 firmware_write_time
00019
00020 ================================================================================
00021 MSG: std_msgs/Header
00022 # Standard metadata for higher-level stamped data types.
00023 # This is generally used to communicate timestamped data
00024 # in a particular coordinate frame.
00025 #
00026 # sequence ID: consecutively increasing ID
00027 uint32 seq
00028 #Two-integer timestamp that is expressed as:
00029 # * stamp.secs: seconds (stamp_secs) since epoch
00030 # * stamp.nsecs: nanoseconds since stamp_secs
00031 # time-handling sugar is provided by the client library
00032 time stamp
00033 #Frame this data is associated with
00034 # 0: no frame
00035 # 1: global frame
00036 string frame_id
00037
00038 """
00039 __slots__ = ['header','firmware_major','firmware_minor','protocol_major','protocol_minor','firmware_write_time']
00040 _slot_types = ['std_msgs/Header','int8','int8','int8','int8','uint32']
00041
00042 def __init__(self, *args, **kwds):
00043 """
00044 Constructor. Any message fields that are implicitly/explicitly
00045 set to None will be assigned a default value. The recommend
00046 use is keyword arguments as this is more robust to future message
00047 changes. You cannot mix in-order arguments and keyword arguments.
00048
00049 The available fields are:
00050 header,firmware_major,firmware_minor,protocol_major,protocol_minor,firmware_write_time
00051
00052 :param args: complete set of field values, in .msg order
00053 :param kwds: use keyword arguments corresponding to message field names
00054 to set specific fields.
00055 """
00056 if args or kwds:
00057 super(FirmwareInfo, self).__init__(*args, **kwds)
00058
00059 if self.header is None:
00060 self.header = std_msgs.msg.Header()
00061 if self.firmware_major is None:
00062 self.firmware_major = 0
00063 if self.firmware_minor is None:
00064 self.firmware_minor = 0
00065 if self.protocol_major is None:
00066 self.protocol_major = 0
00067 if self.protocol_minor is None:
00068 self.protocol_minor = 0
00069 if self.firmware_write_time is None:
00070 self.firmware_write_time = 0
00071 else:
00072 self.header = std_msgs.msg.Header()
00073 self.firmware_major = 0
00074 self.firmware_minor = 0
00075 self.protocol_major = 0
00076 self.protocol_minor = 0
00077 self.firmware_write_time = 0
00078
00079 def _get_types(self):
00080 """
00081 internal API method
00082 """
00083 return self._slot_types
00084
00085 def serialize(self, buff):
00086 """
00087 serialize message into buffer
00088 :param buff: buffer, ``StringIO``
00089 """
00090 try:
00091 _x = self
00092 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00093 _x = self.header.frame_id
00094 length = len(_x)
00095 if python3 or type(_x) == unicode:
00096 _x = _x.encode('utf-8')
00097 length = len(_x)
00098 buff.write(struct.pack('<I%ss'%length, length, _x))
00099 _x = self
00100 buff.write(_struct_4bI.pack(_x.firmware_major, _x.firmware_minor, _x.protocol_major, _x.protocol_minor, _x.firmware_write_time))
00101 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00102 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00103
00104 def deserialize(self, str):
00105 """
00106 unpack serialized message in str into this message instance
00107 :param str: byte array of serialized message, ``str``
00108 """
00109 try:
00110 if self.header is None:
00111 self.header = std_msgs.msg.Header()
00112 end = 0
00113 _x = self
00114 start = end
00115 end += 12
00116 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00117 start = end
00118 end += 4
00119 (length,) = _struct_I.unpack(str[start:end])
00120 start = end
00121 end += length
00122 if python3:
00123 self.header.frame_id = str[start:end].decode('utf-8')
00124 else:
00125 self.header.frame_id = str[start:end]
00126 _x = self
00127 start = end
00128 end += 8
00129 (_x.firmware_major, _x.firmware_minor, _x.protocol_major, _x.protocol_minor, _x.firmware_write_time,) = _struct_4bI.unpack(str[start:end])
00130 return self
00131 except struct.error as e:
00132 raise genpy.DeserializationError(e)
00133
00134
00135 def serialize_numpy(self, buff, numpy):
00136 """
00137 serialize message with numpy array types into buffer
00138 :param buff: buffer, ``StringIO``
00139 :param numpy: numpy python module
00140 """
00141 try:
00142 _x = self
00143 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00144 _x = self.header.frame_id
00145 length = len(_x)
00146 if python3 or type(_x) == unicode:
00147 _x = _x.encode('utf-8')
00148 length = len(_x)
00149 buff.write(struct.pack('<I%ss'%length, length, _x))
00150 _x = self
00151 buff.write(_struct_4bI.pack(_x.firmware_major, _x.firmware_minor, _x.protocol_major, _x.protocol_minor, _x.firmware_write_time))
00152 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00153 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00154
00155 def deserialize_numpy(self, str, numpy):
00156 """
00157 unpack serialized message in str into this message instance using numpy for array types
00158 :param str: byte array of serialized message, ``str``
00159 :param numpy: numpy python module
00160 """
00161 try:
00162 if self.header is None:
00163 self.header = std_msgs.msg.Header()
00164 end = 0
00165 _x = self
00166 start = end
00167 end += 12
00168 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00169 start = end
00170 end += 4
00171 (length,) = _struct_I.unpack(str[start:end])
00172 start = end
00173 end += length
00174 if python3:
00175 self.header.frame_id = str[start:end].decode('utf-8')
00176 else:
00177 self.header.frame_id = str[start:end]
00178 _x = self
00179 start = end
00180 end += 8
00181 (_x.firmware_major, _x.firmware_minor, _x.protocol_major, _x.protocol_minor, _x.firmware_write_time,) = _struct_4bI.unpack(str[start:end])
00182 return self
00183 except struct.error as e:
00184 raise genpy.DeserializationError(e)
00185
00186 _struct_I = genpy.struct_I
00187 _struct_4bI = struct.Struct("<4bI")
00188 _struct_3I = struct.Struct("<3I")