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 RxmRaw : Packet
\r
16 #region type definitions
\r
17 public struct MeasurementData
\r
25 public double CarrierPhase
\r
29 return BitConverter.ToDouble(Raw, 0);
\r
33 public double Pseudorange
\r
37 return BitConverter.ToDouble(Raw, 8);
\r
41 public double Doppler
\r
45 return BitConverter.ToSingle(Raw, 16);
\r
49 public uint SpaceVehicleNumber
\r
57 public int QualityIndicator
\r
61 return (sbyte)Raw[21];
\r
65 public int SignalStrength
\r
69 return (sbyte)Raw[22];
\r
73 public int LossOfLockIndicator
\r
82 public void Set(byte[] raw)
\r
89 #region constructors
\r
91 public RxmRaw(byte[] sentence, int length)
\r
92 : base(sentence, length)
\r
94 Data = new MeasurementData[NumberOfSatelites];
\r
95 for (int i = 0; i < Data.Length; ++i)
\r
97 Data[i].Set(OctetString.Substring(Raw, 8 + 24 * i, 24));
\r
105 public GpsTime GpsTime
\r
109 return new GpsTime(Week, TimeOfWeek);
\r
113 public decimal TimeOfWeek
\r
117 return BitConverter.ToUInt32(Raw, 6 + 0) * 1e-3m;
\r
125 return BitConverter.ToInt16(Raw, 6 + 4);
\r
129 public int NumberOfSatelites
\r
137 public MeasurementData[] Data
\r
145 #region public methods
\r
147 public static bool TryParse(byte[] sentence, out UnknownPacket packet)
\r
150 if (sentence.Length < 16)
\r
154 int length = 8 + 24 * sentence[6 + 6];
\r
155 return TryParse(sentence, out packet,
\r
156 MessageID.RxmRaw, length, Build);
\r
161 #region private methods
\r
163 private static Packet Build(byte[] sentence, int length)
\r
165 return new RxmRaw(sentence, length);
\r