_CfgRATE.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ublox_msgs/CfgRATE.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 CfgRATE(genpy.Message):
00009   _md5sum = "da095554bde2600fd2a774def27fb48e"
00010   _type = "ublox_msgs/CfgRATE"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# CFG-RATE (0x06 0x08)
00013 # Navigation/Measurement Rate Settings
00014 #
00015 
00016 uint8 CLASS_ID = 6
00017 uint8 MESSAGE_ID = 8
00018 
00019 uint16 measRate           # Measurement Rate, GPS measurements are
00020                           # taken every measRate milliseconds [ms]
00021 uint16 navRate            # Navigation Rate, in number of measurement
00022                           # cycles. On u-blox 5 and u-blox 6, this parameter
00023                           # cannot be changed, and is always equals 1.
00024 uint16 timeRef            # Alignment to reference time: 0 = UTC time, 1 = GPS time
00025 uint16 TIME_REF_UTC = 0
00026 uint16 TIME_REF_GPS = 1
00027 
00028 """
00029   # Pseudo-constants
00030   CLASS_ID = 6
00031   MESSAGE_ID = 8
00032   TIME_REF_UTC = 0
00033   TIME_REF_GPS = 1
00034 
00035   __slots__ = ['measRate','navRate','timeRef']
00036   _slot_types = ['uint16','uint16','uint16']
00037 
00038   def __init__(self, *args, **kwds):
00039     """
00040     Constructor. Any message fields that are implicitly/explicitly
00041     set to None will be assigned a default value. The recommend
00042     use is keyword arguments as this is more robust to future message
00043     changes.  You cannot mix in-order arguments and keyword arguments.
00044 
00045     The available fields are:
00046        measRate,navRate,timeRef
00047 
00048     :param args: complete set of field values, in .msg order
00049     :param kwds: use keyword arguments corresponding to message field names
00050     to set specific fields.
00051     """
00052     if args or kwds:
00053       super(CfgRATE, self).__init__(*args, **kwds)
00054       #message fields cannot be None, assign default values for those that are
00055       if self.measRate is None:
00056         self.measRate = 0
00057       if self.navRate is None:
00058         self.navRate = 0
00059       if self.timeRef is None:
00060         self.timeRef = 0
00061     else:
00062       self.measRate = 0
00063       self.navRate = 0
00064       self.timeRef = 0
00065 
00066   def _get_types(self):
00067     """
00068     internal API method
00069     """
00070     return self._slot_types
00071 
00072   def serialize(self, buff):
00073     """
00074     serialize message into buffer
00075     :param buff: buffer, ``StringIO``
00076     """
00077     try:
00078       _x = self
00079       buff.write(_struct_3H.pack(_x.measRate, _x.navRate, _x.timeRef))
00080     except struct.error as se: self._check_types(se)
00081     except TypeError as te: self._check_types(te)
00082 
00083   def deserialize(self, str):
00084     """
00085     unpack serialized message in str into this message instance
00086     :param str: byte array of serialized message, ``str``
00087     """
00088     try:
00089       end = 0
00090       _x = self
00091       start = end
00092       end += 6
00093       (_x.measRate, _x.navRate, _x.timeRef,) = _struct_3H.unpack(str[start:end])
00094       return self
00095     except struct.error as e:
00096       raise genpy.DeserializationError(e) #most likely buffer underfill
00097 
00098 
00099   def serialize_numpy(self, buff, numpy):
00100     """
00101     serialize message with numpy array types into buffer
00102     :param buff: buffer, ``StringIO``
00103     :param numpy: numpy python module
00104     """
00105     try:
00106       _x = self
00107       buff.write(_struct_3H.pack(_x.measRate, _x.navRate, _x.timeRef))
00108     except struct.error as se: self._check_types(se)
00109     except TypeError as te: self._check_types(te)
00110 
00111   def deserialize_numpy(self, str, numpy):
00112     """
00113     unpack serialized message in str into this message instance using numpy for array types
00114     :param str: byte array of serialized message, ``str``
00115     :param numpy: numpy python module
00116     """
00117     try:
00118       end = 0
00119       _x = self
00120       start = end
00121       end += 6
00122       (_x.measRate, _x.navRate, _x.timeRef,) = _struct_3H.unpack(str[start:end])
00123       return self
00124     except struct.error as e:
00125       raise genpy.DeserializationError(e) #most likely buffer underfill
00126 
00127 _struct_I = genpy.struct_I
00128 _struct_3H = struct.Struct("<3H")
 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