00001 """autogenerated by genpy from ros_rt_wmp_msgs/WMPServiceTestRequest.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 ros_rt_wmp_msgs.msg
00008
00009 class WMPServiceTestRequest(genpy.Message):
00010 _md5sum = "9a5f1ce7b0b64b63ad98056dc396fc0b"
00011 _type = "ros_rt_wmp_msgs/WMPServiceTestRequest"
00012 _has_header = False
00013 _full_text = """ros_rt_wmp_msgs/WMPServiceHeader header
00014 uint8 a1
00015 uint8 a2
00016
00017 ================================================================================
00018 MSG: ros_rt_wmp_msgs/WMPServiceHeader
00019 uint8 source
00020 uint8 dest
00021 uint8 priority
00022
00023 """
00024 __slots__ = ['header','a1','a2']
00025 _slot_types = ['ros_rt_wmp_msgs/WMPServiceHeader','uint8','uint8']
00026
00027 def __init__(self, *args, **kwds):
00028 """
00029 Constructor. Any message fields that are implicitly/explicitly
00030 set to None will be assigned a default value. The recommend
00031 use is keyword arguments as this is more robust to future message
00032 changes. You cannot mix in-order arguments and keyword arguments.
00033
00034 The available fields are:
00035 header,a1,a2
00036
00037 :param args: complete set of field values, in .msg order
00038 :param kwds: use keyword arguments corresponding to message field names
00039 to set specific fields.
00040 """
00041 if args or kwds:
00042 super(WMPServiceTestRequest, self).__init__(*args, **kwds)
00043
00044 if self.header is None:
00045 self.header = ros_rt_wmp_msgs.msg.WMPServiceHeader()
00046 if self.a1 is None:
00047 self.a1 = 0
00048 if self.a2 is None:
00049 self.a2 = 0
00050 else:
00051 self.header = ros_rt_wmp_msgs.msg.WMPServiceHeader()
00052 self.a1 = 0
00053 self.a2 = 0
00054
00055 def _get_types(self):
00056 """
00057 internal API method
00058 """
00059 return self._slot_types
00060
00061 def serialize(self, buff):
00062 """
00063 serialize message into buffer
00064 :param buff: buffer, ``StringIO``
00065 """
00066 try:
00067 _x = self
00068 buff.write(_struct_5B.pack(_x.header.source, _x.header.dest, _x.header.priority, _x.a1, _x.a2))
00069 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00070 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00071
00072 def deserialize(self, str):
00073 """
00074 unpack serialized message in str into this message instance
00075 :param str: byte array of serialized message, ``str``
00076 """
00077 try:
00078 if self.header is None:
00079 self.header = ros_rt_wmp_msgs.msg.WMPServiceHeader()
00080 end = 0
00081 _x = self
00082 start = end
00083 end += 5
00084 (_x.header.source, _x.header.dest, _x.header.priority, _x.a1, _x.a2,) = _struct_5B.unpack(str[start:end])
00085 return self
00086 except struct.error as e:
00087 raise genpy.DeserializationError(e)
00088
00089
00090 def serialize_numpy(self, buff, numpy):
00091 """
00092 serialize message with numpy array types into buffer
00093 :param buff: buffer, ``StringIO``
00094 :param numpy: numpy python module
00095 """
00096 try:
00097 _x = self
00098 buff.write(_struct_5B.pack(_x.header.source, _x.header.dest, _x.header.priority, _x.a1, _x.a2))
00099 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00100 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00101
00102 def deserialize_numpy(self, str, numpy):
00103 """
00104 unpack serialized message in str into this message instance using numpy for array types
00105 :param str: byte array of serialized message, ``str``
00106 :param numpy: numpy python module
00107 """
00108 try:
00109 if self.header is None:
00110 self.header = ros_rt_wmp_msgs.msg.WMPServiceHeader()
00111 end = 0
00112 _x = self
00113 start = end
00114 end += 5
00115 (_x.header.source, _x.header.dest, _x.header.priority, _x.a1, _x.a2,) = _struct_5B.unpack(str[start:end])
00116 return self
00117 except struct.error as e:
00118 raise genpy.DeserializationError(e)
00119
00120 _struct_I = genpy.struct_I
00121 _struct_5B = struct.Struct("<5B")
00122 """autogenerated by genpy from ros_rt_wmp_msgs/WMPServiceTestResponse.msg. Do not edit."""
00123 import sys
00124 python3 = True if sys.hexversion > 0x03000000 else False
00125 import genpy
00126 import struct
00127
00128
00129 class WMPServiceTestResponse(genpy.Message):
00130 _md5sum = "8b0b23e612cf11c618df2f89f16fb290"
00131 _type = "ros_rt_wmp_msgs/WMPServiceTestResponse"
00132 _has_header = False
00133 _full_text = """uint8 sum
00134
00135 """
00136 __slots__ = ['sum']
00137 _slot_types = ['uint8']
00138
00139 def __init__(self, *args, **kwds):
00140 """
00141 Constructor. Any message fields that are implicitly/explicitly
00142 set to None will be assigned a default value. The recommend
00143 use is keyword arguments as this is more robust to future message
00144 changes. You cannot mix in-order arguments and keyword arguments.
00145
00146 The available fields are:
00147 sum
00148
00149 :param args: complete set of field values, in .msg order
00150 :param kwds: use keyword arguments corresponding to message field names
00151 to set specific fields.
00152 """
00153 if args or kwds:
00154 super(WMPServiceTestResponse, self).__init__(*args, **kwds)
00155
00156 if self.sum is None:
00157 self.sum = 0
00158 else:
00159 self.sum = 0
00160
00161 def _get_types(self):
00162 """
00163 internal API method
00164 """
00165 return self._slot_types
00166
00167 def serialize(self, buff):
00168 """
00169 serialize message into buffer
00170 :param buff: buffer, ``StringIO``
00171 """
00172 try:
00173 buff.write(_struct_B.pack(self.sum))
00174 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00175 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00176
00177 def deserialize(self, str):
00178 """
00179 unpack serialized message in str into this message instance
00180 :param str: byte array of serialized message, ``str``
00181 """
00182 try:
00183 end = 0
00184 start = end
00185 end += 1
00186 (self.sum,) = _struct_B.unpack(str[start:end])
00187 return self
00188 except struct.error as e:
00189 raise genpy.DeserializationError(e)
00190
00191
00192 def serialize_numpy(self, buff, numpy):
00193 """
00194 serialize message with numpy array types into buffer
00195 :param buff: buffer, ``StringIO``
00196 :param numpy: numpy python module
00197 """
00198 try:
00199 buff.write(_struct_B.pack(self.sum))
00200 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00201 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00202
00203 def deserialize_numpy(self, str, numpy):
00204 """
00205 unpack serialized message in str into this message instance using numpy for array types
00206 :param str: byte array of serialized message, ``str``
00207 :param numpy: numpy python module
00208 """
00209 try:
00210 end = 0
00211 start = end
00212 end += 1
00213 (self.sum,) = _struct_B.unpack(str[start:end])
00214 return self
00215 except struct.error as e:
00216 raise genpy.DeserializationError(e)
00217
00218 _struct_I = genpy.struct_I
00219 _struct_B = struct.Struct("<B")
00220 class WMPServiceTest(object):
00221 _type = 'ros_rt_wmp_msgs/WMPServiceTest'
00222 _md5sum = 'a4cd24526a5dfc32eb33b418fed89b5b'
00223 _request_class = WMPServiceTestRequest
00224 _response_class = WMPServiceTestResponse