_RemoveService.py
Go to the documentation of this file.
00001 """autogenerated by genpy from zeroconf_msgs/RemoveServiceRequest.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 zeroconf_msgs.msg
00008 
00009 class RemoveServiceRequest(genpy.Message):
00010   _md5sum = "7028a4a43349f6cca86209ddd39f607a"
00011   _type = "zeroconf_msgs/RemoveServiceRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """zeroconf_msgs/PublishedService service
00014 
00015 ================================================================================
00016 MSG: zeroconf_msgs/PublishedService
00017 #
00018 # Provides all the properties required for publishing of a zeroconf service.
00019 
00020 string name
00021 string type
00022 string domain
00023 int32 port
00024 string description
00025 
00026 """
00027   __slots__ = ['service']
00028   _slot_types = ['zeroconf_msgs/PublishedService']
00029 
00030   def __init__(self, *args, **kwds):
00031     """
00032     Constructor. Any message fields that are implicitly/explicitly
00033     set to None will be assigned a default value. The recommend
00034     use is keyword arguments as this is more robust to future message
00035     changes.  You cannot mix in-order arguments and keyword arguments.
00036 
00037     The available fields are:
00038        service
00039 
00040     :param args: complete set of field values, in .msg order
00041     :param kwds: use keyword arguments corresponding to message field names
00042     to set specific fields.
00043     """
00044     if args or kwds:
00045       super(RemoveServiceRequest, self).__init__(*args, **kwds)
00046       #message fields cannot be None, assign default values for those that are
00047       if self.service is None:
00048         self.service = zeroconf_msgs.msg.PublishedService()
00049     else:
00050       self.service = zeroconf_msgs.msg.PublishedService()
00051 
00052   def _get_types(self):
00053     """
00054     internal API method
00055     """
00056     return self._slot_types
00057 
00058   def serialize(self, buff):
00059     """
00060     serialize message into buffer
00061     :param buff: buffer, ``StringIO``
00062     """
00063     try:
00064       _x = self.service.name
00065       length = len(_x)
00066       if python3 or type(_x) == unicode:
00067         _x = _x.encode('utf-8')
00068         length = len(_x)
00069       buff.write(struct.pack('<I%ss'%length, length, _x))
00070       _x = self.service.type
00071       length = len(_x)
00072       if python3 or type(_x) == unicode:
00073         _x = _x.encode('utf-8')
00074         length = len(_x)
00075       buff.write(struct.pack('<I%ss'%length, length, _x))
00076       _x = self.service.domain
00077       length = len(_x)
00078       if python3 or type(_x) == unicode:
00079         _x = _x.encode('utf-8')
00080         length = len(_x)
00081       buff.write(struct.pack('<I%ss'%length, length, _x))
00082       buff.write(_struct_i.pack(self.service.port))
00083       _x = self.service.description
00084       length = len(_x)
00085       if python3 or type(_x) == unicode:
00086         _x = _x.encode('utf-8')
00087         length = len(_x)
00088       buff.write(struct.pack('<I%ss'%length, length, _x))
00089     except struct.error as se: self._check_types(se)
00090     except TypeError as te: self._check_types(te)
00091 
00092   def deserialize(self, str):
00093     """
00094     unpack serialized message in str into this message instance
00095     :param str: byte array of serialized message, ``str``
00096     """
00097     try:
00098       if self.service is None:
00099         self.service = zeroconf_msgs.msg.PublishedService()
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.service.name = str[start:end].decode('utf-8')
00108       else:
00109         self.service.name = 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.service.type = str[start:end].decode('utf-8')
00117       else:
00118         self.service.type = str[start:end]
00119       start = end
00120       end += 4
00121       (length,) = _struct_I.unpack(str[start:end])
00122       start = end
00123       end += length
00124       if python3:
00125         self.service.domain = str[start:end].decode('utf-8')
00126       else:
00127         self.service.domain = str[start:end]
00128       start = end
00129       end += 4
00130       (self.service.port,) = _struct_i.unpack(str[start:end])
00131       start = end
00132       end += 4
00133       (length,) = _struct_I.unpack(str[start:end])
00134       start = end
00135       end += length
00136       if python3:
00137         self.service.description = str[start:end].decode('utf-8')
00138       else:
00139         self.service.description = str[start:end]
00140       return self
00141     except struct.error as e:
00142       raise genpy.DeserializationError(e) #most likely buffer underfill
00143 
00144 
00145   def serialize_numpy(self, buff, numpy):
00146     """
00147     serialize message with numpy array types into buffer
00148     :param buff: buffer, ``StringIO``
00149     :param numpy: numpy python module
00150     """
00151     try:
00152       _x = self.service.name
00153       length = len(_x)
00154       if python3 or type(_x) == unicode:
00155         _x = _x.encode('utf-8')
00156         length = len(_x)
00157       buff.write(struct.pack('<I%ss'%length, length, _x))
00158       _x = self.service.type
00159       length = len(_x)
00160       if python3 or type(_x) == unicode:
00161         _x = _x.encode('utf-8')
00162         length = len(_x)
00163       buff.write(struct.pack('<I%ss'%length, length, _x))
00164       _x = self.service.domain
00165       length = len(_x)
00166       if python3 or type(_x) == unicode:
00167         _x = _x.encode('utf-8')
00168         length = len(_x)
00169       buff.write(struct.pack('<I%ss'%length, length, _x))
00170       buff.write(_struct_i.pack(self.service.port))
00171       _x = self.service.description
00172       length = len(_x)
00173       if python3 or type(_x) == unicode:
00174         _x = _x.encode('utf-8')
00175         length = len(_x)
00176       buff.write(struct.pack('<I%ss'%length, length, _x))
00177     except struct.error as se: self._check_types(se)
00178     except TypeError as te: self._check_types(te)
00179 
00180   def deserialize_numpy(self, str, numpy):
00181     """
00182     unpack serialized message in str into this message instance using numpy for array types
00183     :param str: byte array of serialized message, ``str``
00184     :param numpy: numpy python module
00185     """
00186     try:
00187       if self.service is None:
00188         self.service = zeroconf_msgs.msg.PublishedService()
00189       end = 0
00190       start = end
00191       end += 4
00192       (length,) = _struct_I.unpack(str[start:end])
00193       start = end
00194       end += length
00195       if python3:
00196         self.service.name = str[start:end].decode('utf-8')
00197       else:
00198         self.service.name = str[start:end]
00199       start = end
00200       end += 4
00201       (length,) = _struct_I.unpack(str[start:end])
00202       start = end
00203       end += length
00204       if python3:
00205         self.service.type = str[start:end].decode('utf-8')
00206       else:
00207         self.service.type = str[start:end]
00208       start = end
00209       end += 4
00210       (length,) = _struct_I.unpack(str[start:end])
00211       start = end
00212       end += length
00213       if python3:
00214         self.service.domain = str[start:end].decode('utf-8')
00215       else:
00216         self.service.domain = str[start:end]
00217       start = end
00218       end += 4
00219       (self.service.port,) = _struct_i.unpack(str[start:end])
00220       start = end
00221       end += 4
00222       (length,) = _struct_I.unpack(str[start:end])
00223       start = end
00224       end += length
00225       if python3:
00226         self.service.description = str[start:end].decode('utf-8')
00227       else:
00228         self.service.description = str[start:end]
00229       return self
00230     except struct.error as e:
00231       raise genpy.DeserializationError(e) #most likely buffer underfill
00232 
00233 _struct_I = genpy.struct_I
00234 _struct_i = struct.Struct("<i")
00235 """autogenerated by genpy from zeroconf_msgs/RemoveServiceResponse.msg. Do not edit."""
00236 import sys
00237 python3 = True if sys.hexversion > 0x03000000 else False
00238 import genpy
00239 import struct
00240 
00241 
00242 class RemoveServiceResponse(genpy.Message):
00243   _md5sum = "eb13ac1f1354ccecb7941ee8fa2192e8"
00244   _type = "zeroconf_msgs/RemoveServiceResponse"
00245   _has_header = False #flag to mark the presence of a Header object
00246   _full_text = """bool result
00247 
00248 
00249 """
00250   __slots__ = ['result']
00251   _slot_types = ['bool']
00252 
00253   def __init__(self, *args, **kwds):
00254     """
00255     Constructor. Any message fields that are implicitly/explicitly
00256     set to None will be assigned a default value. The recommend
00257     use is keyword arguments as this is more robust to future message
00258     changes.  You cannot mix in-order arguments and keyword arguments.
00259 
00260     The available fields are:
00261        result
00262 
00263     :param args: complete set of field values, in .msg order
00264     :param kwds: use keyword arguments corresponding to message field names
00265     to set specific fields.
00266     """
00267     if args or kwds:
00268       super(RemoveServiceResponse, self).__init__(*args, **kwds)
00269       #message fields cannot be None, assign default values for those that are
00270       if self.result is None:
00271         self.result = False
00272     else:
00273       self.result = False
00274 
00275   def _get_types(self):
00276     """
00277     internal API method
00278     """
00279     return self._slot_types
00280 
00281   def serialize(self, buff):
00282     """
00283     serialize message into buffer
00284     :param buff: buffer, ``StringIO``
00285     """
00286     try:
00287       buff.write(_struct_B.pack(self.result))
00288     except struct.error as se: self._check_types(se)
00289     except TypeError as te: self._check_types(te)
00290 
00291   def deserialize(self, str):
00292     """
00293     unpack serialized message in str into this message instance
00294     :param str: byte array of serialized message, ``str``
00295     """
00296     try:
00297       end = 0
00298       start = end
00299       end += 1
00300       (self.result,) = _struct_B.unpack(str[start:end])
00301       self.result = bool(self.result)
00302       return self
00303     except struct.error as e:
00304       raise genpy.DeserializationError(e) #most likely buffer underfill
00305 
00306 
00307   def serialize_numpy(self, buff, numpy):
00308     """
00309     serialize message with numpy array types into buffer
00310     :param buff: buffer, ``StringIO``
00311     :param numpy: numpy python module
00312     """
00313     try:
00314       buff.write(_struct_B.pack(self.result))
00315     except struct.error as se: self._check_types(se)
00316     except TypeError as te: self._check_types(te)
00317 
00318   def deserialize_numpy(self, str, numpy):
00319     """
00320     unpack serialized message in str into this message instance using numpy for array types
00321     :param str: byte array of serialized message, ``str``
00322     :param numpy: numpy python module
00323     """
00324     try:
00325       end = 0
00326       start = end
00327       end += 1
00328       (self.result,) = _struct_B.unpack(str[start:end])
00329       self.result = bool(self.result)
00330       return self
00331     except struct.error as e:
00332       raise genpy.DeserializationError(e) #most likely buffer underfill
00333 
00334 _struct_I = genpy.struct_I
00335 _struct_B = struct.Struct("<B")
00336 class RemoveService(object):
00337   _type          = 'zeroconf_msgs/RemoveService'
00338   _md5sum = '2ae0e420b2f58ab49b813cd81e42d4b3'
00339   _request_class  = RemoveServiceRequest
00340   _response_class = RemoveServiceResponse


zeroconf_msgs
Author(s): Daniel Stonier
autogenerated on Thu Jan 2 2014 12:14:34