GNSS-SDR  0.0.13
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 #define COMMENTH "%" /* comment line indicator for solution */
38 #define MSG_DISCONN "$_DISCONNECT\r\n" /* disconnect message */
39 
40 const char *opt2sep(const solopt_t *opt);
41 
42 int tonum(char *buff, const char *sep, double *v);
43 
44 double sqvar(double covar);
45 
46 double dmm2deg(double dmm);
47 
48 void septime(double t, double *t1, double *t2, double *t3);
49 
50 void soltocov(const sol_t *sol, double *P);
51 
52 void covtosol(const double *P, sol_t *sol);
53 
54 int decode_nmearmc(char **val, int n, sol_t *sol);
55 
56 int decode_nmeagga(char **val, int n, sol_t *sol);
57 
58 int decode_nmea(char *buff, sol_t *sol);
59 
60 char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time);
61 
62 int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol);
63 
64 int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol);
65 
66 int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol);
67 
68 int decode_solgsi(char *buff, const solopt_t *opt, sol_t *sol);
69 
70 int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol);
71 
72 void decode_refpos(char *buff, const solopt_t *opt, double *rb);
73 
74 int decode_sol(char *buff, const solopt_t *opt, sol_t *sol, double *rb);
75 
76 void decode_solopt(char *buff, solopt_t *opt);
77 
78 void readsolopt(FILE *fp, solopt_t *opt);
79 
80 int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint,
81  int qflag, const solopt_t *opt, solbuf_t *solbuf);
82 
83 int readsoldata(FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag,
84  const solopt_t *opt, solbuf_t *solbuf);
85 
86 int cmpsol(const void *p1, const void *p2);
87 
88 int sort_solbuf(solbuf_t *solbuf);
89 
90 int readsolt(char *files[], int nfile, gtime_t ts, gtime_t te,
91  double tint, int qflag, solbuf_t *solbuf);
92 
93 int readsol(char *files[], int nfile, solbuf_t *sol);
94 
95 int addsol(solbuf_t *solbuf, const sol_t *sol);
96 
97 sol_t *getsol(solbuf_t *solbuf, int index);
98 
99 void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax);
100 
101 void freesolbuf(solbuf_t *solbuf);
102 
103 void freesolstatbuf(solstatbuf_t *solstatbuf);
104 
105 int cmpsolstat(const void *p1, const void *p2);
106 
107 int sort_solstat(solstatbuf_t *statbuf);
108 
109 int decode_solstat(char *buff, solstat_t *stat);
110 
111 void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat);
112 
113 int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint,
114  solstatbuf_t *statbuf);
115 
116 int readsolstatt(char *files[], int nfile, gtime_t ts, gtime_t te,
117  double tint, solstatbuf_t *statbuf);
118 
119 int readsolstat(char *files[], int nfile, solstatbuf_t *statbuf);
120 
121 int outecef(unsigned char *buff, const char *s, const sol_t *sol,
122  const solopt_t *opt);
123 
124 int outpos(unsigned char *buff, const char *s, const sol_t *sol, const solopt_t *opt);
125 
126 int outenu(unsigned char *buff, const char *s, const sol_t *sol,
127  const double *rb, const solopt_t *opt);
128 
129 int outnmea_rmc(unsigned char *buff, const sol_t *sol);
130 
131 int outnmea_gga(unsigned char *buff, const sol_t *sol);
132 
133 int outnmea_gsa(unsigned char *buff, const sol_t *sol,
134  const ssat_t *ssat);
135 
136 int outnmea_gsv(unsigned char *buff, const sol_t *sol,
137  const ssat_t *ssat);
138 
139 int outprcopts(unsigned char *buff, const prcopt_t *opt);
140 
141 int outsolheads(unsigned char *buff, const solopt_t *opt);
142 
143 int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
144  const solopt_t *opt);
145 
146 int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat,
147  const solopt_t *opt);
148 
149 void outprcopt(FILE *fp, const prcopt_t *opt);
150 
151 void outsolhead(FILE *fp, const solopt_t *opt);
152 
153 void outsol(FILE *fp, const sol_t *sol, const double *rb,
154  const solopt_t *opt);
155 
156 void outsolex(FILE *fp, const sol_t *sol, const ssat_t *ssat,
157  const solopt_t *opt);
158 
159 
160 #endif
main header file for the rtklib library
Definition: rtklib.h:813