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