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


wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Apr 24 2014 15:33:19