MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_rtcm3_local_corr.c File Reference

MRTKLIB RTCM Module — RTCM3 local correction message functions. More...

#include <math.h>
#include <string.h>
#include "mrtklib/mrtk_atmos.h"
#include "mrtklib/mrtk_bits.h"
#include "mrtklib/mrtk_coords.h"
#include "mrtklib/mrtk_rtcm.h"
#include "mrtklib/mrtk_sys.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_rtcm3_local_corr.c:

Go to the source code of this file.

Macros

#define SYS_GPS   0x01
#define SYS_GLO   0x04
#define SYS_GAL   0x08
#define SYS_QZS   0x10
#define SYS_CMP   0x20
#define TSYS_GAL   3
#define TOW_LSB   30.0 /* epoch time 30s */
#define BTYPE_GRID   0 /* block type grid */
#define BTYPE_STA   1 /* block type station */
#define ION_BLKSIZE   2.0 /* ionosphere block size */
#define TRP_BLKSIZE   4.0 /* troposphere block size */
#define GN(gp)
#define ION_BAS_LSB   0.35 /* ionospheric delay base value resolution */
#define ION_DET_LSB   0.002 /* ionospheric delay detail value resolution */
#define ION_STD_LSB   0.02 /* ionospheric delay std index resolution */
#define ION_STD_MAX   2.56 /* ionospheric delay std index=7 */
#define LAT_LSB   0.001 /* station pos latitude resolution */
#define LON_LSB   0.001 /* station pos longitude resolution */
#define TRP_BAS_LSB   0.1 /* tropspheric delay base value resolution */
#define TRP_DET_LSB   0.002 /* tropspheric delay detail value resolution */
#define TRP_STD_LSB   0.002 /* tropspheric delay std index resolution */
#define TRP_STD_MAX   0.256 /* tropspheric delay std index=7 */
#define ROUND(x)

Functions

void initblkinf (blkinf_t *b)
 Initialize block information struct.
static int decode_lclhead (rtcm_t *rtcm, int type, blkinf_t *blkinf)
int decode_lcltrop (rtcm_t *rtcm, int type)
 Decode local tropospheric delay correction grid RTCM message.
int decode_lcliono (rtcm_t *rtcm, int type)
 Decode local ionospheric delay correction grid RTCM message.
static int encode_lclhead (rtcm_t *rtcm, int type, blkinf_t *blkinf)
int encode_lcltrop (rtcm_t *rtcm, int type)
 Encode local tropospheric delay correction grid RTCM message.
int encode_lcliono (rtcm_t *rtcm, int type)
 Encode local ionospheric delay correction grid RTCM message.

Variables

static const double PI = 3.1415926535897932
static const double D2R = 3.1415926535897932 / 180.0
static const double R2D = 180.0 / 3.1415926535897932
static const double RE_WGS84 = 6378137.0

Detailed Description

MRTKLIB RTCM Module — RTCM3 local correction message functions.

Definition in file mrtk_rtcm3_local_corr.c.

Macro Definition Documentation

◆ BTYPE_GRID

#define BTYPE_GRID   0 /* block type grid */

◆ BTYPE_STA

#define BTYPE_STA   1 /* block type station */

Definition at line 46 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lclhead(), and output_lclcmb().

◆ GN

#define GN ( gp)
Value:
(gp == 1 ? 64 : 16)

Definition at line 52 of file mrtk_rtcm3_local_corr.c.

Referenced by initblkinf().

◆ ION_BAS_LSB

#define ION_BAS_LSB   0.35 /* ionospheric delay base value resolution */

Definition at line 94 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lcliono(), encode_lcliono(), and encode_lcltrop().

◆ ION_BLKSIZE

#define ION_BLKSIZE   2.0 /* ionosphere block size */

Definition at line 47 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lclhead(), and initgridsta().

◆ ION_DET_LSB

#define ION_DET_LSB   0.002 /* ionospheric delay detail value resolution */

Definition at line 95 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lcliono(), and encode_lcliono().

◆ ION_STD_LSB

#define ION_STD_LSB   0.02 /* ionospheric delay std index resolution */

Definition at line 96 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lcliono(), and encode_lcliono().

◆ ION_STD_MAX

#define ION_STD_MAX   2.56 /* ionospheric delay std index=7 */

Definition at line 97 of file mrtk_rtcm3_local_corr.c.

Referenced by encode_lcliono().

◆ LAT_LSB

