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


wifi_ddwrt
Author(s): Scott Hassan/hassan@willowgarage.com, Eitan Marder-Eppstein/eitan@willowgarage.com
autogenerated on Wed Apr 23 2014 10:36:08