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