4 * This software is distributed under a zlib-style license.
\r
5 * See license.txt for more information.
\r
9 using System.Collections.Generic;
\r
12 namespace Yubeshi.Ubx
\r
14 public class NavTimeGps : Packet
\r
16 #region constructors
\r
18 public NavTimeGps(byte[] sentence, int length)
\r
19 : base(sentence, length)
\r
27 public decimal TimeOfWeek
\r
31 uint tow = BitConverter.ToUInt32(Raw, 6 + 0);
\r
32 int ftow = BitConverter.ToInt32(Raw, 6 + 4);
\r
33 return tow * 1e-3m + ftow * 1e-9m;
\r
41 return BitConverter.ToInt16(Raw, 6 + 8);
\r
45 public int LeapSecond
\r
49 return (sbyte)(Raw[6 + 10]);
\r
53 public decimal Accuracy
\r
57 return BitConverter.ToUInt32(Raw, 6 + 12) * 1e-9m;
\r
63 #region public methods
\r
65 public static bool TryParse(byte[] sentence, out UnknownPacket packet)
\r
67 return TryParse(sentence, out packet,
\r
68 MessageID.NavTimeGps, 16, Build);
\r
73 #region private methods
\r
75 private static Packet Build(byte[] sentence, int length)
\r
77 return new NavTimeGps(sentence, length);
\r