MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_rtcm.h File Reference

MRTKLIB RTCM Module — RTCM message types and functions. More...

#include <stdint.h>
#include <stdio.h>
#include "mrtklib/mrtk_foundation.h"
#include "mrtklib/mrtk_nav.h"
#include "mrtklib/mrtk_obs.h"
#include "mrtklib/mrtk_station.h"
#include "mrtklib/mrtk_time.h"
Include dependency graph for mrtk_rtcm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rtcm_t
 RTCM control struct type. More...

Functions

int init_rtcm (rtcm_t *rtcm)
 Initialize RTCM control struct.
void free_rtcm (rtcm_t *rtcm)
 Free RTCM control struct.
lclblock_t * rtcm_lclblk (rtcm_t *rtcm)
 Get the local correction block, lazily allocating it on first use.
int input_rtcm2 (rtcm_t *rtcm, uint8_t data)
 Input RTCM 2 message from stream (byte-by-byte).
int input_rtcm3 (rtcm_t *rtcm, uint8_t data)
 Input RTCM 3 message from stream (byte-by-byte).
int input_rtcm2f (rtcm_t *rtcm, FILE *fp)
 Input RTCM 2 message from file.
int input_rtcm3f (rtcm_t *rtcm, FILE *fp)
 Input RTCM 3 message from file.
int gen_rtcm2 (rtcm_t *rtcm, int type, int sync)
 Generate RTCM 2 message.
int gen_rtcm3 (rtcm_t *rtcm, int type, int subtype, int sync)
 Generate RTCM 3 message.
int decode_rtcm2 (rtcm_t *rtcm)
 Decode RTCM ver.2 message (called from rtcm.c).
int decode_rtcm3 (rtcm_t *rtcm)
 Decode RTCM ver.3 message (called from rtcm.c).
int encode_rtcm3 (rtcm_t *rtcm, int type, int subtype, int sync)
 Encode RTCM ver.3 message (called from rtcm.c).
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.
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.
void initblkinf (blkinf_t *b)
 Initialize block information struct.

Detailed Description

MRTKLIB RTCM Module — RTCM message types and functions.

This header provides the RTCM control struct (rtcm_t) and all public RTCM function declarations extracted from rtcm.c, rtcm2.c, rtcm3.c, rtcm3e.c, and rtcm3lcl.c.

Note
All functions in this module are pure cut-and-paste extractions with zero algorithmic changes.

Definition in file mrtk_rtcm.h.

Function Documentation

◆ 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:

◆ decode_rtcm2()

int decode_rtcm2 ( rtcm_t * rtcm)

Decode RTCM ver.2 message (called from rtcm.c).

Parameters
[in,out]rtcmRTCM control struct
Returns
Status (-1:error, 0:no message, 1:obs, 2:eph, ...)

Definition at line 452 of file mrtk_rtcm2.c.

References adjhour(), decode_type1(), decode_type14(), decode_type16(), decode_type17(), decode_type18(), decode_type19(), decode_type22(), decode_type23(), decode_type24(), decode_type3(), decode_type31(), decode_type32(), decode_type34(), decode_type36(), decode_type37(), decode_type59(), getbitu(), rtcm, and trace().

Referenced by input_rtcm2().

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

◆ decode_rtcm3()

int decode_rtcm3 ( rtcm_t * rtcm)

Decode RTCM ver.3 message (called from rtcm.c).

Parameters
[in,out]rtcmRTCM control struct
Returns
Status (-1:error, 0:no message, 1:obs, 2:eph, ...)

Definition at line 3402 of file mrtk_rtcm3.c.

References decode_lcliono(), decode_lcltrop(), decode_msm0(), decode_msm4(), decode_msm5(), decode_msm6(), decode_msm7(), decode_ssr1(), decode_ssr2(), decode_ssr3(), decode_ssr4(), decode_ssr5(), decode_ssr6(), decode_ssr7(), decode_type1001(), decode_type1002(), decode_type1003(), decode_type1004(), decode_type1005(), decode_type1006(), decode_type1007(), decode_type1008(), decode_type1009(), decode_type1010(), decode_type1011(), decode_type1012(), decode_type1013(), decode_type1019(), decode_type1020(), decode_type1021(), decode_type1022(), decode_type1023(), decode_type1024(), decode_type1025(), decode_type1026(), decode_type1027(), decode_type1029(), decode_type1030(), decode_type1031(), decode_type1032(), decode_type1033(), decode_type1034(), decode_type1035(), decode_type1037(), decode_type1038(), decode_type1039(), decode_type1041(), decode_type1042(), decode_type1044(), decode_type1045(), decode_type1046(), decode_type1230(), decode_type4050(), decode_type4073(), decode_type4076(), getbitu(), gpst2time(), rtcm, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, SYS_SBS, time2gpst(), timeget(), trace(), and utc2gpst().

Referenced by input_rtcm3().

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:

◆ encode_rtcm3()

int encode_rtcm3 ( rtcm_t * rtcm,
int type,
int subtype,
int sync )

Encode RTCM ver.3 message (called from rtcm.c).

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

Definition at line 3610 of file mrtk_rtcm3e.c.

