source: ntrip/trunk/clock_and_orbit/lib/clock_orbit_rtcm.h@ 4368

Last change on this file since 4368 was 4241, checked in by stoecker, 13 years ago

fixed code numbers for SSR

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1#ifndef RTCM3_CLOCK_ORBIT_RTCM_H
2#define RTCM3_CLOCK_ORBIT_RTCM_H
3
4/* Programheader
5
6 Name: clock_orbit_rtcm.h
7 Project: RTCM3
8 Version: $Id: clock_orbit_rtcm.h 4241 2012-06-01 07:32:57Z stoecker $
9 Authors: Dirk Stöcker
10 Description: state space approach for RTCM3
11*/
12
13#include <string.h>
14
15enum SatelliteReferenceDatum { DATUM_ITRF=0, DATUM_LOCAL=1 };
16enum ClockOrbitType {
17 COTYPE_GPSORBIT=1057, COTYPE_GPSCLOCK=1058,
18 COTYPE_GPSCOMBINED=1060, COTYPE_GPSURA=1061, COTYPE_GPSHR=1062,
19
20 COTYPE_GLONASSORBIT=1063, COTYPE_GLONASSCLOCK=1064,
21 COTYPE_GLONASSCOMBINED=1066, COTYPE_GLONASSURA=1067, COTYPE_GLONASSHR=1068,
22
23 COTYPE_AUTO=0 };
24enum BiasType { BTYPE_GPS=1059, BTYPE_GLONASS=1065, BTYPE_AUTO = 0 };
25
26enum COR_CONSTANTS {
27 CLOCKORBIT_BUFFERSIZE=2048,
28 CLOCKORBIT_NUMGPS=32,
29 CLOCKORBIT_NUMGLONASS=24,
30 CLOCKORBIT_NUMBIAS=10
31};
32
33enum CodeType {
34 CODETYPEGPS_L1_CA = 0,
35 CODETYPEGPS_L1_P = 1,
36 CODETYPEGPS_L1_Z = 2,
37 /*CODETYPEGPS_L1_Y = 3,
38 CODETYPEGPS_L1_M = 4,*/
39 CODETYPEGPS_L2_CA = 5,
40 CODETYPEGPS_SEMI_CODELESS = 6,
41 CODETYPEGPS_L2_CM = 7,
42 CODETYPEGPS_L2_CL = 8,
43 CODETYPEGPS_L2_CML = 9,
44 CODETYPEGPS_L2_P = 10,
45 CODETYPEGPS_L2_Z = 11,
46 /*CODETYPEGPS_L2_Y = 12,
47 CODETYPEGPS_L2_M = 13,*/
48 CODETYPEGPS_L5_I = 14,
49 CODETYPEGPS_L5_Q = 15,
50 /*CODETYPEGPS_L5_IQ = 16,*/
51
52 CODETYPEGLONASS_L1_CA = 0,
53 CODETYPEGLONASS_L1_P = 1,
54 CODETYPEGLONASS_L2_CA = 2,
55 CODETYPEGLONASS_L2_P = 3,
56};
57
58#define SSR_MAXURA 5.5 /* > 5466.5mm in meter */
59
60/* GLONASS data is stored with offset CLOCKORBIT_NUMGPS in the data structures.
61So first GLONASS satellite is at xxx->Sat[CLOCKORBIT_NUMGPS], first
62GPS satellite is xxx->Sat[0]. */
63
64struct ClockOrbit
65{
66 enum ClockOrbitType messageType;
67 int GPSEpochTime; /* 0 .. 604799 s */
68 int GLONASSEpochTime; /* 0 .. 86399 s (86400 for leap second) */
69 int NumberOfGPSSat; /* 0 .. 32 */
70 int NumberOfGLONASSSat; /* 0 .. 24 */
71 int ClockDataSupplied; /* boolean */
72 int HRDataSupplied; /* boolean */
73 int OrbitDataSupplied; /* boolean */
74 int URADataSupplied; /* boolean */
75 int epochGPS[101]; /* Weber, for latency */
76 int epochSize; /* Weber, for latency */
77 int SSRIOD;
78 int SSRProviderID;
79 int SSRSolutionID;
80 int UpdateInterval;
81 enum SatelliteReferenceDatum SatRefDatum;
82 struct SatData {
83 int ID; /* GPS or GLONASS */
84 int IOD; /* GPS or GLONASS */
85 double UserRangeAccuracy; /* accuracy values in [m] */
86 double hrclock;
87 struct OrbitPart
88 {
89 double DeltaRadial; /* m */
90 double DeltaAlongTrack; /* m */
91 double DeltaCrossTrack; /* m */
92 double DotDeltaRadial; /* m/s */
93 double DotDeltaAlongTrack; /* m/s */
94 double DotDeltaCrossTrack; /* m/s */
95 } Orbit;
96 struct ClockPart
97 {
98 double DeltaA0; /* m */
99 double DeltaA1; /* m/s */
100 double DeltaA2; /* m/ss */
101 } Clock;
102 } Sat[CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS];
103};
104
105struct Bias
106{
107 enum BiasType messageType;
108 int GPSEpochTime; /* 0 .. 604799 s */
109 int GLONASSEpochTime; /* 0 .. 86399 s (86400 for leap second) */
110 int NumberOfGPSSat; /* 0 .. 32 */
111 int NumberOfGLONASSSat; /* 0 .. 24 */
112 int UpdateInterval;
113 int SSRIOD;
114 int SSRProviderID;
115 int SSRSolutionID;
116 struct BiasSat
117 {
118 int ID; /* GPS or GLONASS */
119 int NumberOfCodeBiases;
120 struct CodeBias
121 {
122 enum CodeType Type;
123 float Bias; /* m */
124 } Biases[CLOCKORBIT_NUMBIAS];
125 } Sat[CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS];
126};
127
128/* return size of resulting data or 0 in case of an error */
129size_t MakeClockOrbit(const struct ClockOrbit *co, enum ClockOrbitType type,
130 int moremessagesfollow, char *buffer, size_t size);
131size_t MakeBias(const struct Bias *b, enum BiasType type,
132 int moremessagesfollow, char *buffer, size_t size);
133
134enum GCOB_RETURN {
135 /* all well */
136 GCOBR_MESSAGEFOLLOWS = 1,
137 GCOBR_OK = 0,
138 /* unknown data, a warning */
139 GCOBR_UNKNOWNTYPE = -1,
140 GCOBR_UNKNOWNDATA = -2,
141 GCOBR_CRCMISMATCH = -3,
142 GCOBR_SHORTMESSAGE = -4,
143 /* failed to do the work */
144 GCOBR_NOCLOCKORBITPARAMETER = -10,
145 GCOBR_NOBIASPARAMETER = -11,
146 /* data mismatch - data in storage does not match new data */
147 GCOBR_TIMEMISMATCH = -20,
148 GCOBR_DATAMISMATCH = -21,
149 /* not enough data - can decode the block completely */
150 GCOBR_SHORTBUFFER = -30,
151 GCOBR_MESSAGEEXCEEDSBUFFER = -31};
152
153/* NOTE: When an error message has been emitted, the output structures may have been modified. Make a copy of the previous variant before calling the
154function to have a clean state. */
155
156/* buffer should point to a RTCM3 block */
157enum GCOB_RETURN GetClockOrbitBias(struct ClockOrbit *co, struct Bias *b,
158 const char *buffer, size_t size, int *bytesused);
159
160#endif /* RTCM3_CLOCK_ORBIT_RTCM_H */
Note: See TracBrowser for help on using the repository browser.