00001 """autogenerated by genpy from ethercat_hardware/SoftProcessorResetRequest.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 SoftProcessorResetRequest(genpy.Message):
00009 _md5sum = "777be25d71e9e85e62fa14223ffddb6b"
00010 _type = "ethercat_hardware/SoftProcessorResetRequest"
00011 _has_header = False
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(SoftProcessorResetRequest, self).__init__(*args, **kwds)
00036
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)
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)
00153
00154 _struct_I = genpy.struct_I
00155 """autogenerated by genpy from ethercat_hardware/SoftProcessorResetResponse.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 SoftProcessorResetResponse(genpy.Message):
00163 _md5sum = "d006c48be24db1173a071ca9af4c8179"
00164 _type = "ethercat_hardware/SoftProcessorResetResponse"
00165 _has_header = False
00166 _full_text = """bool success
00167 string error_msg
00168
00169
00170 """
00171 __slots__ = ['success','error_msg']
00172 _slot_types = ['bool','string']
00173
00174 def __init__(self, *args, **kwds):
00175 """
00176 Constructor. Any message fields that are implicitly/explicitly
00177 set to None will be assigned a default value. The recommend
00178 use is keyword arguments as this is more robust to future message
00179 changes. You cannot mix in-order arguments and keyword arguments.
00180
00181 The available fields are:
00182 success,error_msg
00183
00184 :param args: complete set of field values, in .msg order
00185 :param kwds: use keyword arguments corresponding to message field names
00186 to set specific fields.
00187 """
00188 if args or kwds:
00189 super(SoftProcessorResetResponse, self).__init__(*args, **kwds)
00190
00191 if self.success is None:
00192 self.success = False
00193 if self.error_msg is None:
00194 self.error_msg = ''
00195 else:
00196 self.success = False
00197 self.error_msg = ''
00198
00199 def _get_types(self):
00200 """
00201 internal API method
00202 """
00203 return self._slot_types
00204
00205 def serialize(self, buff):
00206 """
00207 serialize message into buffer
00208 :param buff: buffer, ``StringIO``
00209 """
00210 try:
00211 buff.write(_struct_B.pack(self.success))
00212 _x = self.error_msg
00213 length = len(_x)
00214 if python3 or type(_x) == unicode:
00215 _x = _x.encode('utf-8')
00216 length = len(_x)
00217 buff.write(struct.pack('<I%ss'%length, length, _x))
00218 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00219 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00220
00221 def deserialize(self, str):
00222 """
00223 unpack serialized message in str into this message instance
00224 :param str: byte array of serialized message, ``str``
00225 """
00226 try:
00227 end = 0
00228 start = end
00229 end += 1
00230 (self.success,) = _struct_B.unpack(str[start:end])
00231 self.success = bool(self.success)
00232 start = end
00233 end += 4
00234 (length,) = _struct_I.unpack(str[start:end])
00235 start = end
00236 end += length
00237 if python3:
00238 self.error_msg = str[start:end].decode('utf-8')
00239 else:
00240 self.error_msg = str[start:end]
00241 return self
00242 except struct.error as e:
00243 raise genpy.DeserializationError(e)
00244
00245
00246 def serialize_numpy(self, buff, numpy):
00247 """
00248 serialize message with numpy array types into buffer
00249 :param buff: buffer, ``StringIO``
00250 :param numpy: numpy python module
00251 """
00252 try:
00253 buff.write(_struct_B.pack(self.success))
00254 _x = self.error_msg
00255 length = len(_x)
00256 if python3 or type(_x) == unicode:
00257 _x = _x.encode('utf-8')
00258 length = len(_x)
00259 buff.write(struct.pack('<I%ss'%length, length, _x))
00260 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00261 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00262
00263 def deserialize_numpy(self, str, numpy):
00264 """
00265 unpack serialized message in str into this message instance using numpy for array types
00266 :param str: byte array of serialized message, ``str``
00267 :param numpy: numpy python module
00268 """
00269 try:
00270 end = 0
00271 start = end
00272 end += 1
00273 (self.success,) = _struct_B.unpack(str[start:end])
00274 self.success = bool(self.success)
00275 start = end
00276 end += 4
00277 (length,) = _struct_I.unpack(str[start:end])
00278 start = end
00279 end += length
00280 if python3:
00281 self.error_msg = str[start:end].decode('utf-8')
00282 else:
00283 self.error_msg = str[start:end]
00284 return self
00285 except struct.error as e:
00286 raise genpy.DeserializationError(e)
00287
00288 _struct_I = genpy.struct_I
00289 _struct_B = struct.Struct("<B")
00290 class SoftProcessorReset(object):
00291 _type = 'ethercat_hardware/SoftProcessorReset'
00292 _md5sum = '338c1a9d2fcf7479cddb1ea63dbc8af9'
00293 _request_class = SoftProcessorResetRequest
00294 _response_class = SoftProcessorResetResponse