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