_Bss.py
Go to the documentation of this file.
00001 """autogenerated by genpy from wpa_supplicant_node/Bss.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 genpy
00009 
00010 class Bss(genpy.Message):
00011   _md5sum = "80facb0ec718ef7a27a68ac18771763a"
00012   _type = "wpa_supplicant_node/Bss"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """time stamp
00015 string ssid
00016 uint8[6] bssid
00017 int32 frequency # In MHz
00018 int16 beacon_interval
00019 int16 capabilities
00020 int32 quality
00021 int32 noise
00022 int32 level
00023 SecurityProperties wpa
00024 SecurityProperties rsn
00025 
00026 #InformationElement []ies
00027 #InformationElement []beacon_ies
00028 # flags
00029 # tsf
00030 # age
00031 
00032 ================================================================================
00033 MSG: wpa_supplicant_node/SecurityProperties
00034 string[] key_mgmt
00035 string[] group
00036 string[] pairwise
00037 
00038 """
00039   __slots__ = ['stamp','ssid','bssid','frequency','beacon_interval','capabilities','quality','noise','level','wpa','rsn']
00040   _slot_types = ['time','string','uint8[6]','int32','int16','int16','int32','int32','int32','wpa_supplicant_node/SecurityProperties','wpa_supplicant_node/SecurityProperties']
00041 
00042   def __init__(self, *args, **kwds):
00043     """
00044     Constructor. Any message fields that are implicitly/explicitly
00045     set to None will be assigned a default value. The recommend
00046     use is keyword arguments as this is more robust to future message
00047     changes.  You cannot mix in-order arguments and keyword arguments.
00048 
00049     The available fields are:
00050        stamp,ssid,bssid,frequency,beacon_interval,capabilities,quality,noise,level,wpa,rsn
00051 
00052     :param args: complete set of field values, in .msg order
00053     :param kwds: use keyword arguments corresponding to message field names
00054     to set specific fields.
00055     """
00056     if args or kwds:
00057       super(Bss, self).__init__(*args, **kwds)
00058       #message fields cannot be None, assign default values for those that are
00059       if self.stamp is None:
00060         self.stamp = genpy.Time()
00061       if self.ssid is None:
00062         self.ssid = ''
00063       if self.bssid is None:
00064         self.bssid = chr(0)*6
00065       if self.frequency is None:
00066         self.frequency = 0
00067       if self.beacon_interval is None:
00068         self.beacon_interval = 0
00069       if self.capabilities is None:
00070         self.capabilities = 0
00071       if self.quality is None:
00072         self.quality = 0
00073       if self.noise is None:
00074         self.noise = 0
00075       if self.level is None:
00076         self.level = 0
00077       if self.wpa is None:
00078         self.wpa = wpa_supplicant_node.msg.SecurityProperties()
00079       if self.rsn is None:
00080         self.rsn = wpa_supplicant_node.msg.SecurityProperties()
00081     else:
00082       self.stamp = genpy.Time()
00083       self.ssid = ''
00084       self.bssid = chr(0)*6
00085       self.frequency = 0
00086       self.beacon_interval = 0
00087       self.capabilities = 0
00088       self.quality = 0
00089       self.noise = 0
00090       self.level = 0
00091       self.wpa = wpa_supplicant_node.msg.SecurityProperties()
00092       self.rsn = wpa_supplicant_node.msg.SecurityProperties()
00093 
00094   def _get_types(self):
00095     """
00096     internal API method
00097     """
00098     return self._slot_types
00099 
00100   def serialize(self, buff):
00101     """
00102     serialize message into buffer
00103     :param buff: buffer, ``StringIO``
00104     """
00105     try:
00106       _x = self
00107       buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs))
00108       _x = self.ssid
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self.bssid
00115       # - if encoded as a list instead, serialize as bytes instead of string
00116       if type(_x) in [list, tuple]:
00117         buff.write(_struct_6B.pack(*_x))
00118       else:
00119         buff.write(_struct_6s.pack(_x))
00120       _x = self
00121       buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00122       length = len(self.wpa.key_mgmt)
00123       buff.write(_struct_I.pack(length))
00124       for val1 in self.wpa.key_mgmt:
00125         length = len(val1)
00126         if python3 or type(val1) == unicode:
00127           val1 = val1.encode('utf-8')
00128           length = len(val1)
00129         buff.write(struct.pack('<I%ss'%length, length, val1))
00130       length = len(self.wpa.group)
00131       buff.write(_struct_I.pack(length))
00132       for val1 in self.wpa.group:
00133         length = len(val1)
00134         if python3 or type(val1) == unicode:
00135           val1 = val1.encode('utf-8')
00136           length = len(val1)
00137         buff.write(struct.pack('<I%ss'%length, length, val1))
00138       length = len(self.wpa.pairwise)
00139       buff.write(_struct_I.pack(length))
00140       for val1 in self.wpa.pairwise:
00141         length = len(val1)
00142         if python3 or type(val1) == unicode:
00143           val1 = val1.encode('utf-8')
00144           length = len(val1)
00145         buff.write(struct.pack('<I%ss'%length, length, val1))
00146       length = len(self.rsn.key_mgmt)
00147       buff.write(_struct_I.pack(length))
00148       for val1 in self.rsn.key_mgmt:
00149         length = len(val1)
00150         if python3 or type(val1) == unicode:
00151           val1 = val1.encode('utf-8')
00152           length = len(val1)
00153         buff.write(struct.pack('<I%ss'%length, length, val1))
00154       length = len(self.rsn.group)
00155       buff.write(_struct_I.pack(length))
00156       for val1 in self.rsn.group:
00157         length = len(val1)
00158         if python3 or type(val1) == unicode:
00159           val1 = val1.encode('utf-8')
00160           length = len(val1)
00161         buff.write(struct.pack('<I%ss'%length, length, val1))
00162       length = len(self.rsn.pairwise)
00163       buff.write(_struct_I.pack(length))
00164       for val1 in self.rsn.pairwise:
00165         length = len(val1)
00166         if python3 or type(val1) == unicode:
00167           val1 = val1.encode('utf-8')
00168           length = len(val1)
00169         buff.write(struct.pack('<I%ss'%length, length, val1))
00170     except struct.error as se: self._check_types(se)
00171     except TypeError as te: self._check_types(te)
00172 
00173   def deserialize(self, str):
00174     """
00175     unpack serialized message in str into this message instance
00176     :param str: byte array of serialized message, ``str``
00177     """
00178     try:
00179       if self.stamp is None:
00180         self.stamp = genpy.Time()
00181       if self.wpa is None:
00182         self.wpa = wpa_supplicant_node.msg.SecurityProperties()
00183       if self.rsn is None:
00184         self.rsn = wpa_supplicant_node.msg.SecurityProperties()
00185       end = 0
00186       _x = self
00187       start = end
00188       end += 8
00189       (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
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.ssid = str[start:end].decode('utf-8')
00197       else:
00198         self.ssid = str[start:end]
00199       start = end
00200       end += 6
00201       self.bssid = str[start:end]
00202       _x = self
00203       start = end
00204       end += 20
00205       (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00206       start = end
00207       end += 4
00208       (length,) = _struct_I.unpack(str[start:end])
00209       self.wpa.key_mgmt = []
00210       for i in range(0, length):
00211         start = end
00212         end += 4
00213         (length,) = _struct_I.unpack(str[start:end])
00214         start = end
00215         end += length
00216         if python3:
00217           val1 = str[start:end].decode('utf-8')
00218         else:
00219           val1 = str[start:end]
00220         self.wpa.key_mgmt.append(val1)
00221       start = end
00222       end += 4
00223       (length,) = _struct_I.unpack(str[start:end])
00224       self.wpa.group = []
00225       for i in range(0, length):
00226         start = end
00227         end += 4
00228         (length,) = _struct_I.unpack(str[start:end])
00229         start = end
00230         end += length
00231         if python3:
00232           val1 = str[start:end].decode('utf-8')
00233         else:
00234           val1 = str[start:end]
00235         self.wpa.group.append(val1)
00236       start = end
00237       end += 4
00238       (length,) = _struct_I.unpack(str[start:end])
00239       self.wpa.pairwise = []
00240       for i in range(0, length):
00241         start = end
00242         end += 4
00243         (length,) = _struct_I.unpack(str[start:end])
00244         start = end
00245         end += length
00246         if python3:
00247           val1 = str[start:end].decode('utf-8')
00248         else:
00249           val1 = str[start:end]
00250         self.wpa.pairwise.append(val1)
00251       start = end
00252       end += 4
00253       (length,) = _struct_I.unpack(str[start:end])
00254       self.rsn.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           val1 = str[start:end].decode('utf-8')
00263         else:
00264           val1 = str[start:end]
00265         self.rsn.key_mgmt.append(val1)
00266       start = end
00267       end += 4
00268       (length,) = _struct_I.unpack(str[start:end])
00269       self.rsn.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           val1 = str[start:end].decode('utf-8')
00278         else:
00279           val1 = str[start:end]
00280         self.rsn.group.append(val1)
00281       start = end
00282       end += 4
00283       (length,) = _struct_I.unpack(str[start:end])
00284       self.rsn.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           val1 = str[start:end].decode('utf-8')
00293         else:
00294           val1 = str[start:end]
00295         self.rsn.pairwise.append(val1)
00296       self.stamp.canon()
00297       return self
00298     except struct.error as e:
00299       raise genpy.DeserializationError(e) #most likely buffer underfill
00300 
00301 
00302   def serialize_numpy(self, buff, numpy):
00303     """
00304     serialize message with numpy array types into buffer
00305     :param buff: buffer, ``StringIO``
00306     :param numpy: numpy python module
00307     """
00308     try:
00309       _x = self
00310       buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs))
00311       _x = self.ssid
00312       length = len(_x)
00313       if python3 or type(_x) == unicode:
00314         _x = _x.encode('utf-8')
00315         length = len(_x)
00316       buff.write(struct.pack('<I%ss'%length, length, _x))
00317       _x = self.bssid
00318       # - if encoded as a list instead, serialize as bytes instead of string
00319       if type(_x) in [list, tuple]:
00320         buff.write(_struct_6B.pack(*_x))
00321       else:
00322         buff.write(_struct_6s.pack(_x))
00323       _x = self
00324       buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00325       length = len(self.wpa.key_mgmt)
00326       buff.write(_struct_I.pack(length))
00327       for val1 in self.wpa.key_mgmt:
00328         length = len(val1)
00329         if python3 or type(val1) == unicode:
00330           val1 = val1.encode('utf-8')
00331           length = len(val1)
00332         buff.write(struct.pack('<I%ss'%length, length, val1))
00333       length = len(self.wpa.group)
00334       buff.write(_struct_I.pack(length))
00335       for val1 in self.wpa.group:
00336         length = len(val1)
00337         if python3 or type(val1) == unicode:
00338           val1 = val1.encode('utf-8')
00339           length = len(val1)
00340         buff.write(struct.pack('<I%ss'%length, length, val1))
00341       length = len(self.wpa.pairwise)
00342       buff.write(_struct_I.pack(length))
00343       for val1 in self.wpa.pairwise:
00344         length = len(val1)
00345         if python3 or type(val1) == unicode:
00346           val1 = val1.encode('utf-8')
00347           length = len(val1)
00348         buff.write(struct.pack('<I%ss'%length, length, val1))
00349       length = len(self.rsn.key_mgmt)
00350       buff.write(_struct_I.pack(length))
00351       for val1 in self.rsn.key_mgmt:
00352         length = len(val1)
00353         if python3 or type(val1) == unicode:
00354           val1 = val1.encode('utf-8')
00355           length = len(val1)
00356         buff.write(struct.pack('<I%ss'%length, length, val1))
00357       length = len(self.rsn.group)
00358       buff.write(_struct_I.pack(length))
00359       for val1 in self.rsn.group:
00360         length = len(val1)
00361         if python3 or type(val1) == unicode:
00362           val1 = val1.encode('utf-8')
00363           length = len(val1)
00364         buff.write(struct.pack('<I%ss'%length, length, val1))
00365       length = len(self.rsn.pairwise)
00366       buff.write(_struct_I.pack(length))
00367       for val1 in self.rsn.pairwise:
00368         length = len(val1)
00369         if python3 or type(val1) == unicode:
00370           val1 = val1.encode('utf-8')
00371           length = len(val1)
00372         buff.write(struct.pack('<I%ss'%length, length, val1))
00373     except struct.error as se: self._check_types(se)
00374     except TypeError as te: self._check_types(te)
00375 
00376   def deserialize_numpy(self, str, numpy):
00377     """
00378     unpack serialized message in str into this message instance using numpy for array types
00379     :param str: byte array of serialized message, ``str``
00380     :param numpy: numpy python module
00381     """
00382     try:
00383       if self.stamp is None:
00384         self.stamp = genpy.Time()
00385       if self.wpa is None:
00386         self.wpa = wpa_supplicant_node.msg.SecurityProperties()
00387       if self.rsn is None:
00388         self.rsn = wpa_supplicant_node.msg.SecurityProperties()
00389       end = 0
00390       _x = self
00391       start = end
00392       end += 8
00393       (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00394       start = end
00395       end += 4
00396       (length,) = _struct_I.unpack(str[start:end])
00397       start = end
00398       end += length
00399       if python3:
00400         self.ssid = str[start:end].decode('utf-8')
00401       else:
00402         self.ssid = str[start:end]
00403       start = end
00404       end += 6
00405       self.bssid = str[start:end]
00406       _x = self
00407       start = end
00408       end += 20
00409       (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00410       start = end
00411       end += 4
00412       (length,) = _struct_I.unpack(str[start:end])
00413       self.wpa.key_mgmt = []
00414       for i in range(0, length):
00415         start = end
00416         end += 4
00417         (length,) = _struct_I.unpack(str[start:end])
00418         start = end
00419         end += length
00420         if python3:
00421           val1 = str[start:end].decode('utf-8')
00422         else:
00423           val1 = str[start:end]
00424         self.wpa.key_mgmt.append(val1)
00425       start = end
00426       end += 4
00427       (length,) = _struct_I.unpack(str[start:end])
00428       self.wpa.group = []
00429       for i in range(0, length):
00430         start = end
00431         end += 4
00432         (length,) = _struct_I.unpack(str[start:end])
00433         start = end
00434         end += length
00435         if python3:
00436           val1 = str[start:end].decode('utf-8')
00437         else:
00438           val1 = str[start:end]
00439         self.wpa.group.append(val1)
00440       start = end
00441       end += 4
00442       (length,) = _struct_I.unpack(str[start:end])
00443       self.wpa.pairwise = []
00444       for i in range(0, length):
00445         start = end
00446         end += 4
00447         (length,) = _struct_I.unpack(str[start:end])
00448         start = end
00449         end += length
00450         if python3:
00451           val1 = str[start:end].decode('utf-8')
00452         else:
00453           val1 = str[start:end]
00454         self.wpa.pairwise.append(val1)
00455       start = end
00456       end += 4
00457       (length,) = _struct_I.unpack(str[start:end])
00458       self.rsn.key_mgmt = []
00459       for i in range(0, length):
00460         start = end
00461         end += 4
00462         (length,) = _struct_I.unpack(str[start:end])
00463         start = end
00464         end += length
00465         if python3:
00466           val1 = str[start:end].decode('utf-8')
00467         else:
00468           val1 = str[start:end]
00469         self.rsn.key_mgmt.append(val1)
00470       start = end
00471       end += 4
00472       (length,) = _struct_I.unpack(str[start:end])
00473       self.rsn.group = []
00474       for i in range(0, length):
00475         start = end
00476         end += 4
00477         (length,) = _struct_I.unpack(str[start:end])
00478         start = end
00479         end += length
00480         if python3:
00481           val1 = str[start:end].decode('utf-8')
00482         else:
00483           val1 = str[start:end]
00484         self.rsn.group.append(val1)
00485       start = end
00486       end += 4
00487       (length,) = _struct_I.unpack(str[start:end])
00488       self.rsn.pairwise = []
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           val1 = str[start:end].decode('utf-8')
00497         else:
00498           val1 = str[start:end]
00499         self.rsn.pairwise.append(val1)
00500       self.stamp.canon()
00501       return self
00502     except struct.error as e:
00503       raise genpy.DeserializationError(e) #most likely buffer underfill
00504 
00505 _struct_I = genpy.struct_I
00506 _struct_6B = struct.Struct("<6B")
00507 _struct_6s = struct.Struct("<6s")
00508 _struct_2I = struct.Struct("<2I")
00509 _struct_i2h3i = struct.Struct("<i2h3i")


wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Jan 2 2014 11:25:12