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


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