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