_ListDiscoveredServices.py
Go to the documentation of this file.
00001 """autogenerated by genpy from zeroconf_msgs/ListDiscoveredServicesRequest.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 ListDiscoveredServicesRequest(genpy.Message):
00009   _md5sum = "e1bf1fd6519c823d87c16f342a193a85"
00010   _type = "zeroconf_msgs/ListDiscoveredServicesRequest"
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(ListDiscoveredServicesRequest, 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/ListDiscoveredServicesResponse.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 ListDiscoveredServicesResponse(genpy.Message):
00129   _md5sum = "5e5ad0f4eb44cd96b6518cfd53715bb5"
00130   _type = "zeroconf_msgs/ListDiscoveredServicesResponse"
00131   _has_header = False #flag to mark the presence of a Header object
00132   _full_text = """zeroconf_msgs/DiscoveredService[] services
00133 
00134 
00135 ================================================================================
00136 MSG: zeroconf_msgs/DiscoveredService
00137 #
00138 # Provides all the properties required for definition of a discovered 
00139 # zeroconf service. Note that it contains rather alot more information
00140 # than that which is used to publish a zeroconf service.
00141 
00142 # Service Part
00143 string name
00144 string type
00145 string domain
00146 string description
00147 
00148 # Resolved part
00149 string hostname
00150 string[] ipv4_addresses
00151 string[] ipv6_addresses
00152 int32 port
00153 
00154 # These are detailed variables that you should not normally need
00155 # and can be safely ignored in most circumstances (currently used
00156 # by the avahi implementation).
00157 
00158 uint32 cookie
00159 bool is_local
00160 bool our_own
00161 bool wide_area
00162 bool multicast
00163 bool cached
00164 
00165 
00166 """
00167   __slots__ = ['services']
00168   _slot_types = ['zeroconf_msgs/DiscoveredService[]']
00169 
00170   def __init__(self, *args, **kwds):
00171     """
00172     Constructor. Any message fields that are implicitly/explicitly
00173     set to None will be assigned a default value. The recommend
00174     use is keyword arguments as this is more robust to future message
00175     changes.  You cannot mix in-order arguments and keyword arguments.
00176 
00177     The available fields are:
00178        services
00179 
00180     :param args: complete set of field values, in .msg order
00181     :param kwds: use keyword arguments corresponding to message field names
00182     to set specific fields.
00183     """
00184     if args or kwds:
00185       super(ListDiscoveredServicesResponse, self).__init__(*args, **kwds)
00186       #message fields cannot be None, assign default values for those that are
00187       if self.services is None:
00188         self.services = []
00189     else:
00190       self.services = []
00191 
00192   def _get_types(self):
00193     """
00194     internal API method
00195     """
00196     return self._slot_types
00197 
00198   def serialize(self, buff):
00199     """
00200     serialize message into buffer
00201     :param buff: buffer, ``StringIO``
00202     """
00203     try:
00204       length = len(self.services)
00205       buff.write(_struct_I.pack(length))
00206       for val1 in self.services:
00207         _x = val1.name
00208         length = len(_x)
00209         if python3 or type(_x) == unicode:
00210           _x = _x.encode('utf-8')
00211           length = len(_x)
00212         buff.write(struct.pack('<I%ss'%length, length, _x))
00213         _x = val1.type
00214         length = len(_x)
00215         if python3 or type(_x) == unicode:
00216           _x = _x.encode('utf-8')
00217           length = len(_x)
00218         buff.write(struct.pack('<I%ss'%length, length, _x))
00219         _x = val1.domain
00220         length = len(_x)
00221         if python3 or type(_x) == unicode:
00222           _x = _x.encode('utf-8')
00223           length = len(_x)
00224         buff.write(struct.pack('<I%ss'%length, length, _x))
00225         _x = val1.description
00226         length = len(_x)
00227         if python3 or type(_x) == unicode:
00228           _x = _x.encode('utf-8')
00229           length = len(_x)
00230         buff.write(struct.pack('<I%ss'%length, length, _x))
00231         _x = val1.hostname
00232         length = len(_x)
00233         if python3 or type(_x) == unicode:
00234           _x = _x.encode('utf-8')
00235           length = len(_x)
00236         buff.write(struct.pack('<I%ss'%length, length, _x))
00237         length = len(val1.ipv4_addresses)
00238         buff.write(_struct_I.pack(length))
00239         for val2 in val1.ipv4_addresses:
00240           length = len(val2)
00241           if python3 or type(val2) == unicode:
00242             val2 = val2.encode('utf-8')
00243             length = len(val2)
00244           buff.write(struct.pack('<I%ss'%length, length, val2))
00245         length = len(val1.ipv6_addresses)
00246         buff.write(_struct_I.pack(length))
00247         for val2 in val1.ipv6_addresses:
00248           length = len(val2)
00249           if python3 or type(val2) == unicode:
00250             val2 = val2.encode('utf-8')
00251             length = len(val2)
00252           buff.write(struct.pack('<I%ss'%length, length, val2))
00253         _x = val1
00254         buff.write(_struct_iI5B.pack(_x.port, _x.cookie, _x.is_local, _x.our_own, _x.wide_area, _x.multicast, _x.cached))
00255     except struct.error as se: self._check_types(se)
00256     except TypeError as te: self._check_types(te)
00257 
00258   def deserialize(self, str):
00259     """
00260     unpack serialized message in str into this message instance
00261     :param str: byte array of serialized message, ``str``
00262     """
00263     try:
00264       if self.services is None:
00265         self.services = None
00266       end = 0
00267       start = end
00268       end += 4
00269       (length,) = _struct_I.unpack(str[start:end])
00270       self.services = []
00271       for i in range(0, length):
00272         val1 = zeroconf_msgs.msg.DiscoveredService()
00273         start = end
00274         end += 4
00275         (length,) = _struct_I.unpack(str[start:end])
00276         start = end
00277         end += length
00278         if python3:
00279           val1.name = str[start:end].decode('utf-8')
00280         else:
00281           val1.name = str[start:end]
00282         start = end
00283         end += 4
00284         (length,) = _struct_I.unpack(str[start:end])
00285         start = end
00286         end += length
00287         if python3:
00288           val1.type = str[start:end].decode('utf-8')
00289         else:
00290           val1.type = str[start:end]
00291         start = end
00292         end += 4
00293         (length,) = _struct_I.unpack(str[start:end])
00294         start = end
00295         end += length
00296         if python3:
00297           val1.domain = str[start:end].decode('utf-8')
00298         else:
00299           val1.domain = str[start:end]
00300         start = end
00301         end += 4
00302         (length,) = _struct_I.unpack(str[start:end])
00303         start = end
00304         end += length
00305         if python3:
00306           val1.description = str[start:end].decode('utf-8')
00307         else:
00308           val1.description = str[start:end]
00309         start = end
00310         end += 4
00311         (length,) = _struct_I.unpack(str[start:end])
00312         start = end
00313         end += length
00314         if python3:
00315           val1.hostname = str[start:end].decode('utf-8')
00316         else:
00317           val1.hostname = str[start:end]
00318         start = end
00319         end += 4
00320         (length,) = _struct_I.unpack(str[start:end])
00321         val1.ipv4_addresses = []
00322         for i in range(0, length):
00323           start = end
00324           end += 4
00325           (length,) = _struct_I.unpack(str[start:end])
00326           start = end
00327           end += length
00328           if python3:
00329             val2 = str[start:end].decode('utf-8')
00330           else:
00331             val2 = str[start:end]
00332           val1.ipv4_addresses.append(val2)
00333         start = end
00334         end += 4
00335         (length,) = _struct_I.unpack(str[start:end])
00336         val1.ipv6_addresses = []
00337         for i in range(0, length):
00338           start = end
00339           end += 4
00340           (length,) = _struct_I.unpack(str[start:end])
00341           start = end
00342           end += length
00343           if python3:
00344             val2 = str[start:end].decode('utf-8')
00345           else:
00346             val2 = str[start:end]
00347           val1.ipv6_addresses.append(val2)
00348         _x = val1
00349         start = end
00350         end += 13
00351         (_x.port, _x.cookie, _x.is_local, _x.our_own, _x.wide_area, _x.multicast, _x.cached,) = _struct_iI5B.unpack(str[start:end])
00352         val1.is_local = bool(val1.is_local)
00353         val1.our_own = bool(val1.our_own)
00354         val1.wide_area = bool(val1.wide_area)
00355         val1.multicast = bool(val1.multicast)
00356         val1.cached = bool(val1.cached)
00357         self.services.append(val1)
00358       return self
00359     except struct.error as e:
00360       raise genpy.DeserializationError(e) #most likely buffer underfill
00361 
00362 
00363   def serialize_numpy(self, buff, numpy):
00364     """
00365     serialize message with numpy array types into buffer
00366     :param buff: buffer, ``StringIO``
00367     :param numpy: numpy python module
00368     """
00369     try:
00370       length = len(self.services)
00371       buff.write(_struct_I.pack(length))
00372       for val1 in self.services:
00373         _x = val1.name
00374         length = len(_x)
00375         if python3 or type(_x) == unicode:
00376           _x = _x.encode('utf-8')
00377           length = len(_x)
00378         buff.write(struct.pack('<I%ss'%length, length, _x))
00379         _x = val1.type
00380         length = len(_x)
00381         if python3 or type(_x) == unicode:
00382           _x = _x.encode('utf-8')
00383           length = len(_x)
00384         buff.write(struct.pack('<I%ss'%length, length, _x))
00385         _x = val1.domain
00386         length = len(_x)
00387         if python3 or type(_x) == unicode:
00388           _x = _x.encode('utf-8')
00389           length = len(_x)
00390         buff.write(struct.pack('<I%ss'%length, length, _x))
00391         _x = val1.description
00392         length = len(_x)
00393         if python3 or type(_x) == unicode:
00394           _x = _x.encode('utf-8')
00395           length = len(_x)
00396         buff.write(struct.pack('<I%ss'%length, length, _x))
00397         _x = val1.hostname
00398         length = len(_x)
00399         if python3 or type(_x) == unicode:
00400           _x = _x.encode('utf-8')
00401           length = len(_x)
00402         buff.write(struct.pack('<I%ss'%length, length, _x))
00403         length = len(val1.ipv4_addresses)
00404         buff.write(_struct_I.pack(length))
00405         for val2 in val1.ipv4_addresses:
00406           length = len(val2)
00407           if python3 or type(val2) == unicode:
00408             val2 = val2.encode('utf-8')
00409             length = len(val2)
00410           buff.write(struct.pack('<I%ss'%length, length, val2))
00411         length = len(val1.ipv6_addresses)
00412         buff.write(_struct_I.pack(length))
00413         for val2 in val1.ipv6_addresses:
00414           length = len(val2)
00415           if python3 or type(val2) == unicode:
00416             val2 = val2.encode('utf-8')
00417             length = len(val2)
00418           buff.write(struct.pack('<I%ss'%length, length, val2))
00419         _x = val1
00420         buff.write(_struct_iI5B.pack(_x.port, _x.cookie, _x.is_local, _x.our_own, _x.wide_area, _x.multicast, _x.cached))
00421     except struct.error as se: self._check_types(se)
00422     except TypeError as te: self._check_types(te)
00423 
00424   def deserialize_numpy(self, str, numpy):
00425     """
00426     unpack serialized message in str into this message instance using numpy for array types
00427     :param str: byte array of serialized message, ``str``
00428     :param numpy: numpy python module
00429     """
00430     try:
00431       if self.services is None:
00432         self.services = None
00433       end = 0
00434       start = end
00435       end += 4
00436       (length,) = _struct_I.unpack(str[start:end])
00437       self.services = []
00438       for i in range(0, length):
00439         val1 = zeroconf_msgs.msg.DiscoveredService()
00440         start = end
00441         end += 4
00442         (length,) = _struct_I.unpack(str[start:end])
00443         start = end
00444         end += length
00445         if python3:
00446           val1.name = str[start:end].decode('utf-8')
00447         else:
00448           val1.name = str[start:end]
00449         start = end
00450         end += 4
00451         (length,) = _struct_I.unpack(str[start:end])
00452         start = end
00453         end += length
00454         if python3:
00455           val1.type = str[start:end].decode('utf-8')
00456         else:
00457           val1.type = str[start:end]
00458         start = end
00459         end += 4
00460         (length,) = _struct_I.unpack(str[start:end])
00461         start = end
00462         end += length
00463         if python3:
00464           val1.domain = str[start:end].decode('utf-8')
00465         else:
00466           val1.domain = str[start:end]
00467         start = end
00468         end += 4
00469         (length,) = _struct_I.unpack(str[start:end])
00470         start = end
00471         end += length
00472         if python3:
00473           val1.description = str[start:end].decode('utf-8')
00474         else:
00475           val1.description = str[start:end]
00476         start = end
00477         end += 4
00478         (length,) = _struct_I.unpack(str[start:end])
00479         start = end
00480         end += length
00481         if python3:
00482           val1.hostname = str[start:end].decode('utf-8')
00483         else:
00484           val1.hostname = str[start:end]
00485         start = end
00486         end += 4
00487         (length,) = _struct_I.unpack(str[start:end])
00488         val1.ipv4_addresses = []
00489         for i in range(0, length):
00490           start = end
00491           end += 4
00492           (length,) = _struct_I.unpack(str[start:end])
00493           start = end
00494           end += length
00495           if python3:
00496             val2 = str[start:end].decode('utf-8')
00497           else:
00498             val2 = str[start:end]
00499           val1.ipv4_addresses.append(val2)
00500         start = end
00501         end += 4
00502         (length,) = _struct_I.unpack(str[start:end])
00503         val1.ipv6_addresses = []
00504         for i in range(0, length):
00505           start = end
00506           end += 4
00507           (length,) = _struct_I.unpack(str[start:end])
00508           start = end
00509           end += length
00510           if python3:
00511             val2 = str[start:end].decode('utf-8')
00512           else:
00513             val2 = str[start:end]
00514           val1.ipv6_addresses.append(val2)
00515         _x = val1
00516         start = end
00517         end += 13
00518         (_x.port, _x.cookie, _x.is_local, _x.our_own, _x.wide_area, _x.multicast, _x.cached,) = _struct_iI5B.unpack(str[start:end])
00519         val1.is_local = bool(val1.is_local)
00520         val1.our_own = bool(val1.our_own)
00521         val1.wide_area = bool(val1.wide_area)
00522         val1.multicast = bool(val1.multicast)
00523         val1.cached = bool(val1.cached)
00524         self.services.append(val1)
00525       return self
00526     except struct.error as e:
00527       raise genpy.DeserializationError(e) #most likely buffer underfill
00528 
00529 _struct_I = genpy.struct_I
00530 _struct_iI5B = struct.Struct("<iI5B")
00531 class ListDiscoveredServices(object):
00532   _type          = 'zeroconf_msgs/ListDiscoveredServices'
00533   _md5sum = '5e4f7a51e03f794adcd5dbfc4a5acfb6'
00534   _request_class  = ListDiscoveredServicesRequest
00535   _response_class = ListDiscoveredServicesResponse


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