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