00001 """autogenerated by genpy from komodo_sensors/apm_adc.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 apm_adc(genpy.Message):
00009 _md5sum = "5d009541046908a1e7a9f62e0bb7a56e"
00010 _type = "komodo_sensors/apm_adc"
00011 _has_header = False
00012 _full_text = """uint16 A0
00013 uint16 A1
00014 uint16 A2
00015 uint16 A3
00016 uint16 A4
00017 uint16 A5
00018 uint16 A6
00019 uint16 A7
00020
00021 """
00022 __slots__ = ['A0','A1','A2','A3','A4','A5','A6','A7']
00023 _slot_types = ['uint16','uint16','uint16','uint16','uint16','uint16','uint16','uint16']
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 A0,A1,A2,A3,A4,A5,A6,A7
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(apm_adc, self).__init__(*args, **kwds)
00041
00042 if self.A0 is None:
00043 self.A0 = 0
00044 if self.A1 is None:
00045 self.A1 = 0
00046 if self.A2 is None:
00047 self.A2 = 0
00048 if self.A3 is None:
00049 self.A3 = 0
00050 if self.A4 is None:
00051 self.A4 = 0
00052 if self.A5 is None:
00053 self.A5 = 0
00054 if self.A6 is None:
00055 self.A6 = 0
00056 if self.A7 is None:
00057 self.A7 = 0
00058 else:
00059 self.A0 = 0
00060 self.A1 = 0
00061 self.A2 = 0
00062 self.A3 = 0
00063 self.A4 = 0
00064 self.A5 = 0
00065 self.A6 = 0
00066 self.A7 = 0
00067
00068 def _get_types(self):
00069 """
00070 internal API method
00071 """
00072 return self._slot_types
00073
00074 def serialize(self, buff):
00075 """
00076 serialize message into buffer
00077 :param buff: buffer, ``StringIO``
00078 """
00079 try:
00080 _x = self
00081 buff.write(_struct_8H.pack(_x.A0, _x.A1, _x.A2, _x.A3, _x.A4, _x.A5, _x.A6, _x.A7))
00082 except struct.error as se: self._check_types(se)
00083 except TypeError as te: self._check_types(te)
00084
00085 def deserialize(self, str):
00086 """
00087 unpack serialized message in str into this message instance
00088 :param str: byte array of serialized message, ``str``
00089 """
00090 try:
00091 end = 0
00092 _x = self
00093 start = end
00094 end += 16
00095 (_x.A0, _x.A1, _x.A2, _x.A3, _x.A4, _x.A5, _x.A6, _x.A7,) = _struct_8H.unpack(str[start:end])
00096 return self
00097 except struct.error as e:
00098 raise genpy.DeserializationError(e)
00099
00100
00101 def serialize_numpy(self, buff, numpy):
00102 """
00103 serialize message with numpy array types into buffer
00104 :param buff: buffer, ``StringIO``
00105 :param numpy: numpy python module
00106 """
00107 try:
00108 _x = self
00109 buff.write(_struct_8H.pack(_x.A0, _x.A1, _x.A2, _x.A3, _x.A4, _x.A5, _x.A6, _x.A7))
00110 except struct.error as se: self._check_types(se)
00111 except TypeError as te: self._check_types(te)
00112
00113 def deserialize_numpy(self, str, numpy):
00114 """
00115 unpack serialized message in str into this message instance using numpy for array types
00116 :param str: byte array of serialized message, ``str``
00117 :param numpy: numpy python module
00118 """
00119 try:
00120 end = 0
00121 _x = self
00122 start = end
00123 end += 16
00124 (_x.A0, _x.A1, _x.A2, _x.A3, _x.A4, _x.A5, _x.A6, _x.A7,) = _struct_8H.unpack(str[start:end])
00125 return self
00126 except struct.error as e:
00127 raise genpy.DeserializationError(e)
00128
00129 _struct_I = genpy.struct_I
00130 _struct_8H = struct.Struct("<8H")