GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
rtklib_solution.h
Go to the documentation of this file.
1 /*!
2  * \file rtklib_solution.h
3  * \brief solution functions headers
4  * \authors <ul>
5  * <li> 2007-2013, T. Takasu
6  * <li> 2017, Javier Arribas
7  * <li> 2017, Carles Fernandez
8  * </ul>
9  *
10  * This is a derived work from RTKLIB http://www.rtklib.com/
11  * The original source code at https://github.com/tomojitakasu/RTKLIB is
12  * released under the BSD 2-clause license with an additional exclusive clause
13  * that does not apply here. This additional clause is reproduced below:
14  *
15  * " The software package includes some companion executive binaries or shared
16  * libraries necessary to execute APs on Windows. These licenses succeed to the
17  * original ones of these software. "
18  *
19  * Neither the executive binaries nor the shared libraries are required by, used
20  * or included in GNSS-SDR.
21  *
22  * -----------------------------------------------------------------------------
23  * Copyright (C) 2007-2013, T. Takasu
24  * Copyright (C) 2017, Javier Arribas
25  * Copyright (C) 2017, Carles Fernandez
26  * All rights reserved.
27  *
28  * SPDX-License-Identifier: BSD-2-Clause
29  *------------------------------------------------------------------------------
30  */
31 
32 #ifndef GNSS_SDR_RTKLIB_SOLUTION_H
33 #define GNSS_SDR_RTKLIB_SOLUTION_H
34 
35 #include "rtklib.h"
36 
37 /** \addtogroup PVT
38  * \{ */
39 /** \addtogroup RTKLIB_Library
40  * \{ */
41 
42 
43 #define COMMENTH "%" /* comment line indicator for solution */
44 #define MSG_DISCONN "$_DISCONNECT\r\n" /* disconnect message */
45 
46 const char *opt2sep(const solopt_t *opt);
47 
48 int tonum(char *buff, const char *sep, double *v);
49 
50 double sqvar(double covar);
51 
52 double dmm2deg(double dmm);
53 
54 void septime(double t, double *t1, double *t2, double *t3);
55 
56 void soltocov(const sol_t *sol, double *P);
57 
58 void covtosol(const double *P, sol_t *sol);
59 
60 int decode_nmearmc(char **val, int n, sol_t *sol);
61 
62 int decode_nmeagga(char **val, int n, sol_t *sol);
63 
64 int decode_nmea(char *buff, sol_t *sol);
65 
66 char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time);
67 
68 int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol);
69 
70 int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol);
71 
72 int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol);
73 
74 int decode_solgsi(char *buff, const solopt_t *opt, sol_t *sol);
75 
76 int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol);
77 
78 void decode_refpos(char *buff, const solopt_t *opt, double *rb);
79 
80 int decode_sol(char *buff, const solopt_t *opt, sol_t *sol, double *rb);
81 
82 void decode_solopt(char *buff, solopt_t *opt);
83 
84 void readsolopt(FILE *fp, solopt_t *opt);
85 
86 int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint,
87  int qflag, const solopt_t *opt, solbuf_t *solbuf);
88 
89 int readsoldata(FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag,
90  const solopt_t *opt, solbuf_t *solbuf);
91 
92 int cmpsol(const void *p1, const void *p2);
93 
94 int sort_solbuf(solbuf_t *solbuf);
95 
96 int readsolt(char *files[], int nfile, gtime_t ts, gtime_t te,
97  double tint, int qflag, solbuf_t *solbuf);
98 
99 int readsol(char *files[], int nfile, solbuf_t *sol);
100 
101 int addsol(solbuf_t *solbuf, const sol_t *sol);
102 
103 sol_t *getsol(solbuf_t *solbuf, int index);
104 
105 void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax);
106 
107 void freesolbuf(solbuf_t *solbuf);
108 
109 void freesolstatbuf(solstatbuf_t *solstatbuf);
110 
111 int cmpsolstat(const void *p1, const void *p2);
112 
113 int sort_solstat(solstatbuf_t *statbuf);
114 
115 int decode_solstat(char *buff, solstat_t *stat);
116 
117 void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat);
118 
119 int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint,
120  solstatbuf_t *statbuf);
121 
122 int readsolstatt(char *files[], int nfile, gtime_t ts, gtime_t te,
123  double tint, solstatbuf_t *statbuf);
124 
125 int readsolstat(char *files[], int nfile, solstatbuf_t *statbuf);
126 
127 int outecef(unsigned char *buff, const char *s, const sol_t *sol,
128  const solopt_t *opt);
129 
130 int outpos(unsigned char *buff, const char *s, const sol_t *sol, const solopt_t *opt);
131 
132 int outenu(unsigned char *buff, const char *s, const sol_t *sol,
133  const double *rb, const solopt_t *opt);
134 
135 int outnmea_rmc(unsigned char *buff, const sol_t *sol);
136 
137 int outnmea_gga(unsigned char *buff, const sol_t *sol);
138 
139 int outnmea_gsa(unsigned char *buff, const sol_t *sol,
140  const ssat_t *ssat);
141 
142 int outnmea_gsv(unsigned char *buff, const sol_t *sol,
143  const ssat_t *ssat);
144 
145 int outprcopts(unsigned char *buff, const prcopt_t *opt);
146 
147 int outsolheads(unsigned char *buff, const solopt_t *opt);
148 
149 int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
150  const solopt_t *opt);
151 
152 int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat,
153  const solopt_t *opt);
154 
155 void outprcopt(FILE *fp, const prcopt_t *opt);
156 
157 void outsolhead(FILE *fp, const solopt_t *opt);
158 
159 void outsol(FILE *fp, const sol_t *sol, const double *rb,
160  const solopt_t *opt);
161 
162 void outsolex(FILE *fp, const sol_t *sol, const ssat_t *ssat,
163  const solopt_t *opt);
164 
165 
166 /** \} */
167 /** \} */
168 #endif // GNSS_SDR_RTKLIB_SOLUTION_H
main header file for the rtklib library
Definition: rtklib.h:819