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