#define LAT_LSB   0.001 /* station pos latitude resolution */

◆ LON_LSB

#define LON_LSB   0.001 /* station pos longitude resolution */

◆ ROUND

#define ROUND ( x)
Value:
(int)floor((x) + 0.5)

Definition at line 105 of file mrtk_rtcm3_local_corr.c.

Referenced by encode_lclhead().

◆ SYS_CMP

#define SYS_CMP   0x20

Definition at line 35 of file mrtk_rtcm3_local_corr.c.

◆ SYS_GAL

#define SYS_GAL   0x08

Definition at line 33 of file mrtk_rtcm3_local_corr.c.

◆ SYS_GLO

#define SYS_GLO   0x04

Definition at line 32 of file mrtk_rtcm3_local_corr.c.

◆ SYS_GPS

#define SYS_GPS   0x01

Definition at line 31 of file mrtk_rtcm3_local_corr.c.

◆ SYS_QZS

#define SYS_QZS   0x10

Definition at line 34 of file mrtk_rtcm3_local_corr.c.

◆ TOW_LSB

#define TOW_LSB   30.0 /* epoch time 30s */

Definition at line 44 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lclhead(), and encode_lclhead().

◆ TRP_BAS_LSB

#define TRP_BAS_LSB   0.1 /* tropspheric delay base value resolution */

Definition at line 100 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lcltrop(), and encode_lcltrop().

◆ TRP_BLKSIZE

#define TRP_BLKSIZE   4.0 /* troposphere block size */

Definition at line 48 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lclhead(), and initgridsta().

◆ TRP_DET_LSB

#define TRP_DET_LSB   0.002 /* tropspheric delay detail value resolution */

Definition at line 101 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lcltrop(), and encode_lcltrop().

◆ TRP_STD_LSB

#define TRP_STD_LSB   0.002 /* tropspheric delay std index resolution */

Definition at line 102 of file mrtk_rtcm3_local_corr.c.

Referenced by decode_lcltrop(), and encode_lcltrop().

◆ TRP_STD_MAX

#define TRP_STD_MAX   0.256 /* tropspheric delay std index=7 */

Definition at line 103 of file mrtk_rtcm3_local_corr.c.

Referenced by encode_lcltrop().

◆ TSYS_GAL

#define TSYS_GAL   3

Definition at line 37 of file mrtk_rtcm3_local_corr.c.

Function Documentation

◆ decode_lclhead()

int decode_lclhead ( rtcm_t * rtcm,
int type,
blkinf_t * blkinf )
static

Definition at line 108 of file mrtk_rtcm3_local_corr.c.

References blkinf_t::bn, blkinf_t::bs, blkinf_t::btype, BTYPE_GRID, BTYPE_STA, getbitu(), blkinf_t::gpitch, gst2time(), initblkinf(), ION_BLKSIZE, blkinf_t::mask, blkinf_t::n, rtcm, gtime_t::time, time2gst(), timediff(), TOW_LSB, and TRP_BLKSIZE.

Referenced by decode_lcliono(), and decode_lcltrop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_lcliono()

int decode_lcliono ( rtcm_t * rtcm,
int type )

Decode local ionospheric delay correction grid RTCM message.

Parameters
[in,out]rtcmRTCM control struct
[in]typeMessage type
Returns
Status (1:ok, 0:error)

Definition at line 260 of file mrtk_rtcm3_local_corr.c.

References blkinf_t::bn, blkinf_t::bpos, blkinf_t::btype, D2R, decode_lclhead(), getbitu(), blkinf_t::gp, blkinf_t::gpitch, blkinf_t::grid, ion_t::ion, ION_BAS_LSB, ION_DET_LSB, ION_STD_LSB, LAT_LSB, LON_LSB, MAXSAT, MINPRNCMP, MINPRNGAL, MINPRNGLO, MINPRNGPS, MINPRNQZS, blkinf_t::n, NSATCMP, NSATGAL, NSATGLO, NSATGPS, NSATQZS, pos2ecef(), R2D, rtcm, rtcm_lclblk(), satno(), ion_t::std, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_QZS, ion_t::time, time_str(), and trace().

Referenced by decode_rtcm3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_lcltrop()

int decode_lcltrop ( rtcm_t * rtcm,
int type )

Decode local tropospheric delay correction grid RTCM message.

Parameters
[in,out]rtcmRTCM control struct
[in]typeMessage type
Returns
Status (1:ok, 0:error)

