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