00001 """autogenerated by genpy from rosserial_msgs/RequestParamRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class RequestParamRequest(genpy.Message):
00009 _md5sum = "c1f3d28f1b044c871e6eff2e9fc3c667"
00010 _type = "rosserial_msgs/RequestParamRequest"
00011 _has_header = False
00012 _full_text = """string name
00013
00014
00015 """
00016 __slots__ = ['name']
00017 _slot_types = ['string']
00018
00019 def __init__(self, *args, **kwds):
00020 """
00021 Constructor. Any message fields that are implicitly/explicitly
00022 set to None will be assigned a default value. The recommend
00023 use is keyword arguments as this is more robust to future message
00024 changes. You cannot mix in-order arguments and keyword arguments.
00025
00026 The available fields are:
00027 name
00028
00029 :param args: complete set of field values, in .msg order
00030 :param kwds: use keyword arguments corresponding to message field names
00031 to set specific fields.
00032 """
00033 if args or kwds:
00034 super(RequestParamRequest, self).__init__(*args, **kwds)
00035
00036 if self.name is None:
00037 self.name = ''
00038 else:
00039 self.name = ''
00040
00041 def _get_types(self):
00042 """
00043 internal API method
00044 """
00045 return self._slot_types
00046
00047 def serialize(self, buff):
00048 """
00049 serialize message into buffer
00050 :param buff: buffer, ``StringIO``
00051 """
00052 try:
00053 _x = self.name
00054 length = len(_x)
00055 if python3 or type(_x) == unicode:
00056 _x = _x.encode('utf-8')
00057 length = len(_x)
00058 buff.write(struct.pack('<I%ss'%length, length, _x))
00059 except struct.error as se: self._check_types(se)
00060 except TypeError as te: self._check_types(te)
00061
00062 def deserialize(self, str):
00063 """
00064 unpack serialized message in str into this message instance
00065 :param str: byte array of serialized message, ``str``
00066 """
00067 try:
00068 end = 0
00069 start = end
00070 end += 4
00071 (length,) = _struct_I.unpack(str[start:end])
00072 start = end
00073 end += length
00074 if python3:
00075 self.name = str[start:end].decode('utf-8')
00076 else:
00077 self.name = str[start:end]
00078 return self
00079 except struct.error as e:
00080 raise genpy.DeserializationError(e)
00081
00082
00083 def serialize_numpy(self, buff, numpy):
00084 """
00085 serialize message with numpy array types into buffer
00086 :param buff: buffer, ``StringIO``
00087 :param numpy: numpy python module
00088 """
00089 try:
00090 _x = self.name
00091 length = len(_x)
00092 if python3 or type(_x) == unicode:
00093 _x = _x.encode('utf-8')
00094 length = len(_x)
00095 buff.write(struct.pack('<I%ss'%length, length, _x))
00096 except struct.error as se: self._check_types(se)
00097 except TypeError as te: self._check_types(te)
00098
00099 def deserialize_numpy(self, str, numpy):
00100 """
00101 unpack serialized message in str into this message instance using numpy for array types
00102 :param str: byte array of serialized message, ``str``
00103 :param numpy: numpy python module
00104 """
00105 try:
00106 end = 0
00107 start = end
00108 end += 4
00109 (length,) = _struct_I.unpack(str[start:end])
00110 start = end
00111 end += length
00112 if python3:
00113 self.name = str[start:end].decode('utf-8')
00114 else:
00115 self.name = 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 """autogenerated by genpy from rosserial_msgs/RequestParamResponse.msg. Do not edit."""
00122 import sys
00123 python3 = True if sys.hexversion > 0x03000000 else False
00124 import genpy
00125 import struct
00126
00127
00128 class RequestParamResponse(genpy.Message):
00129 _md5sum = "9f0e98bda65981986ddf53afa7a40e49"
00130 _type = "rosserial_msgs/RequestParamResponse"
00131 _has_header = False
00132 _full_text = """
00133 int32[] ints
00134 float32[] floats
00135 string[] strings
00136
00137
00138 """
00139 __slots__ = ['ints','floats','strings']
00140 _slot_types = ['int32[]','float32[]','string[]']
00141
00142 def __init__(self, *args, **kwds):
00143 """
00144 Constructor. Any message fields that are implicitly/explicitly
00145 set to None will be assigned a default value. The recommend
00146 use is keyword arguments as this is more robust to future message
00147 changes. You cannot mix in-order arguments and keyword arguments.
00148
00149 The available fields are:
00150 ints,floats,strings
00151
00152 :param args: complete set of field values, in .msg order
00153 :param kwds: use keyword arguments corresponding to message field names
00154 to set specific fields.
00155 """
00156 if args or kwds:
00157 super(RequestParamResponse, self).__init__(*args, **kwds)
00158
00159 if self.ints is None:
00160 self.ints = []
00161 if self.floats is None:
00162 self.floats = []
00163 if self.strings is None:
00164 self.strings = []
00165 else:
00166 self.ints = []
00167 self.floats = []
00168 self.strings = []
00169
00170 def _get_types(self):
00171 """
00172 internal API method
00173 """
00174 return self._slot_types
00175
00176 def serialize(self, buff):
00177 """
00178 serialize message into buffer
00179 :param buff: buffer, ``StringIO``
00180 """
00181 try:
00182 length = len(self.ints)
00183 buff.write(_struct_I.pack(length))
00184 pattern = '<%si'%length
00185 buff.write(struct.pack(pattern, *self.ints))
00186 length = len(self.floats)
00187 buff.write(_struct_I.pack(length))
00188 pattern = '<%sf'%length
00189 buff.write(struct.pack(pattern, *self.floats))
00190 length = len(self.strings)
00191 buff.write(_struct_I.pack(length))
00192 for val1 in self.strings:
00193 length = len(val1)
00194 if python3 or type(val1) == unicode:
00195 val1 = val1.encode('utf-8')
00196 length = len(val1)
00197 buff.write(struct.pack('<I%ss'%length, length, val1))
00198 except struct.error as se: self._check_types(se)
00199 except TypeError as te: self._check_types(te)
00200
00201 def deserialize(self, str):
00202 """
00203 unpack serialized message in str into this message instance
00204 :param str: byte array of serialized message, ``str``
00205 """
00206 try:
00207 end = 0
00208 start = end
00209 end += 4
00210 (length,) = _struct_I.unpack(str[start:end])
00211 pattern = '<%si'%length
00212 start = end
00213 end += struct.calcsize(pattern)
00214 self.ints = struct.unpack(pattern, str[start:end])
00215 start = end
00216 end += 4
00217 (length,) = _struct_I.unpack(str[start:end])
00218 pattern = '<%sf'%length
00219 start = end
00220 end += struct.calcsize(pattern)
00221 self.floats = struct.unpack(pattern, str[start:end])
00222 start = end
00223 end += 4
00224 (length,) = _struct_I.unpack(str[start:end])
00225 self.strings = []
00226 for i in range(0, length):
00227 start = end
00228 end += 4
00229 (length,) = _struct_I.unpack(str[start:end])
00230 start = end
00231 end += length
00232 if python3:
00233 val1 = str[start:end].decode('utf-8')
00234 else:
00235 val1 = str[start:end]
00236 self.strings.append(val1)
00237 return self
00238 except struct.error as e:
00239 raise genpy.DeserializationError(e)
00240
00241
00242 def serialize_numpy(self, buff, numpy):
00243 """
00244 serialize message with numpy array types into buffer
00245 :param buff: buffer, ``StringIO``
00246 :param numpy: numpy python module
00247 """
00248 try:
00249 length = len(self.ints)
00250 buff.write(_struct_I.pack(length))
00251 pattern = '<%si'%length
00252 buff.write(self.ints.tostring())
00253 length = len(self.floats)
00254 buff.write(_struct_I.pack(length))
00255 pattern = '<%sf'%length
00256 buff.write(self.floats.tostring())
00257 length = len(self.strings)
00258 buff.write(_struct_I.pack(length))
00259 for val1 in self.strings:
00260 length = len(val1)
00261 if python3 or type(val1) == unicode:
00262 val1 = val1.encode('utf-8')
00263 length = len(val1)
00264 buff.write(struct.pack('<I%ss'%length, length, val1))
00265 except struct.error as se: self._check_types(se)
00266 except TypeError as te: self._check_types(te)
00267
00268 def deserialize_numpy(self, str, numpy):
00269 """
00270 unpack serialized message in str into this message instance using numpy for array types
00271 :param str: byte array of serialized message, ``str``
00272 :param numpy: numpy python module
00273 """
00274 try:
00275 end = 0
00276 start = end
00277 end += 4
00278 (length,) = _struct_I.unpack(str[start:end])
00279 pattern = '<%si'%length
00280 start = end
00281 end += struct.calcsize(pattern)
00282 self.ints = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00283 start = end
00284 end += 4
00285 (length,) = _struct_I.unpack(str[start:end])
00286 pattern = '<%sf'%length
00287 start = end
00288 end += struct.calcsize(pattern)
00289 self.floats = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00290 start = end
00291 end += 4
00292 (length,) = _struct_I.unpack(str[start:end])
00293 self.strings = []
00294 for i in range(0, length):
00295 start = end
00296 end += 4
00297 (length,) = _struct_I.unpack(str[start:end])
00298 start = end
00299 end += length
00300 if python3:
00301 val1 = str[start:end].decode('utf-8')
00302 else:
00303 val1 = str[start:end]
00304 self.strings.append(val1)
00305 return self
00306 except struct.error as e:
00307 raise genpy.DeserializationError(e)
00308
00309 _struct_I = genpy.struct_I
00310 class RequestParam(object):
00311 _type = 'rosserial_msgs/RequestParam'
00312 _md5sum = 'd7a0c2be00c9fd03cc69f2863de9c4d9'
00313 _request_class = RequestParamRequest
00314 _response_class = RequestParamResponse