source: ntrip/trunk/clock_and_orbit/clock_orbit_rtcm.h@ 2421

Last change on this file since 2421 was 2421, checked in by stoecker, 12 years ago

update of SSR messages

  • Property svn:executable set to *
File size: 4.5 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,v 1.7 2010/02/22 13:42:26 stoecker Exp $
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 /* ... */
38
39 CODETYPEGLONASS_L1_CA = 0,
40 CODETYPEGLONASS_L1_P = 1,
41 CODETYPEGLONASS_L2_CA = 2,
42 CODETYPEGLONASS_L2_P = 3,
43};
44
45#define SSR_MAXURA 5.5 /* > 5466.5mm in meter */
46
47/* GLONASS data is stored with offset CLOCKORBIT_NUMGPS in the data structures.
48So first GLONASS satellite is at xxx->Sat[CLOCKORBIT_NUMGPS], first
49GPS satellite is xxx->Sat[0]. */
50
51struct ClockOrbit
52{
53 enum ClockOrbitType messageType;
54 int GPSEpochTime; /* 0 .. 604799 s */
55 int GLONASSEpochTime; /* 0 .. 86399 s (86400 for leap second) */
56 int NumberOfGPSSat; /* 0 .. 32 */
57 int NumberOfGLONASSSat; /* 0 .. 24 */
58 int ClockDataSupplied; /* boolean */
59 int HRDataSupplied; /* boolean */
60 int OrbitDataSupplied; /* boolean */
61 int URADataSupplied; /* boolean */
62 int epochGPS[101]; /* Weber, for latency */
63 int epochSize; /* Weber, for latency */
64 int UpdateInterval;
65 enum SatelliteReferenceDatum SatRefDatum;
66 struct SatData {
67 int ID; /* GPS or GLONASS */
68 int IOD; /* GPS or GLONASS */
69 double UserRangeAccuracy; /* accuracy values in [m] */
70 double hrclock;
71 struct OrbitPart
72 {
73 double DeltaRadial; /* m */
74 double DeltaAlongTrack; /* m */
75 double DeltaCrossTrack; /* m */
76 double DotDeltaRadial; /* m/s */
77 double DotDeltaAlongTrack; /* m/s */
78 double DotDeltaCrossTrack; /* m/s */
79 } Orbit;
80 struct ClockPart
81 {
82 double DeltaA0; /* m */
83 double DeltaA1; /* m/s */
84 double DeltaA2; /* m/ss */
85 } Clock;
86 } Sat[CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS];
87};
88
89struct Bias
90{
91 enum BiasType messageType;
92 int GPSEpochTime; /* 0 .. 604799 s */
93 int GLONASSEpochTime; /* 0 .. 86399 s (86400 for leap second) */
94 int NumberOfGPSSat; /* 0 .. 32 */
95 int NumberOfGLONASSSat; /* 0 .. 24 */
96 int UpdateInterval;
97 struct BiasSat
98 {
99 int ID; /* GPS or GLONASS */
100 int NumberOfCodeBiases;
101 struct CodeBias
102 {
103 enum CodeType Type;
104 float Bias; /* m */
105 } Biases[CLOCKORBIT_NUMBIAS];
106 } Sat[CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS];
107};
108
109/* return size of resulting data or 0 in case of an error */
110size_t MakeClockOrbit(const struct ClockOrbit *co, enum ClockOrbitType type,
111 int moremessagesfollow, char *buffer, size_t size);
112size_t MakeBias(const struct Bias *b, enum BiasType type,
113 int moremessagesfollow, char *buffer, size_t size);
114
115enum GCOB_RETURN {
116 /* all well */
117 GCOBR_MESSAGEFOLLOWS = 1,
118 GCOBR_OK = 0,
119 /* unknown data, a warning */
120 GCOBR_UNKNOWNTYPE = -1,
121 GCOBR_UNKNOWNDATA = -2,
122 GCOBR_CRCMISMATCH = -3,
123 GCOBR_SHORTMESSAGE = -4,
124 /* failed to do the work */
125 GCOBR_NOCLOCKORBITPARAMETER = -10,
126 GCOBR_NOBIASPARAMETER = -11,
127 /* data mismatch - data in storage does not match new data */
128 GCOBR_TIMEMISMATCH = -20,
129 GCOBR_DATAMISMATCH = -21,
130 /* not enough data - can decode the block completely */
131 GCOBR_SHORTBUFFER = -30,
132 GCOBR_MESSAGEEXCEEDSBUFFER = -31};
133
134/* 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
135function to have a clean state. */
136
137/* buffer should point to a RTCM3 block */
138enum GCOB_RETURN GetClockOrbitBias(struct ClockOrbit *co, struct Bias *b,
139 const char *buffer, size_t size, int *bytesused);
140
141#endif /* RTCM3_CLOCK_ORBIT_RTCM_H */
Note: See TracBrowser for help on using the repository browser.