00001 """autogenerated by genpy from applanix_msgs/COMPortParams.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 COMPortParams(genpy.Message):
00009 _md5sum = "1202b316f5db7bb6767586a78e102300"
00010 _type = "applanix_msgs/COMPortParams"
00011 _has_header = False
00012 _full_text = """uint8 BAUD_2400=0
00013 uint8 BAUD_4800=1
00014 uint8 BAUD_9600=2
00015 uint8 BAUD_19200=3
00016 uint8 BAUD_38400=4
00017 uint8 BAUD_57600=5
00018 uint8 BAUD_76800=6
00019 uint8 BAUD_115200=7
00020 uint8 baud
00021
00022 uint8 PARITY_NONE=0
00023 uint8 PARITY_EVEN=1
00024 uint8 PARITY_ODD=2
00025 uint8 parity
00026
00027 uint8 DATA_7_STOP_1=0
00028 uint8 DATA_7_STOP_2=1
00029 uint8 DATA_8_STOP_1=2
00030 uint8 DATA_8_STOP_2=3
00031 uint8 data_stop
00032
00033 uint8 FLOW_NONE=0
00034 uint8 FLOW_HARDWARE=1
00035 uint8 FLOW_XONXOFF=2
00036 uint8 FLOW_RS422=3
00037 uint8 flow
00038
00039 uint16 INPUT_NONE=0
00040 uint16 INPUT_AUX_1_GNSS=1
00041 uint16 INPUT_AUX_2_GNSS=2
00042 uint16 INPUT_BASE_1_GNSS=4
00043 uint16 INPUT_BASE_2_GNSS=5
00044 uint16 INPUT_GNSS_1=7
00045 uint16 INPUT_GNSS_2=8
00046 uint16 input_select
00047
00048 uint16 OUTPUT_NONE=0
00049 uint16 OUTPUT_NMEA=1
00050 uint16 OUTPUT_BINARY=2
00051 uint16 OUTPUT_BASE_1_GNSS=4
00052 uint16 OUTPUT_BASE_2_GNSS=5
00053 uint16 OUTPUT_GNSS_1=7
00054 uint16 OUTPUT_GNSS_2=8
00055 uint16 output_select
00056
00057 """
00058
00059 BAUD_2400 = 0
00060 BAUD_4800 = 1
00061 BAUD_9600 = 2
00062 BAUD_19200 = 3
00063 BAUD_38400 = 4
00064 BAUD_57600 = 5
00065 BAUD_76800 = 6
00066 BAUD_115200 = 7
00067 PARITY_NONE = 0
00068 PARITY_EVEN = 1
00069 PARITY_ODD = 2
00070 DATA_7_STOP_1 = 0
00071 DATA_7_STOP_2 = 1
00072 DATA_8_STOP_1 = 2
00073 DATA_8_STOP_2 = 3
00074 FLOW_NONE = 0
00075 FLOW_HARDWARE = 1
00076 FLOW_XONXOFF = 2
00077 FLOW_RS422 = 3
00078 INPUT_NONE = 0
00079 INPUT_AUX_1_GNSS = 1
00080 INPUT_AUX_2_GNSS = 2
00081 INPUT_BASE_1_GNSS = 4
00082 INPUT_BASE_2_GNSS = 5
00083 INPUT_GNSS_1 = 7
00084 INPUT_GNSS_2 = 8
00085 OUTPUT_NONE = 0
00086 OUTPUT_NMEA = 1
00087 OUTPUT_BINARY = 2
00088 OUTPUT_BASE_1_GNSS = 4
00089 OUTPUT_BASE_2_GNSS = 5
00090 OUTPUT_GNSS_1 = 7
00091 OUTPUT_GNSS_2 = 8
00092
00093 __slots__ = ['baud','parity','data_stop','flow','input_select','output_select']
00094 _slot_types = ['uint8','uint8','uint8','uint8','uint16','uint16']
00095
00096 def __init__(self, *args, **kwds):
00097 """
00098 Constructor. Any message fields that are implicitly/explicitly
00099 set to None will be assigned a default value. The recommend
00100 use is keyword arguments as this is more robust to future message
00101 changes. You cannot mix in-order arguments and keyword arguments.
00102
00103 The available fields are:
00104 baud,parity,data_stop,flow,input_select,output_select
00105
00106 :param args: complete set of field values, in .msg order
00107 :param kwds: use keyword arguments corresponding to message field names
00108 to set specific fields.
00109 """
00110 if args or kwds:
00111 super(COMPortParams, self).__init__(*args, **kwds)
00112
00113 if self.baud is None:
00114 self.baud = 0
00115 if self.parity is None:
00116 self.parity = 0
00117 if self.data_stop is None:
00118 self.data_stop = 0
00119 if self.flow is None:
00120 self.flow = 0
00121 if self.input_select is None:
00122 self.input_select = 0
00123 if self.output_select is None:
00124 self.output_select = 0
00125 else:
00126 self.baud = 0
00127 self.parity = 0
00128 self.data_stop = 0
00129 self.flow = 0
00130 self.input_select = 0
00131 self.output_select = 0
00132
00133 def _get_types(self):
00134 """
00135 internal API method
00136 """
00137 return self._slot_types
00138
00139 def serialize(self, buff):
00140 """
00141 serialize message into buffer
00142 :param buff: buffer, ``StringIO``
00143 """
00144 try:
00145 _x = self
00146 buff.write(_struct_4B2H.pack(_x.baud, _x.parity, _x.data_stop, _x.flow, _x.input_select, _x.output_select))
00147 except struct.error as se: self._check_types(se)
00148 except TypeError as te: self._check_types(te)
00149
00150 def deserialize(self, str):
00151 """
00152 unpack serialized message in str into this message instance
00153 :param str: byte array of serialized message, ``str``
00154 """
00155 try:
00156 end = 0
00157 _x = self
00158 start = end
00159 end += 8
00160 (_x.baud, _x.parity, _x.data_stop, _x.flow, _x.input_select, _x.output_select,) = _struct_4B2H.unpack(str[start:end])
00161 return self
00162 except struct.error as e:
00163 raise genpy.DeserializationError(e)
00164
00165
00166 def serialize_numpy(self, buff, numpy):
00167 """
00168 serialize message with numpy array types into buffer
00169 :param buff: buffer, ``StringIO``
00170 :param numpy: numpy python module
00171 """
00172 try:
00173 _x = self
00174 buff.write(_struct_4B2H.pack(_x.baud, _x.parity, _x.data_stop, _x.flow, _x.input_select, _x.output_select))
00175 except struct.error as se: self._check_types(se)
00176 except TypeError as te: self._check_types(te)
00177
00178 def deserialize_numpy(self, str, numpy):
00179 """
00180 unpack serialized message in str into this message instance using numpy for array types
00181 :param str: byte array of serialized message, ``str``
00182 :param numpy: numpy python module
00183 """
00184 try:
00185 end = 0
00186 _x = self
00187 start = end
00188 end += 8
00189 (_x.baud, _x.parity, _x.data_stop, _x.flow, _x.input_select, _x.output_select,) = _struct_4B2H.unpack(str[start:end])
00190 return self
00191 except struct.error as e:
00192 raise genpy.DeserializationError(e)
00193
00194 _struct_I = genpy.struct_I
00195 _struct_4B2H = struct.Struct("<4B2H")