00001 """autogenerated by genmsg_py from Bss.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006
00007 class Bss(roslib.message.Message):
00008 _md5sum = "fa88f4690f619bb03b8ddd7ec1c4c83f"
00009 _type = "wpa_supplicant_node/Bss"
00010 _has_header = False
00011 _full_text = """time stamp
00012 string ssid
00013 uint8[6] bssid
00014 int32 frequency # In MHz
00015 int16 beacon_interval
00016 int16 capabilities
00017 int32 quality
00018 int32 noise
00019 int32 level
00020
00021 #InformationElement []ies
00022 #InformationElement []beacon_ies
00023 # flags
00024 # tsf
00025 # age
00026
00027 """
00028 __slots__ = ['stamp','ssid','bssid','frequency','beacon_interval','capabilities','quality','noise','level']
00029 _slot_types = ['time','string','uint8[6]','int32','int16','int16','int32','int32','int32']
00030
00031 def __init__(self, *args, **kwds):
00032 """
00033 Constructor. Any message fields that are implicitly/explicitly
00034 set to None will be assigned a default value. The recommend
00035 use is keyword arguments as this is more robust to future message
00036 changes. You cannot mix in-order arguments and keyword arguments.
00037
00038 The available fields are:
00039 stamp,ssid,bssid,frequency,beacon_interval,capabilities,quality,noise,level
00040
00041 @param args: complete set of field values, in .msg order
00042 @param kwds: use keyword arguments corresponding to message field names
00043 to set specific fields.
00044 """
00045 if args or kwds:
00046 super(Bss, self).__init__(*args, **kwds)
00047
00048 if self.stamp is None:
00049 self.stamp = roslib.rostime.Time()
00050 if self.ssid is None:
00051 self.ssid = ''
00052 if self.bssid is None:
00053 self.bssid = chr(0)*6
00054 if self.frequency is None:
00055 self.frequency = 0
00056 if self.beacon_interval is None:
00057 self.beacon_interval = 0
00058 if self.capabilities is None:
00059 self.capabilities = 0
00060 if self.quality is None:
00061 self.quality = 0
00062 if self.noise is None:
00063 self.noise = 0
00064 if self.level is None:
00065 self.level = 0
00066 else:
00067 self.stamp = roslib.rostime.Time()
00068 self.ssid = ''
00069 self.bssid = chr(0)*6
00070 self.frequency = 0
00071 self.beacon_interval = 0
00072 self.capabilities = 0
00073 self.quality = 0
00074 self.noise = 0
00075 self.level = 0
00076
00077 def _get_types(self):
00078 """
00079 internal API method
00080 """
00081 return self._slot_types
00082
00083 def serialize(self, buff):
00084 """
00085 serialize message into buffer
00086 @param buff: buffer
00087 @type buff: StringIO
00088 """
00089 try:
00090 _x = self
00091 buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs))
00092 _x = self.ssid
00093 length = len(_x)
00094 buff.write(struct.pack('<I%ss'%length, length, _x))
00095 _x = self.bssid
00096
00097 if type(_x) in [list, tuple]:
00098 buff.write(_struct_6B.pack(*_x))
00099 else:
00100 buff.write(_struct_6s.pack(_x))
00101 _x = self
00102 buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00103 except struct.error, se: self._check_types(se)
00104 except TypeError, te: self._check_types(te)
00105
00106 def deserialize(self, str):
00107 """
00108 unpack serialized message in str into this message instance
00109 @param str: byte array of serialized message
00110 @type str: str
00111 """
00112 try:
00113 if self.stamp is None:
00114 self.stamp = roslib.rostime.Time()
00115 end = 0
00116 _x = self
00117 start = end
00118 end += 8
00119 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00120 start = end
00121 end += 4
00122 (length,) = _struct_I.unpack(str[start:end])
00123 start = end
00124 end += length
00125 self.ssid = str[start:end]
00126 start = end
00127 end += 6
00128 self.bssid = str[start:end]
00129 _x = self
00130 start = end
00131 end += 20
00132 (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00133 self.stamp.canon()
00134 return self
00135 except struct.error, e:
00136 raise roslib.message.DeserializationError(e)
00137
00138
00139 def serialize_numpy(self, buff, numpy):
00140 """
00141 serialize message with numpy array types into buffer
00142 @param buff: buffer
00143 @type buff: StringIO
00144 @param numpy: numpy python module
00145 @type numpy module
00146 """
00147 try:
00148 _x = self
00149 buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs))
00150 _x = self.ssid
00151 length = len(_x)
00152 buff.write(struct.pack('<I%ss'%length, length, _x))
00153 _x = self.bssid
00154
00155 if type(_x) in [list, tuple]:
00156 buff.write(_struct_6B.pack(*_x))
00157 else:
00158 buff.write(_struct_6s.pack(_x))
00159 _x = self
00160 buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00161 except struct.error, se: self._check_types(se)
00162 except TypeError, te: self._check_types(te)
00163
00164 def deserialize_numpy(self, str, numpy):
00165 """
00166 unpack serialized message in str into this message instance using numpy for array types
00167 @param str: byte array of serialized message
00168 @type str: str
00169 @param numpy: numpy python module
00170 @type numpy: module
00171 """
00172 try:
00173 if self.stamp is None:
00174 self.stamp = roslib.rostime.Time()
00175 end = 0
00176 _x = self
00177 start = end
00178 end += 8
00179 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00180 start = end
00181 end += 4
00182 (length,) = _struct_I.unpack(str[start:end])
00183 start = end
00184 end += length
00185 self.ssid = str[start:end]
00186 start = end
00187 end += 6
00188 self.bssid = str[start:end]
00189 _x = self
00190 start = end
00191 end += 20
00192 (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00193 self.stamp.canon()
00194 return self
00195 except struct.error, e:
00196 raise roslib.message.DeserializationError(e)
00197
00198 _struct_I = roslib.message.struct_I
00199 _struct_6B = struct.Struct("<6B")
00200 _struct_6s = struct.Struct("<6s")
00201 _struct_2I = struct.Struct("<2I")
00202 _struct_i2h3i = struct.Struct("<i2h3i")