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