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


ublox_msgs
Author(s): Johannes Meyer
autogenerated on Mon Jul 15 2013 16:55:23