_CommonFooter.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/CommonFooter.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 CommonFooter(genpy.Message):
00009   _md5sum = "603956a77085dd6eb1088e0cade415b7"
00010   _type = "applanix_msgs/CommonFooter"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string END=$#
00013 uint16 checksum
00014 uint8[2] end
00015 
00016 """
00017   # Pseudo-constants
00018   END = '$#'
00019 
00020   __slots__ = ['checksum','end']
00021   _slot_types = ['uint16','uint8[2]']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        checksum,end
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(CommonFooter, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.checksum is None:
00041         self.checksum = 0
00042       if self.end is None:
00043         self.end = chr(0)*2
00044     else:
00045       self.checksum = 0
00046       self.end = chr(0)*2
00047 
00048   def _get_types(self):
00049     """
00050     internal API method
00051     """
00052     return self._slot_types
00053 
00054   def serialize(self, buff):
00055     """
00056     serialize message into buffer
00057     :param buff: buffer, ``StringIO``
00058     """
00059     try:
00060       buff.write(_struct_H.pack(self.checksum))
00061       _x = self.end
00062       # - if encoded as a list instead, serialize as bytes instead of string
00063       if type(_x) in [list, tuple]:
00064         buff.write(_struct_2B.pack(*_x))
00065       else:
00066         buff.write(_struct_2s.pack(_x))
00067     except struct.error as se: self._check_types(se)
00068     except TypeError as te: self._check_types(te)
00069 
00070   def deserialize(self, str):
00071     """
00072     unpack serialized message in str into this message instance
00073     :param str: byte array of serialized message, ``str``
00074     """
00075     try:
00076       end = 0
00077       start = end
00078       end += 2
00079       (self.checksum,) = _struct_H.unpack(str[start:end])
00080       start = end
00081       end += 2
00082       self.end = str[start:end]
00083       return self
00084     except struct.error as e:
00085       raise genpy.DeserializationError(e) #most likely buffer underfill
00086 
00087 
00088   def serialize_numpy(self, buff, numpy):
00089     """
00090     serialize message with numpy array types into buffer
00091     :param buff: buffer, ``StringIO``
00092     :param numpy: numpy python module
00093     """
00094     try:
00095       buff.write(_struct_H.pack(self.checksum))
00096       _x = self.end
00097       # - if encoded as a list instead, serialize as bytes instead of string
00098       if type(_x) in [list, tuple]:
00099         buff.write(_struct_2B.pack(*_x))
00100       else:
00101         buff.write(_struct_2s.pack(_x))
00102     except struct.error as se: self._check_types(se)
00103     except TypeError as te: self._check_types(te)
00104 
00105   def deserialize_numpy(self, str, numpy):
00106     """
00107     unpack serialized message in str into this message instance using numpy for array types
00108     :param str: byte array of serialized message, ``str``
00109     :param numpy: numpy python module
00110     """
00111     try:
00112       end = 0
00113       start = end
00114       end += 2
00115       (self.checksum,) = _struct_H.unpack(str[start:end])
00116       start = end
00117       end += 2
00118       self.end = str[start:end]
00119       return self
00120     except struct.error as e:
00121       raise genpy.DeserializationError(e) #most likely buffer underfill
00122 
00123 _struct_I = genpy.struct_I
00124 _struct_H = struct.Struct("<H")
00125 _struct_2B = struct.Struct("<2B")
00126 _struct_2s = struct.Struct("<2s")


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