00001 """autogenerated by genpy from ublox_msgs/NavTIMEUTC.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 NavTIMEUTC(genpy.Message):
00009 _md5sum = "0ea9fbec0e54f3dbba61f743936c206a"
00010 _type = "ublox_msgs/NavTIMEUTC"
00011 _has_header = False
00012 _full_text = """# NAV-TIMEUTC (0x01 0x21)
00013 # UTC Time Solution
00014 #
00015
00016 uint8 CLASS_ID = 1
00017 uint8 MESSAGE_ID = 33
00018
00019 uint32 iTOW # GPS Millisecond time of week [ms]
00020
00021 uint32 tAcc # Time Accuracy Estimate [ns]
00022 int32 nano # Nanoseconds of second, range -1e9 .. 1e9 (UTC) [ns]
00023 uint16 year # Year, range 1999..2099 (UTC) [y]
00024 uint8 month # Month, range 1..12 (UTC) [month]
00025 uint8 day # Day of Month, range 1..31 (UTC) [d]
00026 uint8 hour # Hour of Day, range 0..23 (UTC) [h]
00027 uint8 min # Minute of Hour, range 0..59 (UTC) [min]
00028 uint8 sec # Seconds of Minute, range 0..59 (UTC) [s]
00029
00030 uint8 valid # Validity Flags
00031 uint8 VALID_TOW = 1 # Valid Time of Week
00032 uint8 VALID_WKN = 2 # Valid Week Number
00033 uint8 VALID_UTC = 4 # Valid Leap Seconds, i.e. Leap Seconds already known
00034
00035 """
00036
00037 CLASS_ID = 1
00038 MESSAGE_ID = 33
00039 VALID_TOW = 1
00040 VALID_WKN = 2
00041 VALID_UTC = 4
00042
00043 __slots__ = ['iTOW','tAcc','nano','year','month','day','hour','min','sec','valid']
00044 _slot_types = ['uint32','uint32','int32','uint16','uint8','uint8','uint8','uint8','uint8','uint8']
00045
00046 def __init__(self, *args, **kwds):
00047 """
00048 Constructor. Any message fields that are implicitly/explicitly
00049 set to None will be assigned a default value. The recommend
00050 use is keyword arguments as this is more robust to future message
00051 changes. You cannot mix in-order arguments and keyword arguments.
00052
00053 The available fields are:
00054 iTOW,tAcc,nano,year,month,day,hour,min,sec,valid
00055
00056 :param args: complete set of field values, in .msg order
00057 :param kwds: use keyword arguments corresponding to message field names
00058 to set specific fields.
00059 """
00060 if args or kwds:
00061 super(NavTIMEUTC, self).__init__(*args, **kwds)
00062
00063 if self.iTOW is None:
00064 self.iTOW = 0
00065 if self.tAcc is None:
00066 self.tAcc = 0
00067 if self.nano is None:
00068 self.nano = 0
00069 if self.year is None:
00070 self.year = 0
00071 if self.month is None:
00072 self.month = 0
00073 if self.day is None:
00074 self.day = 0
00075 if self.hour is None:
00076 self.hour = 0
00077 if self.min is None:
00078 self.min = 0
00079 if self.sec is None:
00080 self.sec = 0
00081 if self.valid is None:
00082 self.valid = 0
00083 else:
00084 self.iTOW = 0
00085 self.tAcc = 0
00086 self.nano = 0
00087 self.year = 0
00088 self.month = 0
00089 self.day = 0
00090 self.hour = 0
00091 self.min = 0
00092 self.sec = 0
00093 self.valid = 0
00094
00095 def _get_types(self):
00096 """
00097 internal API method
00098 """
00099 return self._slot_types
00100
00101 def serialize(self, buff):
00102 """
00103 serialize message into buffer
00104 :param buff: buffer, ``StringIO``
00105 """
00106 try:
00107 _x = self
00108 buff.write(_struct_2IiH6B.pack(_x.iTOW, _x.tAcc, _x.nano, _x.year, _x.month, _x.day, _x.hour, _x.min, _x.sec, _x.valid))
00109 except struct.error as se: self._check_types(se)
00110 except TypeError as te: self._check_types(te)
00111
00112 def deserialize(self, str):
00113 """
00114 unpack serialized message in str into this message instance
00115 :param str: byte array of serialized message, ``str``
00116 """
00117 try:
00118 end = 0
00119 _x = self
00120 start = end
00121 end += 20
00122 (_x.iTOW, _x.tAcc, _x.nano, _x.year, _x.month, _x.day, _x.hour, _x.min, _x.sec, _x.valid,) = _struct_2IiH6B.unpack(str[start:end])
00123 return self
00124 except struct.error as e:
00125 raise genpy.DeserializationError(e)
00126
00127
00128 def serialize_numpy(self, buff, numpy):
00129 """
00130 serialize message with numpy array types into buffer
00131 :param buff: buffer, ``StringIO``
00132 :param numpy: numpy python module
00133 """
00134 try:
00135 _x = self
00136 buff.write(_struct_2IiH6B.pack(_x.iTOW, _x.tAcc, _x.nano, _x.year, _x.month, _x.day, _x.hour, _x.min, _x.sec, _x.valid))
00137 except struct.error as se: self._check_types(se)
00138 except TypeError as te: self._check_types(te)
00139
00140 def deserialize_numpy(self, str, numpy):
00141 """
00142 unpack serialized message in str into this message instance using numpy for array types
00143 :param str: byte array of serialized message, ``str``
00144 :param numpy: numpy python module
00145 """
00146 try:
00147 end = 0
00148 _x = self
00149 start = end
00150 end += 20
00151 (_x.iTOW, _x.tAcc, _x.nano, _x.year, _x.month, _x.day, _x.hour, _x.min, _x.sec, _x.valid,) = _struct_2IiH6B.unpack(str[start:end])
00152 return self
00153 except struct.error as e:
00154 raise genpy.DeserializationError(e)
00155
00156 _struct_I = genpy.struct_I
00157 _struct_2IiH6B = struct.Struct("<2IiH6B")