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