$search
00001 """autogenerated by genmsg_py from SiteSurvey.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import wifi_ddwrt.msg 00006 import std_msgs.msg 00007 00008 class SiteSurvey(roslib.message.Message): 00009 _md5sum = "f1063b16bb121ef190ae5edfe09d94ec" 00010 _type = "wifi_ddwrt/SiteSurvey" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """Header header 00013 Network[] networks 00014 00015 ================================================================================ 00016 MSG: std_msgs/Header 00017 # Standard metadata for higher-level stamped data types. 00018 # This is generally used to communicate timestamped data 00019 # in a particular coordinate frame. 00020 # 00021 # sequence ID: consecutively increasing ID 00022 uint32 seq 00023 #Two-integer timestamp that is expressed as: 00024 # * stamp.secs: seconds (stamp_secs) since epoch 00025 # * stamp.nsecs: nanoseconds since stamp_secs 00026 # time-handling sugar is provided by the client library 00027 time stamp 00028 #Frame this data is associated with 00029 # 0: no frame 00030 # 1: global frame 00031 string frame_id 00032 00033 ================================================================================ 00034 MSG: wifi_ddwrt/Network 00035 string macattr 00036 string essid 00037 int32 channel 00038 int32 rssi 00039 int32 noise 00040 int32 beacon 00041 00042 """ 00043 __slots__ = ['header','networks'] 00044 _slot_types = ['Header','wifi_ddwrt/Network[]'] 00045 00046 def __init__(self, *args, **kwds): 00047 """ 00048 Constructor. Any message fields that are implicitly/explicitly 00049 set to None will be assigned a default value. The recommend 00050 use is keyword arguments as this is more robust to future message 00051 changes. You cannot mix in-order arguments and keyword arguments. 00052 00053 The available fields are: 00054 header,networks 00055 00056 @param args: complete set of field values, in .msg order 00057 @param kwds: use keyword arguments corresponding to message field names 00058 to set specific fields. 00059 """ 00060 if args or kwds: 00061 super(SiteSurvey, self).__init__(*args, **kwds) 00062 #message fields cannot be None, assign default values for those that are 00063 if self.header is None: 00064 self.header = std_msgs.msg._Header.Header() 00065 if self.networks is None: 00066 self.networks = [] 00067 else: 00068 self.header = std_msgs.msg._Header.Header() 00069 self.networks = [] 00070 00071 def _get_types(self): 00072 """ 00073 internal API method 00074 """ 00075 return self._slot_types 00076 00077 def serialize(self, buff): 00078 """ 00079 serialize message into buffer 00080 @param buff: buffer 00081 @type buff: StringIO 00082 """ 00083 try: 00084 _x = self 00085 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00086 _x = self.header.frame_id 00087 length = len(_x) 00088 buff.write(struct.pack('<I%ss'%length, length, _x)) 00089 length = len(self.networks) 00090 buff.write(_struct_I.pack(length)) 00091 for val1 in self.networks: 00092 _x = val1.macattr 00093 length = len(_x) 00094 buff.write(struct.pack('<I%ss'%length, length, _x)) 00095 _x = val1.essid 00096 length = len(_x) 00097 buff.write(struct.pack('<I%ss'%length, length, _x)) 00098 _x = val1 00099 buff.write(_struct_4i.pack(_x.channel, _x.rssi, _x.noise, _x.beacon)) 00100 except struct.error as se: self._check_types(se) 00101 except TypeError as 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 if self.header is None: 00111 self.header = std_msgs.msg._Header.Header() 00112 end = 0 00113 _x = self 00114 start = end 00115 end += 12 00116 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00117 start = end 00118 end += 4 00119 (length,) = _struct_I.unpack(str[start:end]) 00120 start = end 00121 end += length 00122 self.header.frame_id = str[start:end] 00123 start = end 00124 end += 4 00125 (length,) = _struct_I.unpack(str[start:end]) 00126 self.networks = [] 00127 for i in range(0, length): 00128 val1 = wifi_ddwrt.msg.Network() 00129 start = end 00130 end += 4 00131 (length,) = _struct_I.unpack(str[start:end]) 00132 start = end 00133 end += length 00134 val1.macattr = str[start:end] 00135 start = end 00136 end += 4 00137 (length,) = _struct_I.unpack(str[start:end]) 00138 start = end 00139 end += length 00140 val1.essid = str[start:end] 00141 _x = val1 00142 start = end 00143 end += 16 00144 (_x.channel, _x.rssi, _x.noise, _x.beacon,) = _struct_4i.unpack(str[start:end]) 00145 self.networks.append(val1) 00146 return self 00147 except struct.error as e: 00148 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00149 00150 00151 def serialize_numpy(self, buff, numpy): 00152 """ 00153 serialize message with numpy array types into buffer 00154 @param buff: buffer 00155 @type buff: StringIO 00156 @param numpy: numpy python module 00157 @type numpy module 00158 """ 00159 try: 00160 _x = self 00161 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00162 _x = self.header.frame_id 00163 length = len(_x) 00164 buff.write(struct.pack('<I%ss'%length, length, _x)) 00165 length = len(self.networks) 00166 buff.write(_struct_I.pack(length)) 00167 for val1 in self.networks: 00168 _x = val1.macattr 00169 length = len(_x) 00170 buff.write(struct.pack('<I%ss'%length, length, _x)) 00171 _x = val1.essid 00172 length = len(_x) 00173 buff.write(struct.pack('<I%ss'%length, length, _x)) 00174 _x = val1 00175 buff.write(_struct_4i.pack(_x.channel, _x.rssi, _x.noise, _x.beacon)) 00176 except struct.error as se: self._check_types(se) 00177 except TypeError as te: self._check_types(te) 00178 00179 def deserialize_numpy(self, str, numpy): 00180 """ 00181 unpack serialized message in str into this message instance using numpy for array types 00182 @param str: byte array of serialized message 00183 @type str: str 00184 @param numpy: numpy python module 00185 @type numpy: module 00186 """ 00187 try: 00188 if self.header is None: 00189 self.header = std_msgs.msg._Header.Header() 00190 end = 0 00191 _x = self 00192 start = end 00193 end += 12 00194 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00195 start = end 00196 end += 4 00197 (length,) = _struct_I.unpack(str[start:end]) 00198 start = end 00199 end += length 00200 self.header.frame_id = str[start:end] 00201 start = end 00202 end += 4 00203 (length,) = _struct_I.unpack(str[start:end]) 00204 self.networks = [] 00205 for i in range(0, length): 00206 val1 = wifi_ddwrt.msg.Network() 00207 start = end 00208 end += 4 00209 (length,) = _struct_I.unpack(str[start:end]) 00210 start = end 00211 end += length 00212 val1.macattr = str[start:end] 00213 start = end 00214 end += 4 00215 (length,) = _struct_I.unpack(str[start:end]) 00216 start = end 00217 end += length 00218 val1.essid = str[start:end] 00219 _x = val1 00220 start = end 00221 end += 16 00222 (_x.channel, _x.rssi, _x.noise, _x.beacon,) = _struct_4i.unpack(str[start:end]) 00223 self.networks.append(val1) 00224 return self 00225 except struct.error as e: 00226 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00227 00228 _struct_I = roslib.message.struct_I 00229 _struct_3I = struct.Struct("<3I") 00230 _struct_4i = struct.Struct("<4i")