00001 """autogenerated by genpy from ublox_msgs/RxmEPH.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 RxmEPH(genpy.Message):
00009 _md5sum = "378ed135397be8e1e42a9e0e5eb180f5"
00010 _type = "ublox_msgs/RxmEPH"
00011 _has_header = False
00012 _full_text = """# RXM-EPH (0x02 0x31)
00013 # GPS Aiding Ephemeris Input/Output Message
00014 #
00015 # This message is provided considered obsolete, please use AID-EPH instead!
00016 # - SF1D0 to SF3D7 is only sent if ephemeris is available for this SV. If not, the payload may
00017 # be reduced to 8 Bytes, or all bytes are set to zero, indicating that this SV Number does
00018 # not have valid ephemeris for the moment.
00019 # - SF1D0 to SF3D7 contain the 24 words following the Hand-Over Word ( HOW ) from the
00020 # GPS navigation message, subframes 1 to 3. See IS-GPS-200 for a full description of the
00021 # contents of the Subframes.
00022 # - In SF1D0 to SF3D7, the parity bits have been removed, and the 24 bits of data are
00023 # located in Bits 0 to 23. Bits 24 to 31 shall be ignored.
00024 #
00025
00026 uint8 CLASS_ID = 2
00027 uint8 MESSAGE_ID = 49
00028
00029 uint32 svid # SV ID for which this ephemeris data is (Valid Range: 1 .. 32).
00030 uint32 how # Hand-Over Word of first Subframe. This is
00031 # required if data is sent to the receiver.
00032 # 0 indicates that no Ephemeris Data is following.
00033
00034 # Start of optional block
00035 uint32[] sf1d # Subframe 1 Words 3..10 (SF1D0..SF1D7)
00036 uint32[] sf2d # Subframe 2 Words 3..10 (SF2D0..SF2D7)
00037 uint32[] sf3d # Subframe 3 Words 3..10 (SF3D0..SF3D7)
00038 # End of optional block
00039
00040 """
00041
00042 CLASS_ID = 2
00043 MESSAGE_ID = 49
00044
00045 __slots__ = ['svid','how','sf1d','sf2d','sf3d']
00046 _slot_types = ['uint32','uint32','uint32[]','uint32[]','uint32[]']
00047
00048 def __init__(self, *args, **kwds):
00049 """
00050 Constructor. Any message fields that are implicitly/explicitly
00051 set to None will be assigned a default value. The recommend
00052 use is keyword arguments as this is more robust to future message
00053 changes. You cannot mix in-order arguments and keyword arguments.
00054
00055 The available fields are:
00056 svid,how,sf1d,sf2d,sf3d
00057
00058 :param args: complete set of field values, in .msg order
00059 :param kwds: use keyword arguments corresponding to message field names
00060 to set specific fields.
00061 """
00062 if args or kwds:
00063 super(RxmEPH, self).__init__(*args, **kwds)
00064
00065 if self.svid is None:
00066 self.svid = 0
00067 if self.how is None:
00068 self.how = 0
00069 if self.sf1d is None:
00070 self.sf1d = []
00071 if self.sf2d is None:
00072 self.sf2d = []
00073 if self.sf3d is None:
00074 self.sf3d = []
00075 else:
00076 self.svid = 0
00077 self.how = 0
00078 self.sf1d = []
00079 self.sf2d = []
00080 self.sf3d = []
00081
00082 def _get_types(self):
00083 """
00084 internal API method
00085 """
00086 return self._slot_types
00087
00088 def serialize(self, buff):
00089 """
00090 serialize message into buffer
00091 :param buff: buffer, ``StringIO``
00092 """
00093 try:
00094 _x = self
00095 buff.write(_struct_2I.pack(_x.svid, _x.how))
00096 length = len(self.sf1d)
00097 buff.write(_struct_I.pack(length))
00098 pattern = '<%sI'%length
00099 buff.write(struct.pack(pattern, *self.sf1d))
00100 length = len(self.sf2d)
00101 buff.write(_struct_I.pack(length))
00102 pattern = '<%sI'%length
00103 buff.write(struct.pack(pattern, *self.sf2d))
00104 length = len(self.sf3d)
00105 buff.write(_struct_I.pack(length))
00106 pattern = '<%sI'%length
00107 buff.write(struct.pack(pattern, *self.sf3d))
00108 except struct.error as se: self._check_types(se)
00109 except TypeError as te: self._check_types(te)
00110
00111 def deserialize(self, str):
00112 """
00113 unpack serialized message in str into this message instance
00114 :param str: byte array of serialized message, ``str``
00115 """
00116 try:
00117 end = 0
00118 _x = self
00119 start = end
00120 end += 8
00121 (_x.svid, _x.how,) = _struct_2I.unpack(str[start:end])
00122 start = end
00123 end += 4
00124 (length,) = _struct_I.unpack(str[start:end])
00125 pattern = '<%sI'%length
00126 start = end
00127 end += struct.calcsize(pattern)
00128 self.sf1d = struct.unpack(pattern, str[start:end])
00129 start = end
00130 end += 4
00131 (length,) = _struct_I.unpack(str[start:end])
00132 pattern = '<%sI'%length
00133 start = end
00134 end += struct.calcsize(pattern)
00135 self.sf2d = struct.unpack(pattern, str[start:end])
00136 start = end
00137 end += 4
00138 (length,) = _struct_I.unpack(str[start:end])
00139 pattern = '<%sI'%length
00140 start = end
00141 end += struct.calcsize(pattern)
00142 self.sf3d = struct.unpack(pattern, str[start:end])
00143 return self
00144 except struct.error as e:
00145 raise genpy.DeserializationError(e)
00146
00147
00148 def serialize_numpy(self, buff, numpy):
00149 """
00150 serialize message with numpy array types into buffer
00151 :param buff: buffer, ``StringIO``
00152 :param numpy: numpy python module
00153 """
00154 try:
00155 _x = self
00156 buff.write(_struct_2I.pack(_x.svid, _x.how))
00157 length = len(self.sf1d)
00158 buff.write(_struct_I.pack(length))
00159 pattern = '<%sI'%length
00160 buff.write(self.sf1d.tostring())
00161 length = len(self.sf2d)
00162 buff.write(_struct_I.pack(length))
00163 pattern = '<%sI'%length
00164 buff.write(self.sf2d.tostring())
00165 length = len(self.sf3d)
00166 buff.write(_struct_I.pack(length))
00167 pattern = '<%sI'%length
00168 buff.write(self.sf3d.tostring())
00169 except struct.error as se: self._check_types(se)
00170 except TypeError as te: self._check_types(te)
00171
00172 def deserialize_numpy(self, str, numpy):
00173 """
00174 unpack serialized message in str into this message instance using numpy for array types
00175 :param str: byte array of serialized message, ``str``
00176 :param numpy: numpy python module
00177 """
00178 try:
00179 end = 0
00180 _x = self
00181 start = end
00182 end += 8
00183 (_x.svid, _x.how,) = _struct_2I.unpack(str[start:end])
00184 start = end
00185 end += 4
00186 (length,) = _struct_I.unpack(str[start:end])
00187 pattern = '<%sI'%length
00188 start = end
00189 end += struct.calcsize(pattern)
00190 self.sf1d = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00191 start = end
00192 end += 4
00193 (length,) = _struct_I.unpack(str[start:end])
00194 pattern = '<%sI'%length
00195 start = end
00196 end += struct.calcsize(pattern)
00197 self.sf2d = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00198 start = end
00199 end += 4
00200 (length,) = _struct_I.unpack(str[start:end])
00201 pattern = '<%sI'%length
00202 start = end
00203 end += struct.calcsize(pattern)
00204 self.sf3d = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00205 return self
00206 except struct.error as e:
00207 raise genpy.DeserializationError(e)
00208
00209 _struct_I = genpy.struct_I
00210 _struct_2I = struct.Struct("<2I")