$search
00001 """autogenerated by genmsg_py from FrequencyList.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class FrequencyList(roslib.message.Message): 00007 _md5sum = "f0eb56ba18ff1561bfb4a25766d9b2e7" 00008 _type = "wpa_supplicant_node/FrequencyList" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """int32[] frequencies # Frequencies in MHz 00011 00012 """ 00013 __slots__ = ['frequencies'] 00014 _slot_types = ['int32[]'] 00015 00016 def __init__(self, *args, **kwds): 00017 """ 00018 Constructor. Any message fields that are implicitly/explicitly 00019 set to None will be assigned a default value. The recommend 00020 use is keyword arguments as this is more robust to future message 00021 changes. You cannot mix in-order arguments and keyword arguments. 00022 00023 The available fields are: 00024 frequencies 00025 00026 @param args: complete set of field values, in .msg order 00027 @param kwds: use keyword arguments corresponding to message field names 00028 to set specific fields. 00029 """ 00030 if args or kwds: 00031 super(FrequencyList, self).__init__(*args, **kwds) 00032 #message fields cannot be None, assign default values for those that are 00033 if self.frequencies is None: 00034 self.frequencies = [] 00035 else: 00036 self.frequencies = [] 00037 00038 def _get_types(self): 00039 """ 00040 internal API method 00041 """ 00042 return self._slot_types 00043 00044 def serialize(self, buff): 00045 """ 00046 serialize message into buffer 00047 @param buff: buffer 00048 @type buff: StringIO 00049 """ 00050 try: 00051 length = len(self.frequencies) 00052 buff.write(_struct_I.pack(length)) 00053 pattern = '<%si'%length 00054 buff.write(struct.pack(pattern, *self.frequencies)) 00055 except struct.error as se: self._check_types(se) 00056 except TypeError as te: self._check_types(te) 00057 00058 def deserialize(self, str): 00059 """ 00060 unpack serialized message in str into this message instance 00061 @param str: byte array of serialized message 00062 @type str: str 00063 """ 00064 try: 00065 end = 0 00066 start = end 00067 end += 4 00068 (length,) = _struct_I.unpack(str[start:end]) 00069 pattern = '<%si'%length 00070 start = end 00071 end += struct.calcsize(pattern) 00072 self.frequencies = struct.unpack(pattern, str[start:end]) 00073 return self 00074 except struct.error as e: 00075 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00076 00077 00078 def serialize_numpy(self, buff, numpy): 00079 """ 00080 serialize message with numpy array types into buffer 00081 @param buff: buffer 00082 @type buff: StringIO 00083 @param numpy: numpy python module 00084 @type numpy module 00085 """ 00086 try: 00087 length = len(self.frequencies) 00088 buff.write(_struct_I.pack(length)) 00089 pattern = '<%si'%length 00090 buff.write(self.frequencies.tostring()) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize_numpy(self, str, numpy): 00095 """ 00096 unpack serialized message in str into this message instance using numpy for array types 00097 @param str: byte array of serialized message 00098 @type str: str 00099 @param numpy: numpy python module 00100 @type numpy: module 00101 """ 00102 try: 00103 end = 0 00104 start = end 00105 end += 4 00106 (length,) = _struct_I.unpack(str[start:end]) 00107 pattern = '<%si'%length 00108 start = end 00109 end += struct.calcsize(pattern) 00110 self.frequencies = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00111 return self 00112 except struct.error as e: 00113 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00114 00115 _struct_I = roslib.message.struct_I