$search
00001 """autogenerated by genmsg_py from CfgPRT.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class CfgPRT(roslib.message.Message): 00007 _md5sum = "3679d3ad278d5329fb8543226a55acca" 00008 _type = "ublox_msgs/CfgPRT" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# CFG-PRT (0x06 0x00) 00011 # Port Configuration for UART 00012 # 00013 # Several configurations can be concatenated to one input message. In this case the payload 00014 # length can be a multiple of the normal length (see the other versions of CFG-PRT). Output 00015 # messages from the module contain only one configuration unit. 00016 # 00017 00018 uint8 CLASS_ID = 6 00019 uint8 MESSAGE_ID = 0 00020 00021 uint8 portID # Port Identifier Number (= 1 or 2 for UART ports) 00022 uint8 PORT_ID_UART1 = 1 00023 uint8 PORT_ID_UART2 = 2 00024 uint8 PORT_ID_USB = 3 00025 00026 uint8 reserved0 # Reserved 00027 00028 uint16 txReady # reserved (Alwyas set to zero) up to Firmware 7.01, 00029 # TX ready PIN configuration (since Firmware 7.01) 00030 uint16 TX_READY_EN = 1 # Enable TX ready feature for this port 00031 uint16 TX_READY_POLARITY_HIGH_ACTIVE = 0 # Polarity High-active 00032 uint16 TX_READY_POLARITY_LOW_ACTIVE = 2 # Polarity Low-active 00033 uint16 TX_READY_PIN_SHIFT = 2 # PIO to be used (must not be in use already by another function) 00034 uint16 TX_READY_PIN_MASK = 124 # 00035 uint16 TX_READY_THRES_SHIFT = 7 # Threshold 00036 uint16 TX_READY_THRES_MASK = 65408 # The given threshold is multiplied by 8 bytes. 00037 # The TX ready PIN goes active after >= thres*8 bytes are pending for the port and going inactive after the last 00038 # pending bytes have been written to hardware (0-4 bytes before end of stream). 00039 00040 uint32 mode # A bit mask describing the UART mode 00041 uint32 MODE_RESERVED1 = 16 # Default 1 for compatibility with A4 00042 uint32 MODE_CHAR_LEN_MASK = 192 # Character Length 00043 uint32 MODE_CHAR_LEN_5BIT = 0 # 5bit (not supported) 00044 uint32 MODE_CHAR_LEN_6BIT = 64 # 6bit (not supported) 00045 uint32 MODE_CHAR_LEN_7BIT = 128 # 7bit (supported only with parity) 00046 uint32 MODE_CHAR_LEN_8BIT = 192 # 8bit 00047 uint32 MODE_PARITY_MASK = 3584 # 00048 uint32 MODE_PARITY_EVEN = 0 # Even Parity 00049 uint32 MODE_PARITY_ODD = 512 # Odd Parity 00050 uint32 MODE_PARITY_NO = 2048 # No Parity 00051 uint32 MODE_STOP_BITS_MASK = 12288 # Number of Stop Bits 00052 uint32 MODE_STOP_BITS_1 = 0 # 1 Stop Bit 00053 uint32 MODE_STOP_BITS_15 = 4096 # 1.5 Stop Bit 00054 uint32 MODE_STOP_BITS_2 = 8192 # 2 Stop Bit 00055 uint32 MODE_STOP_BITS_05 = 12288 # 0.5 Stop Bit 00056 00057 uint32 baudRate # Baudrate in bits/second [bits/s] 00058 00059 uint16 inProtoMask # A mask describing which input protocols are active. 00060 # Each bit of this mask is used for a protocol. 00061 # Through that, multiple protocols can be defined 00062 # on a single port. 00063 00064 uint16 outProtoMask # A mask describing which output protocols are active. 00065 # Each bit of this mask is used for a protocol. 00066 # Through that, multiple protocols can be defined 00067 # on a single port. 00068 00069 uint16 PROTO_UBX = 1 00070 uint16 PROTO_NMEA = 2 00071 uint16 PROTO_RTCM = 4 00072 00073 uint16 reserved4 # Always set to zero 00074 uint16 reserved5 # Always set to zero 00075 00076 """ 00077 # Pseudo-constants 00078 CLASS_ID = 6 00079 MESSAGE_ID = 0 00080 PORT_ID_UART1 = 1 00081 PORT_ID_UART2 = 2 00082 PORT_ID_USB = 3 00083 TX_READY_EN = 1 00084 TX_READY_POLARITY_HIGH_ACTIVE = 0 00085 TX_READY_POLARITY_LOW_ACTIVE = 2 00086 TX_READY_PIN_SHIFT = 2 00087 TX_READY_PIN_MASK = 124 00088 TX_READY_THRES_SHIFT = 7 00089 TX_READY_THRES_MASK = 65408 00090 MODE_RESERVED1 = 16 00091 MODE_CHAR_LEN_MASK = 192 00092 MODE_CHAR_LEN_5BIT = 0 00093 MODE_CHAR_LEN_6BIT = 64 00094 MODE_CHAR_LEN_7BIT = 128 00095 MODE_CHAR_LEN_8BIT = 192 00096 MODE_PARITY_MASK = 3584 00097 MODE_PARITY_EVEN = 0 00098 MODE_PARITY_ODD = 512 00099 MODE_PARITY_NO = 2048 00100 MODE_STOP_BITS_MASK = 12288 00101 MODE_STOP_BITS_1 = 0 00102 MODE_STOP_BITS_15 = 4096 00103 MODE_STOP_BITS_2 = 8192 00104 MODE_STOP_BITS_05 = 12288 00105 PROTO_UBX = 1 00106 PROTO_NMEA = 2 00107 PROTO_RTCM = 4 00108 00109 __slots__ = ['portID','reserved0','txReady','mode','baudRate','inProtoMask','outProtoMask','reserved4','reserved5'] 00110 _slot_types = ['uint8','uint8','uint16','uint32','uint32','uint16','uint16','uint16','uint16'] 00111 00112 def __init__(self, *args, **kwds): 00113 """ 00114 Constructor. Any message fields that are implicitly/explicitly 00115 set to None will be assigned a default value. The recommend 00116 use is keyword arguments as this is more robust to future message 00117 changes. You cannot mix in-order arguments and keyword arguments. 00118 00119 The available fields are: 00120 portID,reserved0,txReady,mode,baudRate,inProtoMask,outProtoMask,reserved4,reserved5 00121 00122 @param args: complete set of field values, in .msg order 00123 @param kwds: use keyword arguments corresponding to message field names 00124 to set specific fields. 00125 """ 00126 if args or kwds: 00127 super(CfgPRT, self).__init__(*args, **kwds) 00128 #message fields cannot be None, assign default values for those that are 00129 if self.portID is None: 00130 self.portID = 0 00131 if self.reserved0 is None: 00132 self.reserved0 = 0 00133 if self.txReady is None: 00134 self.txReady = 0 00135 if self.mode is None: 00136 self.mode = 0 00137 if self.baudRate is None: 00138 self.baudRate = 0 00139 if self.inProtoMask is None: 00140 self.inProtoMask = 0 00141 if self.outProtoMask is None: 00142 self.outProtoMask = 0 00143 if self.reserved4 is None: 00144 self.reserved4 = 0 00145 if self.reserved5 is None: 00146 self.reserved5 = 0 00147 else: 00148 self.portID = 0 00149 self.reserved0 = 0 00150 self.txReady = 0 00151 self.mode = 0 00152 self.baudRate = 0 00153 self.inProtoMask = 0 00154 self.outProtoMask = 0 00155 self.reserved4 = 0 00156 self.reserved5 = 0 00157 00158 def _get_types(self): 00159 """ 00160 internal API method 00161 """ 00162 return self._slot_types 00163 00164 def serialize(self, buff): 00165 """ 00166 serialize message into buffer 00167 @param buff: buffer 00168 @type buff: StringIO 00169 """ 00170 try: 00171 _x = self 00172 buff.write(_struct_2BH2I4H.pack(_x.portID, _x.reserved0, _x.txReady, _x.mode, _x.baudRate, _x.inProtoMask, _x.outProtoMask, _x.reserved4, _x.reserved5)) 00173 except struct.error as se: self._check_types(se) 00174 except TypeError as te: self._check_types(te) 00175 00176 def deserialize(self, str): 00177 """ 00178 unpack serialized message in str into this message instance 00179 @param str: byte array of serialized message 00180 @type str: str 00181 """ 00182 try: 00183 end = 0 00184 _x = self 00185 start = end 00186 end += 20 00187 (_x.portID, _x.reserved0, _x.txReady, _x.mode, _x.baudRate, _x.inProtoMask, _x.outProtoMask, _x.reserved4, _x.reserved5,) = _struct_2BH2I4H.unpack(str[start:end]) 00188 return self 00189 except struct.error as e: 00190 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00191 00192 00193 def serialize_numpy(self, buff, numpy): 00194 """ 00195 serialize message with numpy array types into buffer 00196 @param buff: buffer 00197 @type buff: StringIO 00198 @param numpy: numpy python module 00199 @type numpy module 00200 """ 00201 try: 00202 _x = self 00203 buff.write(_struct_2BH2I4H.pack(_x.portID, _x.reserved0, _x.txReady, _x.mode, _x.baudRate, _x.inProtoMask, _x.outProtoMask, _x.reserved4, _x.reserved5)) 00204 except struct.error as se: self._check_types(se) 00205 except TypeError as te: self._check_types(te) 00206 00207 def deserialize_numpy(self, str, numpy): 00208 """ 00209 unpack serialized message in str into this message instance using numpy for array types 00210 @param str: byte array of serialized message 00211 @type str: str 00212 @param numpy: numpy python module 00213 @type numpy: module 00214 """ 00215 try: 00216 end = 0 00217 _x = self 00218 start = end 00219 end += 20 00220 (_x.portID, _x.reserved0, _x.txReady, _x.mode, _x.baudRate, _x.inProtoMask, _x.outProtoMask, _x.reserved4, _x.reserved5,) = _struct_2BH2I4H.unpack(str[start:end]) 00221 return self 00222 except struct.error as e: 00223 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00224 00225 _struct_I = roslib.message.struct_I 00226 _struct_2BH2I4H = struct.Struct("<2BH2I4H")