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


ethercat_hardware
Author(s): Rob Wheeler (email: wheeler@willowgarage.com), Maintained by Derek King (email: dking@willowgarage.com)
autogenerated on Thu Apr 24 2014 15:43:44