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