_SetNetworkParameters.py
Go to the documentation of this file.
00001 """autogenerated by genpy from wpa_supplicant_node/SetNetworkParametersRequest.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 wpa_supplicant_node.msg
00008 
00009 class SetNetworkParametersRequest(genpy.Message):
00010   _md5sum = "910652ba566487098d045356b15748d7"
00011   _type = "wpa_supplicant_node/SetNetworkParametersRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """int32 network_id
00014 NetworkParameter[] parameters
00015 
00016 ================================================================================
00017 MSG: wpa_supplicant_node/NetworkParameter
00018 string key
00019 string value
00020 
00021 """
00022   __slots__ = ['network_id','parameters']
00023   _slot_types = ['int32','wpa_supplicant_node/NetworkParameter[]']
00024 
00025   def __init__(self, *args, **kwds):
00026     """
00027     Constructor. Any message fields that are implicitly/explicitly
00028     set to None will be assigned a default value. The recommend
00029     use is keyword arguments as this is more robust to future message
00030     changes.  You cannot mix in-order arguments and keyword arguments.
00031 
00032     The available fields are:
00033        network_id,parameters
00034 
00035     :param args: complete set of field values, in .msg order
00036     :param kwds: use keyword arguments corresponding to message field names
00037     to set specific fields.
00038     """
00039     if args or kwds:
00040       super(SetNetworkParametersRequest, self).__init__(*args, **kwds)
00041       #message fields cannot be None, assign default values for those that are
00042       if self.network_id is None:
00043         self.network_id = 0
00044       if self.parameters is None:
00045         self.parameters = []
00046     else:
00047       self.network_id = 0
00048       self.parameters = []
00049 
00050   def _get_types(self):
00051     """
00052     internal API method
00053     """
00054     return self._slot_types
00055 
00056   def serialize(self, buff):
00057     """
00058     serialize message into buffer
00059     :param buff: buffer, ``StringIO``
00060     """
00061     try:
00062       buff.write(_struct_i.pack(self.network_id))
00063       length = len(self.parameters)
00064       buff.write(_struct_I.pack(length))
00065       for val1 in self.parameters:
00066         _x = val1.key
00067         length = len(_x)
00068         if python3 or type(_x) == unicode:
00069           _x = _x.encode('utf-8')
00070           length = len(_x)
00071         buff.write(struct.pack('<I%ss'%length, length, _x))
00072         _x = val1.value
00073         length = len(_x)
00074         if python3 or type(_x) == unicode:
00075           _x = _x.encode('utf-8')
00076           length = len(_x)
00077         buff.write(struct.pack('<I%ss'%length, length, _x))
00078     except struct.error as se: self._check_types(se)
00079     except TypeError as te: self._check_types(te)
00080 
00081   def deserialize(self, str):
00082     """
00083     unpack serialized message in str into this message instance
00084     :param str: byte array of serialized message, ``str``
00085     """
00086     try:
00087       if self.parameters is None:
00088         self.parameters = None
00089       end = 0
00090       start = end
00091       end += 4
00092       (self.network_id,) = _struct_i.unpack(str[start:end])
00093       start = end
00094       end += 4
00095       (length,) = _struct_I.unpack(str[start:end])
00096       self.parameters = []
00097       for i in range(0, length):
00098         val1 = wpa_supplicant_node.msg.NetworkParameter()
00099         start = end
00100         end += 4
00101         (length,) = _struct_I.unpack(str[start:end])
00102         start = end
00103         end += length
00104         if python3:
00105           val1.key = str[start:end].decode('utf-8')
00106         else:
00107           val1.key = str[start:end]
00108         start = end
00109         end += 4
00110         (length,) = _struct_I.unpack(str[start:end])
00111         start = end
00112         end += length
00113         if python3:
00114           val1.value = str[start:end].decode('utf-8')
00115         else:
00116           val1.value = str[start:end]
00117         self.parameters.append(val1)
00118       return self
00119     except struct.error as e:
00120       raise genpy.DeserializationError(e) #most likely buffer underfill
00121 
00122 
00123   def serialize_numpy(self, buff, numpy):
00124     """
00125     serialize message with numpy array types into buffer
00126     :param buff: buffer, ``StringIO``
00127     :param numpy: numpy python module
00128     """
00129     try:
00130       buff.write(_struct_i.pack(self.network_id))
00131       length = len(self.parameters)
00132       buff.write(_struct_I.pack(length))
00133       for val1 in self.parameters:
00134         _x = val1.key
00135         length = len(_x)
00136         if python3 or type(_x) == unicode:
00137           _x = _x.encode('utf-8')
00138           length = len(_x)
00139         buff.write(struct.pack('<I%ss'%length, length, _x))
00140         _x = val1.value
00141         length = len(_x)
00142         if python3 or type(_x) == unicode:
00143           _x = _x.encode('utf-8')
00144           length = len(_x)
00145         buff.write(struct.pack('<I%ss'%length, length, _x))
00146     except struct.error as se: self._check_types(se)
00147     except TypeError as te: self._check_types(te)
00148 
00149   def deserialize_numpy(self, str, numpy):
00150     """
00151     unpack serialized message in str into this message instance using numpy for array types
00152     :param str: byte array of serialized message, ``str``
00153     :param numpy: numpy python module
00154     """
00155     try:
00156       if self.parameters is None:
00157         self.parameters = None
00158       end = 0
00159       start = end
00160       end += 4
00161       (self.network_id,) = _struct_i.unpack(str[start:end])
00162       start = end
00163       end += 4
00164       (length,) = _struct_I.unpack(str[start:end])
00165       self.parameters = []
00166       for i in range(0, length):
00167         val1 = wpa_supplicant_node.msg.NetworkParameter()
00168         start = end
00169         end += 4
00170         (length,) = _struct_I.unpack(str[start:end])
00171         start = end
00172         end += length
00173         if python3:
00174           val1.key = str[start:end].decode('utf-8')
00175         else:
00176           val1.key = str[start:end]
00177         start = end
00178         end += 4
00179         (length,) = _struct_I.unpack(str[start:end])
00180         start = end
00181         end += length
00182         if python3:
00183           val1.value = str[start:end].decode('utf-8')
00184         else:
00185           val1.value = str[start:end]
00186         self.parameters.append(val1)
00187       return self
00188     except struct.error as e:
00189       raise genpy.DeserializationError(e) #most likely buffer underfill
00190 
00191 _struct_I = genpy.struct_I
00192 _struct_i = struct.Struct("<i")
00193 """autogenerated by genpy from wpa_supplicant_node/SetNetworkParametersResponse.msg. Do not edit."""
00194 import sys
00195 python3 = True if sys.hexversion > 0x03000000 else False
00196 import genpy
00197 import struct
00198 
00199 
00200 class SetNetworkParametersResponse(genpy.Message):
00201   _md5sum = "358e233cde0c8a8bcfea4ce193f8fc15"
00202   _type = "wpa_supplicant_node/SetNetworkParametersResponse"
00203   _has_header = False #flag to mark the presence of a Header object
00204   _full_text = """bool success
00205 
00206 
00207 """
00208   __slots__ = ['success']
00209   _slot_types = ['bool']
00210 
00211   def __init__(self, *args, **kwds):
00212     """
00213     Constructor. Any message fields that are implicitly/explicitly
00214     set to None will be assigned a default value. The recommend
00215     use is keyword arguments as this is more robust to future message
00216     changes.  You cannot mix in-order arguments and keyword arguments.
00217 
00218     The available fields are:
00219        success
00220 
00221     :param args: complete set of field values, in .msg order
00222     :param kwds: use keyword arguments corresponding to message field names
00223     to set specific fields.
00224     """
00225     if args or kwds:
00226       super(SetNetworkParametersResponse, self).__init__(*args, **kwds)
00227       #message fields cannot be None, assign default values for those that are
00228       if self.success is None:
00229         self.success = False
00230     else:
00231       self.success = False
00232 
00233   def _get_types(self):
00234     """
00235     internal API method
00236     """
00237     return self._slot_types
00238 
00239   def serialize(self, buff):
00240     """
00241     serialize message into buffer
00242     :param buff: buffer, ``StringIO``
00243     """
00244     try:
00245       buff.write(_struct_B.pack(self.success))
00246     except struct.error as se: self._check_types(se)
00247     except TypeError as te: self._check_types(te)
00248 
00249   def deserialize(self, str):
00250     """
00251     unpack serialized message in str into this message instance
00252     :param str: byte array of serialized message, ``str``
00253     """
00254     try:
00255       end = 0
00256       start = end
00257       end += 1
00258       (self.success,) = _struct_B.unpack(str[start:end])
00259       self.success = bool(self.success)
00260       return self
00261     except struct.error as e:
00262       raise genpy.DeserializationError(e) #most likely buffer underfill
00263 
00264 
00265   def serialize_numpy(self, buff, numpy):
00266     """
00267     serialize message with numpy array types into buffer
00268     :param buff: buffer, ``StringIO``
00269     :param numpy: numpy python module
00270     """
00271     try:
00272       buff.write(_struct_B.pack(self.success))
00273     except struct.error as se: self._check_types(se)
00274     except TypeError as te: self._check_types(te)
00275 
00276   def deserialize_numpy(self, str, numpy):
00277     """
00278     unpack serialized message in str into this message instance using numpy for array types
00279     :param str: byte array of serialized message, ``str``
00280     :param numpy: numpy python module
00281     """
00282     try:
00283       end = 0
00284       start = end
00285       end += 1
00286       (self.success,) = _struct_B.unpack(str[start:end])
00287       self.success = bool(self.success)
00288       return self
00289     except struct.error as e:
00290       raise genpy.DeserializationError(e) #most likely buffer underfill
00291 
00292 _struct_I = genpy.struct_I
00293 _struct_B = struct.Struct("<B")
00294 class SetNetworkParameters(object):
00295   _type          = 'wpa_supplicant_node/SetNetworkParameters'
00296   _md5sum = '5976506ced89c8f3cbb16c30615609ad'
00297   _request_class  = SetNetworkParametersRequest
00298   _response_class = SetNetworkParametersResponse


wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Jan 2 2014 11:25:12