_Ack.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/Ack.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 Ack(genpy.Message):
00009   _md5sum = "f84607dc6beaf1cb6772d23af7221bdf"
00010   _type = "applanix_msgs/Ack"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint16 transaction
00013 uint16 id
00014 
00015 uint16 RESPONSE_NOT_APPLICABLE=0
00016 uint16 RESPONSE_ACCEPTED=1
00017 uint16 RESPONSE_ACCEPTED_TOO_LONG=2
00018 uint16 RESPONSE_ACCEPTED_TOO_SHORT=3
00019 uint16 RESPONSE_PARAM_ERROR=4
00020 uint16 RESPONSE_NOT_APPLICABLE_IN_CURRENT_STATE=5
00021 uint16 RESPONSE_DATA_NOT_AVAILABLE=6
00022 uint16 RESPONSE_MESSAGE_START_ERROR=7
00023 uint16 RESPONSE_MESSAGE_END_ERROR=8
00024 uint16 RESPONSE_BYTE_COUNT_ERROR=9
00025 uint16 RESPONSE_CHECKSUM_ERROR=10
00026 uint16 response_code
00027 
00028 uint8 PARAMS_NO_CHANGE=0
00029 uint8 PARAMS_CHANGE=1
00030 uint8 params_status
00031 
00032 uint8[32] error_parameter_name
00033 
00034 """
00035   # Pseudo-constants
00036   RESPONSE_NOT_APPLICABLE = 0
00037   RESPONSE_ACCEPTED = 1
00038   RESPONSE_ACCEPTED_TOO_LONG = 2
00039   RESPONSE_ACCEPTED_TOO_SHORT = 3
00040   RESPONSE_PARAM_ERROR = 4
00041   RESPONSE_NOT_APPLICABLE_IN_CURRENT_STATE = 5
00042   RESPONSE_DATA_NOT_AVAILABLE = 6
00043   RESPONSE_MESSAGE_START_ERROR = 7
00044   RESPONSE_MESSAGE_END_ERROR = 8
00045   RESPONSE_BYTE_COUNT_ERROR = 9
00046   RESPONSE_CHECKSUM_ERROR = 10
00047   PARAMS_NO_CHANGE = 0
00048   PARAMS_CHANGE = 1
00049 
00050   __slots__ = ['transaction','id','response_code','params_status','error_parameter_name']
00051   _slot_types = ['uint16','uint16','uint16','uint8','uint8[32]']
00052 
00053   def __init__(self, *args, **kwds):
00054     """
00055     Constructor. Any message fields that are implicitly/explicitly
00056     set to None will be assigned a default value. The recommend
00057     use is keyword arguments as this is more robust to future message
00058     changes.  You cannot mix in-order arguments and keyword arguments.
00059 
00060     The available fields are:
00061        transaction,id,response_code,params_status,error_parameter_name
00062 
00063     :param args: complete set of field values, in .msg order
00064     :param kwds: use keyword arguments corresponding to message field names
00065     to set specific fields.
00066     """
00067     if args or kwds:
00068       super(Ack, self).__init__(*args, **kwds)
00069       #message fields cannot be None, assign default values for those that are
00070       if self.transaction is None:
00071         self.transaction = 0
00072       if self.id is None:
00073         self.id = 0
00074       if self.response_code is None:
00075         self.response_code = 0
00076       if self.params_status is None:
00077         self.params_status = 0
00078       if self.error_parameter_name is None:
00079         self.error_parameter_name = chr(0)*32
00080     else:
00081       self.transaction = 0
00082       self.id = 0
00083       self.response_code = 0
00084       self.params_status = 0
00085       self.error_parameter_name = chr(0)*32
00086 
00087   def _get_types(self):
00088     """
00089     internal API method
00090     """
00091     return self._slot_types
00092 
00093   def serialize(self, buff):
00094     """
00095     serialize message into buffer
00096     :param buff: buffer, ``StringIO``
00097     """
00098     try:
00099       _x = self
00100       buff.write(_struct_3HB.pack(_x.transaction, _x.id, _x.response_code, _x.params_status))
00101       _x = self.error_parameter_name
00102       # - if encoded as a list instead, serialize as bytes instead of string
00103       if type(_x) in [list, tuple]:
00104         buff.write(_struct_32B.pack(*_x))
00105       else:
00106         buff.write(_struct_32s.pack(_x))
00107     except struct.error as se: self._check_types(se)
00108     except TypeError as te: self._check_types(te)
00109 
00110   def deserialize(self, str):
00111     """
00112     unpack serialized message in str into this message instance
00113     :param str: byte array of serialized message, ``str``
00114     """
00115     try:
00116       end = 0
00117       _x = self
00118       start = end
00119       end += 7
00120       (_x.transaction, _x.id, _x.response_code, _x.params_status,) = _struct_3HB.unpack(str[start:end])
00121       start = end
00122       end += 32
00123       self.error_parameter_name = str[start:end]
00124       return self
00125     except struct.error as e:
00126       raise genpy.DeserializationError(e) #most likely buffer underfill
00127 
00128 
00129   def serialize_numpy(self, buff, numpy):
00130     """
00131     serialize message with numpy array types into buffer
00132     :param buff: buffer, ``StringIO``
00133     :param numpy: numpy python module
00134     """
00135     try:
00136       _x = self
00137       buff.write(_struct_3HB.pack(_x.transaction, _x.id, _x.response_code, _x.params_status))
00138       _x = self.error_parameter_name
00139       # - if encoded as a list instead, serialize as bytes instead of string
00140       if type(_x) in [list, tuple]:
00141         buff.write(_struct_32B.pack(*_x))
00142       else:
00143         buff.write(_struct_32s.pack(_x))
00144     except struct.error as se: self._check_types(se)
00145     except TypeError as te: self._check_types(te)
00146 
00147   def deserialize_numpy(self, str, numpy):
00148     """
00149     unpack serialized message in str into this message instance using numpy for array types
00150     :param str: byte array of serialized message, ``str``
00151     :param numpy: numpy python module
00152     """
00153     try:
00154       end = 0
00155       _x = self
00156       start = end
00157       end += 7
00158       (_x.transaction, _x.id, _x.response_code, _x.params_status,) = _struct_3HB.unpack(str[start:end])
00159       start = end
00160       end += 32
00161       self.error_parameter_name = str[start:end]
00162       return self
00163     except struct.error as e:
00164       raise genpy.DeserializationError(e) #most likely buffer underfill
00165 
00166 _struct_I = genpy.struct_I
00167 _struct_32B = struct.Struct("<32B")
00168 _struct_32s = struct.Struct("<32s")
00169 _struct_3HB = struct.Struct("<3HB")


applanix_msgs
Author(s): Mike Purvis
autogenerated on Thu Jan 2 2014 11:04:51