Definition at line 185 of file mrtk_rtcm3_local_corr.c.

References blkinf_t::bn, blkinf_t::bpos, blkinf_t::btype, D2R, decode_lclhead(), spos_t::ecef, getbitu(), blkinf_t::gp, blkinf_t::gpitch, blkinf_t::grid, LAT_LSB, LON_LSB, blkinf_t::n, PI, pos2ecef(), R2D, rtcm, rtcm_lclblk(), sitetrp_t::site, trp_t::std, trp_t::time, time_str(), trace(), tropmodel(), trp_t::trp, TRP_BAS_LSB, TRP_DET_LSB, TRP_STD_LSB, and sitetrp_t::trpd.

Referenced by decode_rtcm3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encode_lclhead()

int encode_lclhead ( rtcm_t * rtcm,
int type,
blkinf_t * blkinf )
static

Definition at line 424 of file mrtk_rtcm3_local_corr.c.

References blkinf_t::bn, blkinf_t::gpitch, blkinf_t::mask, blkinf_t::n, ROUND, rtcm, setbitu(), time2gpst(), and TOW_LSB.

Referenced by encode_lcliono(), and encode_lcltrop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encode_lcliono()

int encode_lcliono ( rtcm_t * rtcm,
int type )

Encode local ionospheric delay correction grid RTCM message.

Parameters
[in,out]rtcmRTCM control struct
[in]typeMessage type
Returns
Status (1:ok, 0:error)

Definition at line 577 of file mrtk_rtcm3_local_corr.c.

References blkinf_t::bn, blkinf_t::bpos, blkinf_t::btype, encode_lclhead(), blkinf_t::gp, blkinf_t::gpitch, blkinf_t::grid, ion_t::ion, ION_BAS_LSB, ION_DET_LSB, ION_STD_LSB, ION_STD_MAX, LAT_LSB, LON_LSB, MAXIONSTA, MAXOBS, MINPRNCMP, MINPRNGAL, MINPRNGLO, MINPRNGPS, MINPRNQZS, blkinf_t::n, NSATCMP, NSATGAL, NSATGLO, NSATGPS, NSATQZS, R2D, rtcm, satno(), satsys(), setbitu(), ion_t::std, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_QZS, ion_t::time, time_str(), and trace().

Referenced by encode_rtcm3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encode_lcltrop()

int encode_lcltrop ( rtcm_t * rtcm,
int type )

Encode local tropospheric delay correction grid RTCM message.

Parameters
[in,out]rtcmRTCM control struct
[in]typeMessage type
Returns
Status (1:ok, 0:error)

Definition at line 480 of file mrtk_rtcm3_local_corr.c.

References blkinf_t::bn, blkinf_t::bpos, blkinf_t::btype, encode_lclhead(), blkinf_t::gp, blkinf_t::gpitch, blkinf_t::grid, ION_BAS_LSB, LAT_LSB, LON_LSB, MAXTRPSTA, blkinf_t::n, PI, R2D, rtcm, setbitu(), trp_t::std, gtime_t::time, trp_t::time, time_str(), timediff(), trace(), tropmodel(), trp_t::trp, TRP_BAS_LSB, TRP_DET_LSB, TRP_STD_LSB, and TRP_STD_MAX.

Referenced by encode_rtcm3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initblkinf()

void initblkinf ( blkinf_t * b)

Initialize block information struct.

Parameters
[in,out]bBlock information struct

Definition at line 58 of file mrtk_rtcm3_local_corr.c.

References blkinf_t::bn, blkinf_t::bpos, blkinf_t::bs, blkinf_t::btype, BTYPE_GRID, D2R, GN, blkinf_t::gp, blkinf_t::gpitch, blkinf_t::grid, blkinf_t::mask, and blkinf_t::n.

Referenced by decode_lclhead(), and initgridsta().

Here is the caller graph for this function:

Variable Documentation

◆ D2R

const double D2R = 3.1415926535897932 / 180.0
static

Definition at line 40 of file mrtk_rtcm3_local_corr.c.

◆ PI

const double PI = 3.1415926535897932
static

Definition at line 39 of file mrtk_rtcm3_local_corr.c.

◆ R2D

const double R2D = 180.0 / 3.1415926535897932
static

Definition at line 41 of file mrtk_rtcm3_local_corr.c.

◆ RE_WGS84

const double RE_WGS84 = 6378137.0
static

Definition at line 42 of file mrtk_rtcm3_local_corr.c.