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