_MultiInterfaceStatus.py
Go to the documentation of this file.
00001 """autogenerated by genpy from multi_interface_roam/MultiInterfaceStatus.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 wpa_supplicant_node.msg
00008 import multi_interface_roam.msg
00009 import genpy
00010 
00011 class MultiInterfaceStatus(genpy.Message):
00012   _md5sum = "8cc48fc7b9fd9a6f7f5e63eb7bc51745"
00013   _type = "multi_interface_roam/MultiInterfaceStatus"
00014   _has_header = False #flag to mark the presence of a Header object
00015   _full_text = """InterfaceStatus[] interfaces
00016 
00017 ================================================================================
00018 MSG: multi_interface_roam/InterfaceStatus
00019 int8 STATE_NO_INTERFACE = -1 # The interface does not exist.
00020 int8 STATE_PLUGGED = 0       # The interface exists.
00021 int8 STATE_UP = 1            # The interface is up.
00022 int8 STATE_LINK = 2          # The interface has a link.
00023 int8 STATE_LINK_ADDR = 3     # The interface has a link, and the link has an address.
00024 int8 STATE_ADDR = 4          # The interface has an address.
00025 int8 STATE_PINGING = 5       # Ping packets are making it through.
00026 
00027 string pretty_name           # The pretty name of the interface.
00028 string interface             # The name of the interface.
00029 int8 state                   # The state (defined above).
00030 int32 active_interface_rank  # The rank among active interfaces (e.g. 0 for the best active interface) or -1 if inactive
00031 float32 goodness             # How well this interface is sending packets.
00032 float32 reliability          # How reliable this interface is expected to be.
00033 float32 score                # The score use to rank interfaces.
00034 float32 prescore             # The score use to rank interfaces without penalizing radios that are not active.
00035 float32 latency              # Latency of ping packets.
00036 float32 loss                 # Loss of ping packets.
00037 wpa_supplicant_node/Bss bss  # Current BSS (for a wireless network)
00038 
00039 ================================================================================
00040 MSG: wpa_supplicant_node/Bss
00041 time stamp
00042 string ssid
00043 uint8[6] bssid
00044 int32 frequency # In MHz
00045 int16 beacon_interval
00046 int16 capabilities
00047 int32 quality
00048 int32 noise
00049 int32 level
00050 SecurityProperties wpa
00051 SecurityProperties rsn
00052 
00053 #InformationElement []ies
00054 #InformationElement []beacon_ies
00055 # flags
00056 # tsf
00057 # age
00058 
00059 ================================================================================
00060 MSG: wpa_supplicant_node/SecurityProperties
00061 string[] key_mgmt
00062 string[] group
00063 string[] pairwise
00064 
00065 """
00066   __slots__ = ['interfaces']
00067   _slot_types = ['multi_interface_roam/InterfaceStatus[]']
00068 
00069   def __init__(self, *args, **kwds):
00070     """
00071     Constructor. Any message fields that are implicitly/explicitly
00072     set to None will be assigned a default value. The recommend
00073     use is keyword arguments as this is more robust to future message
00074     changes.  You cannot mix in-order arguments and keyword arguments.
00075 
00076     The available fields are:
00077        interfaces
00078 
00079     :param args: complete set of field values, in .msg order
00080     :param kwds: use keyword arguments corresponding to message field names
00081     to set specific fields.
00082     """
00083     if args or kwds:
00084       super(MultiInterfaceStatus, self).__init__(*args, **kwds)
00085       #message fields cannot be None, assign default values for those that are
00086       if self.interfaces is None:
00087         self.interfaces = []
00088     else:
00089       self.interfaces = []
00090 
00091   def _get_types(self):
00092     """
00093     internal API method
00094     """
00095     return self._slot_types
00096 
00097   def serialize(self, buff):
00098     """
00099     serialize message into buffer
00100     :param buff: buffer, ``StringIO``
00101     """
00102     try:
00103       length = len(self.interfaces)
00104       buff.write(_struct_I.pack(length))
00105       for val1 in self.interfaces:
00106         _x = val1.pretty_name
00107         length = len(_x)
00108         if python3 or type(_x) == unicode:
00109           _x = _x.encode('utf-8')
00110           length = len(_x)
00111         buff.write(struct.pack('<I%ss'%length, length, _x))
00112         _x = val1.interface
00113         length = len(_x)
00114         if python3 or type(_x) == unicode:
00115           _x = _x.encode('utf-8')
00116           length = len(_x)
00117         buff.write(struct.pack('<I%ss'%length, length, _x))
00118         _x = val1
00119         buff.write(_struct_bi6f.pack(_x.state, _x.active_interface_rank, _x.goodness, _x.reliability, _x.score, _x.prescore, _x.latency, _x.loss))
00120         _v1 = val1.bss
00121         _v2 = _v1.stamp
00122         _x = _v2
00123         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00124         _x = _v1.ssid
00125         length = len(_x)
00126         if python3 or type(_x) == unicode:
00127           _x = _x.encode('utf-8')
00128           length = len(_x)
00129         buff.write(struct.pack('<I%ss'%length, length, _x))
00130         _x = _v1.bssid
00131         # - if encoded as a list instead, serialize as bytes instead of string
00132         if type(_x) in [list, tuple]:
00133           buff.write(_struct_6B.pack(*_x))
00134         else:
00135           buff.write(_struct_6s.pack(_x))
00136         _x = _v1
00137         buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00138         _v3 = _v1.wpa
00139         length = len(_v3.key_mgmt)
00140         buff.write(_struct_I.pack(length))
00141         for val4 in _v3.key_mgmt:
00142           length = len(val4)
00143           if python3 or type(val4) == unicode:
00144             val4 = val4.encode('utf-8')
00145             length = len(val4)
00146           buff.write(struct.pack('<I%ss'%length, length, val4))
00147         length = len(_v3.group)
00148         buff.write(_struct_I.pack(length))
00149         for val4 in _v3.group:
00150           length = len(val4)
00151           if python3 or type(val4) == unicode:
00152             val4 = val4.encode('utf-8')
00153             length = len(val4)
00154           buff.write(struct.pack('<I%ss'%length, length, val4))
00155         length = len(_v3.pairwise)
00156         buff.write(_struct_I.pack(length))
00157         for val4 in _v3.pairwise:
00158           length = len(val4)
00159           if python3 or type(val4) == unicode:
00160             val4 = val4.encode('utf-8')
00161             length = len(val4)
00162           buff.write(struct.pack('<I%ss'%length, length, val4))
00163         _v4 = _v1.rsn
00164         length = len(_v4.key_mgmt)
00165         buff.write(_struct_I.pack(length))
00166         for val4 in _v4.key_mgmt:
00167           length = len(val4)
00168           if python3 or type(val4) == unicode:
00169             val4 = val4.encode('utf-8')
00170             length = len(val4)
00171           buff.write(struct.pack('<I%ss'%length, length, val4))
00172         length = len(_v4.group)
00173         buff.write(_struct_I.pack(length))
00174         for val4 in _v4.group:
00175           length = len(val4)
00176           if python3 or type(val4) == unicode:
00177             val4 = val4.encode('utf-8')
00178             length = len(val4)
00179           buff.write(struct.pack('<I%ss'%length, length, val4))
00180         length = len(_v4.pairwise)
00181         buff.write(_struct_I.pack(length))
00182         for val4 in _v4.pairwise:
00183           length = len(val4)
00184           if python3 or type(val4) == unicode:
00185             val4 = val4.encode('utf-8')
00186             length = len(val4)
00187           buff.write(struct.pack('<I%ss'%length, length, val4))
00188     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00189     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00190 
00191   def deserialize(self, str):
00192     """
00193     unpack serialized message in str into this message instance
00194     :param str: byte array of serialized message, ``str``
00195     """
00196     try:
00197       if self.interfaces is None:
00198         self.interfaces = None
00199       end = 0
00200       start = end
00201       end += 4
00202       (length,) = _struct_I.unpack(str[start:end])
00203       self.interfaces = []
00204       for i in range(0, length):
00205         val1 = multi_interface_roam.msg.InterfaceStatus()
00206         start = end
00207         end += 4
00208         (length,) = _struct_I.unpack(str[start:end])
00209         start = end
00210         end += length
00211         if python3:
00212           val1.pretty_name = str[start:end].decode('utf-8')
00213         else:
00214           val1.pretty_name = str[start:end]
00215         start = end
00216         end += 4
00217         (length,) = _struct_I.unpack(str[start:end])
00218         start = end
00219         end += length
00220         if python3:
00221           val1.interface = str[start:end].decode('utf-8')
00222         else:
00223           val1.interface = str[start:end]
00224         _x = val1
00225         start = end
00226         end += 29
00227         (_x.state, _x.active_interface_rank, _x.goodness, _x.reliability, _x.score, _x.prescore, _x.latency, _x.loss,) = _struct_bi6f.unpack(str[start:end])
00228         _v5 = val1.bss
00229         _v6 = _v5.stamp
00230         _x = _v6
00231         start = end
00232         end += 8
00233         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00234         start = end
00235         end += 4
00236         (length,) = _struct_I.unpack(str[start:end])
00237         start = end
00238         end += length
00239         if python3:
00240           _v5.ssid = str[start:end].decode('utf-8')
00241         else:
00242           _v5.ssid = str[start:end]
00243         start = end
00244         end += 6
00245         _v5.bssid = str[start:end]
00246         _x = _v5
00247         start = end
00248         end += 20
00249         (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00250         _v7 = _v5.wpa
00251         start = end
00252         end += 4
00253         (length,) = _struct_I.unpack(str[start:end])
00254         _v7.key_mgmt = []
00255         for i in range(0, length):
00256           start = end
00257           end += 4
00258           (length,) = _struct_I.unpack(str[start:end])
00259           start = end
00260           end += length
00261           if python3:
00262             val4 = str[start:end].decode('utf-8')
00263           else:
00264             val4 = str[start:end]
00265           _v7.key_mgmt.append(val4)
00266         start = end
00267         end += 4
00268         (length,) = _struct_I.unpack(str[start:end])
00269         _v7.group = []
00270         for i in range(0, length):
00271           start = end
00272           end += 4
00273           (length,) = _struct_I.unpack(str[start:end])
00274           start = end
00275           end += length
00276           if python3:
00277             val4 = str[start:end].decode('utf-8')
00278           else:
00279             val4 = str[start:end]
00280           _v7.group.append(val4)
00281         start = end
00282         end += 4
00283         (length,) = _struct_I.unpack(str[start:end])
00284         _v7.pairwise = []
00285         for i in range(0, length):
00286           start = end
00287           end += 4
00288           (length,) = _struct_I.unpack(str[start:end])
00289           start = end
00290           end += length
00291           if python3:
00292             val4 = str[start:end].decode('utf-8')
00293           else:
00294             val4 = str[start:end]
00295           _v7.pairwise.append(val4)
00296         _v8 = _v5.rsn
00297         start = end
00298         end += 4
00299         (length,) = _struct_I.unpack(str[start:end])
00300         _v8.key_mgmt = []
00301         for i in range(0, length):
00302           start = end
00303           end += 4
00304           (length,) = _struct_I.unpack(str[start:end])
00305           start = end
00306           end += length
00307           if python3:
00308             val4 = str[start:end].decode('utf-8')
00309           else:
00310             val4 = str[start:end]
00311           _v8.key_mgmt.append(val4)
00312         start = end
00313         end += 4
00314         (length,) = _struct_I.unpack(str[start:end])
00315         _v8.group = []
00316         for i in range(0, length):
00317           start = end
00318           end += 4
00319           (length,) = _struct_I.unpack(str[start:end])
00320           start = end
00321           end += length
00322           if python3:
00323             val4 = str[start:end].decode('utf-8')
00324           else:
00325             val4 = str[start:end]
00326           _v8.group.append(val4)
00327         start = end
00328         end += 4
00329         (length,) = _struct_I.unpack(str[start:end])
00330         _v8.pairwise = []
00331         for i in range(0, length):
00332           start = end
00333           end += 4
00334           (length,) = _struct_I.unpack(str[start:end])
00335           start = end
00336           end += length
00337           if python3:
00338             val4 = str[start:end].decode('utf-8')
00339           else:
00340             val4 = str[start:end]
00341           _v8.pairwise.append(val4)
00342         self.interfaces.append(val1)
00343       return self
00344     except struct.error as e:
00345       raise genpy.DeserializationError(e) #most likely buffer underfill
00346 
00347 
00348   def serialize_numpy(self, buff, numpy):
00349     """
00350     serialize message with numpy array types into buffer
00351     :param buff: buffer, ``StringIO``
00352     :param numpy: numpy python module
00353     """
00354     try:
00355       length = len(self.interfaces)
00356       buff.write(_struct_I.pack(length))
00357       for val1 in self.interfaces:
00358         _x = val1.pretty_name
00359         length = len(_x)
00360         if python3 or type(_x) == unicode:
00361           _x = _x.encode('utf-8')
00362           length = len(_x)
00363         buff.write(struct.pack('<I%ss'%length, length, _x))
00364         _x = val1.interface
00365         length = len(_x)
00366         if python3 or type(_x) == unicode:
00367           _x = _x.encode('utf-8')
00368           length = len(_x)
00369         buff.write(struct.pack('<I%ss'%length, length, _x))
00370         _x = val1
00371         buff.write(_struct_bi6f.pack(_x.state, _x.active_interface_rank, _x.goodness, _x.reliability, _x.score, _x.prescore, _x.latency, _x.loss))
00372         _v9 = val1.bss
00373         _v10 = _v9.stamp
00374         _x = _v10
00375         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00376         _x = _v9.ssid
00377         length = len(_x)
00378         if python3 or type(_x) == unicode:
00379           _x = _x.encode('utf-8')
00380           length = len(_x)
00381         buff.write(struct.pack('<I%ss'%length, length, _x))
00382         _x = _v9.bssid
00383         # - if encoded as a list instead, serialize as bytes instead of string
00384         if type(_x) in [list, tuple]:
00385           buff.write(_struct_6B.pack(*_x))
00386         else:
00387           buff.write(_struct_6s.pack(_x))
00388         _x = _v9
00389         buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00390         _v11 = _v9.wpa
00391         length = len(_v11.key_mgmt)
00392         buff.write(_struct_I.pack(length))
00393         for val4 in _v11.key_mgmt:
00394           length = len(val4)
00395           if python3 or type(val4) == unicode:
00396             val4 = val4.encode('utf-8')
00397             length = len(val4)
00398           buff.write(struct.pack('<I%ss'%length, length, val4))
00399         length = len(_v11.group)
00400         buff.write(_struct_I.pack(length))
00401         for val4 in _v11.group:
00402           length = len(val4)
00403           if python3 or type(val4) == unicode:
00404             val4 = val4.encode('utf-8')
00405             length = len(val4)
00406           buff.write(struct.pack('<I%ss'%length, length, val4))
00407         length = len(_v11.pairwise)
00408         buff.write(_struct_I.pack(length))
00409         for val4 in _v11.pairwise:
00410           length = len(val4)
00411           if python3 or type(val4) == unicode:
00412             val4 = val4.encode('utf-8')
00413             length = len(val4)
00414           buff.write(struct.pack('<I%ss'%length, length, val4))
00415         _v12 = _v9.rsn
00416         length = len(_v12.key_mgmt)
00417         buff.write(_struct_I.pack(length))
00418         for val4 in _v12.key_mgmt:
00419           length = len(val4)
00420           if python3 or type(val4) == unicode:
00421             val4 = val4.encode('utf-8')
00422             length = len(val4)
00423           buff.write(struct.pack('<I%ss'%length, length, val4))
00424         length = len(_v12.group)
00425         buff.write(_struct_I.pack(length))
00426         for val4 in _v12.group:
00427           length = len(val4)
00428           if python3 or type(val4) == unicode:
00429             val4 = val4.encode('utf-8')
00430             length = len(val4)
00431           buff.write(struct.pack('<I%ss'%length, length, val4))
00432         length = len(_v12.pairwise)
00433         buff.write(_struct_I.pack(length))
00434         for val4 in _v12.pairwise:
00435           length = len(val4)
00436           if python3 or type(val4) == unicode:
00437             val4 = val4.encode('utf-8')
00438             length = len(val4)
00439           buff.write(struct.pack('<I%ss'%length, length, val4))
00440     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00441     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00442 
00443   def deserialize_numpy(self, str, numpy):
00444     """
00445     unpack serialized message in str into this message instance using numpy for array types
00446     :param str: byte array of serialized message, ``str``
00447     :param numpy: numpy python module
00448     """
00449     try:
00450       if self.interfaces is None:
00451         self.interfaces = None
00452       end = 0
00453       start = end
00454       end += 4
00455       (length,) = _struct_I.unpack(str[start:end])
00456       self.interfaces = []
00457       for i in range(0, length):
00458         val1 = multi_interface_roam.msg.InterfaceStatus()
00459         start = end
00460         end += 4
00461         (length,) = _struct_I.unpack(str[start:end])
00462         start = end
00463         end += length
00464         if python3:
00465           val1.pretty_name = str[start:end].decode('utf-8')
00466         else:
00467           val1.pretty_name = str[start:end]
00468         start = end
00469         end += 4
00470         (length,) = _struct_I.unpack(str[start:end])
00471         start = end
00472         end += length
00473         if python3:
00474           val1.interface = str[start:end].decode('utf-8')
00475         else:
00476           val1.interface = str[start:end]
00477         _x = val1
00478         start = end
00479         end += 29
00480         (_x.state, _x.active_interface_rank, _x.goodness, _x.reliability, _x.score, _x.prescore, _x.latency, _x.loss,) = _struct_bi6f.unpack(str[start:end])
00481         _v13 = val1.bss
00482         _v14 = _v13.stamp
00483         _x = _v14
00484         start = end
00485         end += 8
00486         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00487         start = end
00488         end += 4
00489         (length,) = _struct_I.unpack(str[start:end])
00490         start = end
00491         end += length
00492         if python3:
00493           _v13.ssid = str[start:end].decode('utf-8')
00494         else:
00495           _v13.ssid = str[start:end]
00496         start = end
00497         end += 6
00498         _v13.bssid = str[start:end]
00499         _x = _v13
00500         start = end
00501         end += 20
00502         (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00503         _v15 = _v13.wpa
00504         start = end
00505         end += 4
00506         (length,) = _struct_I.unpack(str[start:end])
00507         _v15.key_mgmt = []
00508         for i in range(0, length):
00509           start = end
00510           end += 4
00511           (length,) = _struct_I.unpack(str[start:end])
00512           start = end
00513           end += length
00514           if python3:
00515             val4 = str[start:end].decode('utf-8')
00516           else:
00517             val4 = str[start:end]
00518           _v15.key_mgmt.append(val4)
00519         start = end
00520         end += 4
00521         (length,) = _struct_I.unpack(str[start:end])
00522         _v15.group = []
00523         for i in range(0, length):
00524           start = end
00525           end += 4
00526           (length,) = _struct_I.unpack(str[start:end])
00527           start = end
00528           end += length
00529           if python3:
00530             val4 = str[start:end].decode('utf-8')
00531           else:
00532             val4 = str[start:end]
00533           _v15.group.append(val4)
00534         start = end
00535         end += 4
00536         (length,) = _struct_I.unpack(str[start:end])
00537         _v15.pairwise = []
00538         for i in range(0, length):
00539           start = end
00540           end += 4
00541           (length,) = _struct_I.unpack(str[start:end])
00542           start = end
00543           end += length
00544           if python3:
00545             val4 = str[start:end].decode('utf-8')
00546           else:
00547             val4 = str[start:end]
00548           _v15.pairwise.append(val4)
00549         _v16 = _v13.rsn
00550         start = end
00551         end += 4
00552         (length,) = _struct_I.unpack(str[start:end])
00553         _v16.key_mgmt = []
00554         for i in range(0, length):
00555           start = end
00556           end += 4
00557           (length,) = _struct_I.unpack(str[start:end])
00558           start = end
00559           end += length
00560           if python3:
00561             val4 = str[start:end].decode('utf-8')
00562           else:
00563             val4 = str[start:end]
00564           _v16.key_mgmt.append(val4)
00565         start = end
00566         end += 4
00567         (length,) = _struct_I.unpack(str[start:end])
00568         _v16.group = []
00569         for i in range(0, length):
00570           start = end
00571           end += 4
00572           (length,) = _struct_I.unpack(str[start:end])
00573           start = end
00574           end += length
00575           if python3:
00576             val4 = str[start:end].decode('utf-8')
00577           else:
00578             val4 = str[start:end]
00579           _v16.group.append(val4)
00580         start = end
00581         end += 4
00582         (length,) = _struct_I.unpack(str[start:end])
00583         _v16.pairwise = []
00584         for i in range(0, length):
00585           start = end
00586           end += 4
00587           (length,) = _struct_I.unpack(str[start:end])
00588           start = end
00589           end += length
00590           if python3:
00591             val4 = str[start:end].decode('utf-8')
00592           else:
00593             val4 = str[start:end]
00594           _v16.pairwise.append(val4)
00595         self.interfaces.append(val1)
00596       return self
00597     except struct.error as e:
00598       raise genpy.DeserializationError(e) #most likely buffer underfill
00599 
00600 _struct_I = genpy.struct_I
00601 _struct_6B = struct.Struct("<6B")
00602 _struct_bi6f = struct.Struct("<bi6f")
00603 _struct_2I = struct.Struct("<2I")
00604 _struct_6s = struct.Struct("<6s")
00605 _struct_i2h3i = struct.Struct("<i2h3i")


multi_interface_roam
Author(s): Blaise Gassend
autogenerated on Thu Apr 24 2014 15:34:18