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 = "7e82af957734dd3fb1fb7cd11c425ca8"
00010 _type = "wpa_supplicant_node/ScanResult"
00011 _has_header = False
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
00034 #InformationElement []ies
00035 #InformationElement []beacon_ies
00036 # flags
00037 # tsf
00038 # age
00039
00040 """
00041 __slots__ = ['success','bss']
00042 _slot_types = ['bool','wpa_supplicant_node/Bss[]']
00043
00044 def __init__(self, *args, **kwds):
00045 """
00046 Constructor. Any message fields that are implicitly/explicitly
00047 set to None will be assigned a default value. The recommend
00048 use is keyword arguments as this is more robust to future message
00049 changes. You cannot mix in-order arguments and keyword arguments.
00050
00051 The available fields are:
00052 success,bss
00053
00054 @param args: complete set of field values, in .msg order
00055 @param kwds: use keyword arguments corresponding to message field names
00056 to set specific fields.
00057 """
00058 if args or kwds:
00059 super(ScanResult, self).__init__(*args, **kwds)
00060
00061 if self.success is None:
00062 self.success = False
00063 if self.bss is None:
00064 self.bss = []
00065 else:
00066 self.success = False
00067 self.bss = []
00068
00069 def _get_types(self):
00070 """
00071 internal API method
00072 """
00073 return self._slot_types
00074
00075 def serialize(self, buff):
00076 """
00077 serialize message into buffer
00078 @param buff: buffer
00079 @type buff: StringIO
00080 """
00081 try:
00082 buff.write(_struct_B.pack(self.success))
00083 length = len(self.bss)
00084 buff.write(_struct_I.pack(length))
00085 for val1 in self.bss:
00086 _v1 = val1.stamp
00087 _x = _v1
00088 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00089 _x = val1.ssid
00090 length = len(_x)
00091 buff.write(struct.pack('<I%ss'%length, length, _x))
00092 _x = val1.bssid
00093
00094 if type(_x) in [list, tuple]:
00095 buff.write(_struct_6B.pack(*_x))
00096 else:
00097 buff.write(_struct_6s.pack(_x))
00098 _x = val1
00099 buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00100 except struct.error, se: self._check_types(se)
00101 except TypeError, te: self._check_types(te)
00102
00103 def deserialize(self, str):
00104 """
00105 unpack serialized message in str into this message instance
00106 @param str: byte array of serialized message
00107 @type str: str
00108 """
00109 try:
00110 end = 0
00111 start = end
00112 end += 1
00113 (self.success,) = _struct_B.unpack(str[start:end])
00114 self.success = bool(self.success)
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 self.bss = []
00119 for i in xrange(0, length):
00120 val1 = wpa_supplicant_node.msg.Bss()
00121 _v2 = val1.stamp
00122 _x = _v2
00123 start = end
00124 end += 8
00125 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00126 start = end
00127 end += 4
00128 (length,) = _struct_I.unpack(str[start:end])
00129 start = end
00130 end += length
00131 val1.ssid = str[start:end]
00132 start = end
00133 end += 6
00134 val1.bssid = str[start:end]
00135 _x = val1
00136 start = end
00137 end += 20
00138 (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00139 self.bss.append(val1)
00140 return self
00141 except struct.error, e:
00142 raise roslib.message.DeserializationError(e)
00143
00144
00145 def serialize_numpy(self, buff, numpy):
00146 """
00147 serialize message with numpy array types into buffer
00148 @param buff: buffer
00149 @type buff: StringIO
00150 @param numpy: numpy python module
00151 @type numpy module
00152 """
00153 try:
00154 buff.write(_struct_B.pack(self.success))
00155 length = len(self.bss)
00156 buff.write(_struct_I.pack(length))
00157 for val1 in self.bss:
00158 _v3 = val1.stamp
00159 _x = _v3
00160 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00161 _x = val1.ssid
00162 length = len(_x)
00163 buff.write(struct.pack('<I%ss'%length, length, _x))
00164 _x = val1.bssid
00165
00166 if type(_x) in [list, tuple]:
00167 buff.write(_struct_6B.pack(*_x))
00168 else:
00169 buff.write(_struct_6s.pack(_x))
00170 _x = val1
00171 buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00172 except struct.error, se: self._check_types(se)
00173 except TypeError, te: self._check_types(te)
00174
00175 def deserialize_numpy(self, str, numpy):
00176 """
00177 unpack serialized message in str into this message instance using numpy for array types
00178 @param str: byte array of serialized message
00179 @type str: str
00180 @param numpy: numpy python module
00181 @type numpy: module
00182 """
00183 try:
00184 end = 0
00185 start = end
00186 end += 1
00187 (self.success,) = _struct_B.unpack(str[start:end])
00188 self.success = bool(self.success)
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 self.bss = []
00193 for i in xrange(0, length):
00194 val1 = wpa_supplicant_node.msg.Bss()
00195 _v4 = val1.stamp
00196 _x = _v4
00197 start = end
00198 end += 8
00199 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00200 start = end
00201 end += 4
00202 (length,) = _struct_I.unpack(str[start:end])
00203 start = end
00204 end += length
00205 val1.ssid = str[start:end]
00206 start = end
00207 end += 6
00208 val1.bssid = str[start:end]
00209 _x = val1
00210 start = end
00211 end += 20
00212 (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00213 self.bss.append(val1)
00214 return self
00215 except struct.error, e:
00216 raise roslib.message.DeserializationError(e)
00217
00218 _struct_I = roslib.message.struct_I
00219 _struct_6B = struct.Struct("<6B")
00220 _struct_B = struct.Struct("<B")
00221 _struct_2I = struct.Struct("<2I")
00222 _struct_6s = struct.Struct("<6s")
00223 _struct_i2h3i = struct.Struct("<i2h3i")