References encode_lcliono(), encode_lcltrop(), encode_msm1(), encode_msm2(), encode_msm3(), encode_msm4(), encode_msm5(), encode_msm6(), encode_msm7(), encode_ssr1(), encode_ssr2(), encode_ssr3(), encode_ssr4(), encode_ssr5(), encode_ssr6(), encode_ssr7(), encode_type1001(), encode_type1002(), encode_type1003(), encode_type1004(), encode_type1005(), encode_type1006(), encode_type1007(), encode_type1008(), encode_type1009(), encode_type1010(), encode_type1011(), encode_type1012(), encode_type1019(), encode_type1020(), encode_type1033(), encode_type1041(), encode_type1042(), encode_type1044(), encode_type1045(), encode_type1046(), encode_type1230(), encode_type4073(), encode_type4076(), encode_type63(), rtcm, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, SYS_SBS, and trace().

Referenced by gen_rtcm3().

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

◆ free_rtcm()

void free_rtcm ( rtcm_t * rtcm)

Free RTCM control struct.

Parameters
[in,out]rtcmRTCM control struct

Definition at line 118 of file mrtk_rtcm.c.

References free, rtcm, and trace().

Referenced by free_strfile(), freepreceph(), init_rtcm(), rtksvrthread(), strconvfree(), and strconvnew().

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

◆ gen_rtcm2()

int gen_rtcm2 ( rtcm_t * rtcm,
int type,
int sync )

Generate RTCM 2 message.

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

Definition at line 369 of file mrtk_rtcm.c.

References rtcm, and trace().

Referenced by write_nav(), write_nav_cycle(), write_obs(), and write_sta_cycle().

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

◆ gen_rtcm3()

int gen_rtcm3 ( rtcm_t * rtcm,
int type,
int subtype,
int sync )

Generate RTCM 3 message.

Parameters
[in,out]rtcmRTCM control struct
[in]typeMessage type
[in]subtypeMessage subtype (0:no subtype)
[in]syncSync flag (1:another message follows)
Returns
Status (1:ok, 0:error)

Definition at line 392 of file mrtk_rtcm.c.

References encode_rtcm3(), rtcm, RTCM3PREAMB, rtk_crc24q(), setbitu(), and trace().

Referenced by output_lclcmb(), write_nav(), write_nav_cycle(), write_obs(), write_rtcm3_msm(), and write_sta_cycle().

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

◆ init_rtcm()

int init_rtcm ( rtcm_t * rtcm)

Initialize RTCM control struct.

Parameters
[out]rtcmRTCM control struct
Returns
Status (1:ok, 0:memory allocation error)
Note
The struct must be zero-initialized (calloc/memset) before the first call; an existing lclblk allocation is preserved across re-init.

Definition at line 37 of file mrtk_rtcm.c.

References free_rtcm(), malloc, MAXOBS, MAXPRNGLO, MAXSAT, rtcm, and trace().

Referenced by gen_strfile(), readpreceph(), rtksvrstart(), and strconvnew().

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:

◆ input_rtcm2()

int input_rtcm2 ( rtcm_t * rtcm,
uint8_t data )

Input RTCM 2 message from stream (byte-by-byte).

Parameters
[in,out]rtcmRTCM control struct
[in]dataStream data (1 byte)
Returns
Status (-1:error, 0:no message, 1:obs data, 2:ephemeris, ...)

Definition at line 159 of file mrtk_rtcm.c.

References decode_rtcm2(), decode_word(), rtcm, RTCM2PREAMB, and trace().

Referenced by decoderaw(), input_rtcm2f(), and strconv().

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

◆ input_rtcm2f()

int input_rtcm2f ( rtcm_t * rtcm,
FILE * fp )

Input RTCM 2 message from file.

Parameters
[in,out]rtcmRTCM control struct
[in]fpFile pointer
Returns
Status (-2:end of file, -1:error, 0:no message, 1:obs, 2:eph, ...)

Definition at line 325 of file mrtk_rtcm.c.

References input_rtcm2(), rtcm, and trace().

Referenced by input_strfile().

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

◆ input_rtcm3()

int input_rtcm3 ( rtcm_t * rtcm,
uint8_t data )

Input RTCM 3 message from stream (byte-by-byte).

Parameters
[in,out]rtcmRTCM control struct
[in]dataStream data (1 byte)
Returns
Status (-1:error, 0:no message, 1:obs data, 2:ephemeris, ...)

Definition at line 289 of file mrtk_rtcm.c.

References decode_rtcm3(), getbitu(), rtcm, RTCM3PREAMB, rtk_crc24q(), and trace().

Referenced by decoderaw(), input_rtcm3f(), and strconv().

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

◆ input_rtcm3f()

int input_rtcm3f ( rtcm_t * rtcm,
FILE * fp )

Input RTCM 3 message from file.

Parameters
[in,out]rtcmRTCM control struct
[in]fpFile pointer
Returns
Status (-2:end of file, -1:error, 0:no message, 1:obs, 2:eph, ...)

Definition at line 347 of file mrtk_rtcm.c.

References input_rtcm3(), rtcm, and trace().

Referenced by input_strfile(), and update_rtcm().

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

◆ rtcm_lclblk()

lclblock_t * rtcm_lclblk ( rtcm_t * rtcm)

Get the local correction block, lazily allocating it on first use.

Parameters
[in,out]rtcmRTCM control struct
Returns
Local correction block (NULL: memory allocation error).

Definition at line 139 of file mrtk_rtcm.c.

References calloc, and rtcm.

Referenced by decode_lcliono(), and decode_lcltrop().

Here is the caller graph for this function: