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