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

QZSS CLAS (L6D) CSSR decoder and bank management. More...

#include "mrtklib/mrtk_clas.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_const.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_clas.c:

Go to the source code of this file.

Macros

#define SQR(x)
#define MAX(x, y)
#define MIN(x, y)

Functions

int clas_ctx_init (clas_ctx_t *ctx)
 Initialize CLAS context (allocate bank control on heap).
void clas_ctx_free (clas_ctx_t *ctx)
 Free CLAS context (release heap-allocated bank control).
void clas_bank_init (clas_ctx_t *ctx, int ch)
 Initialize bank control for a channel.
static double decode_sval (const uint8_t *buff, int i, int n, double lsb)
int cssr_sys2gnss (int sys, int *prn0)
 Convert RTKLIB system bitmask to CSSR GNSS ID.
int cssr_gnss2sys (int gnss, int *prn0)
 Convert CSSR GNSS ID to RTKLIB system bitmask.
static int svmask2nsat (uint64_t svmask)
static int sigmask2nsig (uint16_t sigmask)
static int svmask2nsatlist (uint64_t svmask, int id, int *sat)
static int svmask2sat (uint64_t *svmask, int *sat)
static float decode_cssr_quality_stec (int a, int b)
static float decode_cssr_quality_trop (int a, int b)
static void check_week_ref (clas_ctx_t *ctx, clas_l6buf_t *l6, int tow, int i)
static int sigmask2sig_p (int nsat, int *sat, uint16_t *sigmask, uint16_t *cellmask, int *nsig, int *sig)
static int sigmask2sig (int nsat, int *sat, uint16_t *sigmask, uint16_t *cellmask, int *nsig, int *sig)
static clas_orbit_bank_t * get_same_orbit (clas_bank_ctrl_t *bank, gtime_t time, int network)
static clas_clock_bank_t * get_same_clock (clas_bank_ctrl_t *bank, gtime_t time, int network)
static clas_bias_bank_t * get_same_bias (clas_bank_ctrl_t *bank, gtime_t time, int network)
static clas_trop_bank_t * get_same_trop (clas_bank_ctrl_t *bank, gtime_t time)
static clas_orbit_bank_t * get_close_orbit (clas_bank_ctrl_t *bank, gtime_t time, int network, double age)
static clas_clock_bank_t * get_close_clock (clas_bank_ctrl_t *bank, gtime_t obstime, gtime_t time, int network, double age)
static clas_bias_bank_t * get_close_cbias (clas_bank_ctrl_t *bank, gtime_t time, int network, double age)
static clas_bias_bank_t * get_close_pbias (clas_bank_ctrl_t *bank, gtime_t time, int network, double age)
static clas_bias_bank_t * get_close_net_cbias (clas_bank_ctrl_t *bank, gtime_t time, int network, double age)
static clas_bias_bank_t * get_close_net_pbias (clas_bank_ctrl_t *bank, gtime_t time, int network, double age)
static clas_trop_bank_t * get_close_trop (clas_bank_ctrl_t *bank, gtime_t obstime, gtime_t time, int network, double age, int tropless)
static int get_bias_save_point (clas_bias_bank_t *bias, int prn, int mode)
static void check_cssr_changed_facility (clas_ctx_t *ctx, int ch, int facility)
static void set_cssr_bank_orbit (clas_ctx_t *ctx, int ch, gtime_t time, int network)
static void set_cssr_bank_clock (clas_ctx_t *ctx, int ch, gtime_t time, int network)
static void set_cssr_bank_cbias (clas_ctx_t *ctx, int ch, gtime_t time, int network, int iod)
static void set_cssr_bank_pbias (clas_ctx_t *ctx, int ch, gtime_t time, int network, int iod)
static void set_cssr_latest_trop (clas_bank_ctrl_t *bank, gtime_t time, ssrn_t *ssrn, int network)
static int get_cssr_latest_trop (clas_bank_ctrl_t *bank, double *total, double *wet, gtime_t time, int network, int index)
static int get_cssr_latest_iono (clas_bank_ctrl_t *bank, double *iono, gtime_t time, int network, int index, int sat)
static void set_cssr_bank_trop (clas_ctx_t *ctx, int ch, gtime_t time, ssrn_t *ssrn, int network)
static clas_bias_bank_t * add_base_value_to_cbias (clas_bank_ctrl_t *bank, clas_bias_bank_t *srcbias, int network)
static clas_bias_bank_t * add_base_value_to_pbias (clas_bank_ctrl_t *bank, clas_bias_bank_t *srcbias, int network)
static void init_grid_index (clas_corr_t *corr)
static void set_grid_data (clas_corr_t *corr, double *pos, int index)
static int add_data_stec (stec_t *stec, gtime_t time, int sat, int slip, double iono, double rate, double rms, double quality)
static int add_data_trop (zwd_t *z, gtime_t time, double zwd, double ztd, double quality, double rms, int valid)
static int sub_get_close_cssr (clas_bank_ctrl_t *bank, gtime_t time, int network, clas_orbit_bank_t **orbit, clas_clock_bank_t **clock, clas_bias_bank_t **cbias, clas_bias_bank_t **pbias, clas_trop_bank_t **trop, int *flag)
static int corr_bias_slot (const int smode[70], int mode)
int clas_bank_get_close (const clas_ctx_t *ctx, gtime_t time, int network, int ch, clas_corr_t *corr)
 Merge closest corrections from all banks into a clas_corr_t snapshot.
static gtime_t backup_cssr_time (const clas_corr_t *corr)
int clas_backup_valid (const clas_ctx_t *ctx, gtime_t obstime, int l6mrg)
 Save/restore the latest usable CSSR snapshot for short correction gaps.
void clas_backup_current (clas_ctx_t *ctx, const clas_grid_t *grid, int l6mrg)
void clas_clear_current (clas_ctx_t *ctx, int ch)
 Drop the current correction snapshot of one channel.
void clas_restore_backup (clas_ctx_t *ctx, gtime_t time, clas_grid_t *grid, int l6mrg)
void clas_check_grid_status (clas_ctx_t *ctx, const clas_corr_t *corr, int ch)
 Check and update grid status flags based on correction availability.
void clas_check_grid_status_time (clas_ctx_t *ctx, gtime_t time, int ch)
void clas_update_global (nav_t *nav, const clas_corr_t *corr, int ch)
 Apply global corrections (orbit/clock/bias) to nav_t.ssr[].
void clas_update_local (nav_t *nav, const clas_corr_t *corr, int ch)
 Apply local corrections (trop/STEC) to nav_t.
static int decode_cssr_head (clas_ctx_t *ctx, clas_l6buf_t *l6, cssr_t *cssr, int *sync, int *tow, int *iod, double *udint, int *ngnss, int i0)
static int check_bit_width_mask (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_oc (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_cc (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_cb (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_pb (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_bias (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_ura (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_stec (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_grid (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_combo (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_atmos (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int check_bit_width_si (clas_l6buf_t *l6, cssr_t *cssr, int i0)
static int decode_cssr_mask (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_oc (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_cc (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_cb (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_pb (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_bias (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_ura (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_stec (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_grid (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_si (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_combo (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_cssr_atmos (clas_ctx_t *ctx, int ch, clas_l6buf_t *l6, int i0)
static int decode_qzs_msg (clas_ctx_t *ctx, int ch)
int clas_get_correct_fac (int msgid)
 Get L6 facility ID from message ID byte.
int clas_route_l6frame (clas_ctx_t *ctx, int prn, int ptn, int l6mrg, gtime_t now)
 Route one interleaved L6D frame to a CLAS channel (or drop it).
int clas_input_cssr (clas_ctx_t *ctx, uint8_t data, int ch)
 Input CSSR byte stream (one byte at a time, real-time).
int clas_decode_msg (clas_ctx_t *ctx, int ch)
 Decode the next pending CSSR message from the assembled bit buffer.
void clas_set_l6tag (clas_ctx_t *ctx, int ch, double tag)
 Set the receiver time tag of the L6 frame about to be input.
int clas_input_cssrf (clas_ctx_t *ctx, FILE *fp, int ch)
 Input CSSR from file (one message at a time, post-processing).
int clas_read_grid_def (clas_ctx_t *ctx, const char *gridfile)
 Read CLAS grid definition file.

Variables

static const double ssrudint [16] = {1, 2, 5, 10, 15, 30, 60, 120, 240, 300, 600, 900, 1800, 3600, 7200, 10800}

Detailed Description

QZSS CLAS (L6D) CSSR decoder and bank management.

References: [1] claslib (https://github.com/mf-arai/claslib) — upstream implementation [2] IS-QZSS-L6-003 — CLAS Compact SSR Specification

Notes:

  • Ported from upstream claslib/cssr.c with singleton→context conversion.
  • All output_cssr_* / CSV debug functions are omitted (not needed in core).
  • Decoders write to ctx->dec_ssr[] (clas_dec_ssr_t) as intermediate buffer, NOT to nav_t.ssr[] directly, to isolate from MRTKLIB ssr_t differences.

Definition in file mrtk_clas.c.

Macro Definition Documentation

◆ MAX

#define MAX ( x,
y )
Value:
((x) > (y) ? (x) : (y))

Definition at line 47 of file mrtk_clas.c.

◆ MIN

#define MIN ( x,
y )
Value:
((x) < (y) ? (x) : (y))

Definition at line 48 of file mrtk_clas.c.

◆ SQR

#define SQR ( x)
Value:
((x) * (x))

Definition at line 46 of file mrtk_clas.c.

Referenced by ddres(), get_trop_sta(), set_init_pb(), udbias_ppp(), udion(), and udion().

Function Documentation

◆ add_base_value_to_cbias()

clas_bias_bank_t * add_base_value_to_cbias ( clas_bank_ctrl_t * bank,
clas_bias_bank_t * srcbias,
int network )
static

Definition at line 924 of file mrtk_clas.c.

References clas_bias_bank_t::bflag, clas_bias_bank_t::cbias, CSSR_INVALID_VALUE, get_bias_save_point(), get_same_bias(), MAXCODE, MAXSAT, clas_bias_bank_t::prn, clas_bias_bank_t::sflag, clas_bias_bank_t::smode, clas_bias_bank_t::time, time2gpst(), and timeadd().

Referenced by sub_get_close_cssr().

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

◆ add_base_value_to_pbias()

clas_bias_bank_t * add_base_value_to_pbias ( clas_bank_ctrl_t * bank,
clas_bias_bank_t * srcbias,
int network )
static

Definition at line 956 of file mrtk_clas.c.

References clas_bias_bank_t::bflag, CSSR_INVALID_VALUE, get_bias_save_point(), get_same_bias(), MAXCODE, MAXSAT, clas_bias_bank_t::pbias, clas_bias_bank_t::prn, clas_bias_bank_t::sflag, clas_bias_bank_t::smode, clas_bias_bank_t::time, time2gpst(), and timeadd().

Referenced by sub_get_close_cssr().

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

◆ add_data_stec()

int add_data_stec ( stec_t * stec,
gtime_t time,
int sat,
int slip,
double iono,
double rate,
double rms,
double quality )
static

Definition at line 1013 of file mrtk_clas.c.

References stec_t::data, stecd_t::flag, stecd_t::iono, stec_t::n, stec_t::nmax, stecd_t::quality, stecd_t::rate, stecd_t::rms, stecd_t::sat, stecd_t::slip, and stecd_t::time.

Referenced by clas_bank_get_close().

Here is the caller graph for this function:

◆ add_data_trop()

int add_data_trop ( zwd_t * z,
gtime_t time,
double zwd,
double ztd,
double quality,
double rms,
int valid )
static

Definition at line 1029 of file mrtk_clas.c.

References zwd_t::data, zwd_t::n, zwd_t::nmax, zwdd_t::quality, zwdd_t::rms, zwdd_t::time, zwdd_t::valid, zwdd_t::ztd, and zwdd_t::zwd.

Referenced by clas_bank_get_close().

Here is the caller graph for this function:

◆ backup_cssr_time()

gtime_t backup_cssr_time ( const clas_corr_t * corr)
static

Definition at line 1221 of file mrtk_clas.c.

References clas_corr_t::bias_time, clas_corr_t::clock_time, clas_corr_t::orbit_time, and timediff().

Referenced by clas_backup_valid(), and clas_restore_backup().

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

◆ check_bit_width_atmos()

int check_bit_width_atmos ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1769 of file mrtk_clas.c.

References clas_l6buf_t::buff, getbitu(), clas_l6buf_t::havebit, cssr_t::svmask, and svmask2sat().

Referenced by decode_qzs_msg().

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

◆ check_bit_width_bias()

int check_bit_width_bias ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1629 of file mrtk_clas.c.

References clas_l6buf_t::buff, cssr_t::cellmask, CSSR_MAX_SV, getbitu(), clas_l6buf_t::havebit, cssr_t::sigmask, sigmask2sig(), cssr_t::svmask, and svmask2sat().

Referenced by decode_qzs_msg().

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

◆ check_bit_width_cb()

int check_bit_width_cb ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1609 of file mrtk_clas.c.

References cssr_t::cellmask, CSSR_MAX_SV, clas_l6buf_t::havebit, cssr_t::sigmask, sigmask2sig(), cssr_t::svmask, and svmask2sat().

Referenced by decode_qzs_msg().

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

◆ check_bit_width_cc()

int check_bit_width_cc ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1604 of file mrtk_clas.c.

References cssr_t::svmask, and svmask2sat().

Referenced by decode_qzs_msg().

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

◆ check_bit_width_combo()

int check_bit_width_combo ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1727 of file mrtk_clas.c.

References clas_l6buf_t::buff, CSSR_MAX_SV, getbitu(), clas_l6buf_t::havebit, satsys(), cssr_t::svmask, svmask2sat(), and SYS_GAL.

Referenced by decode_qzs_msg().

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

◆ check_bit_width_grid()

int check_bit_width_grid ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1699 of file mrtk_clas.c.

References clas_l6buf_t::buff, getbitu(), clas_l6buf_t::havebit, cssr_t::svmask, and svmask2sat().

Referenced by decode_qzs_msg().

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

◆ check_bit_width_mask()

int check_bit_width_mask ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1549 of file mrtk_clas.c.

References clas_l6buf_t::buff, getbitu(), clas_l6buf_t::havebit, sigmask2nsig(), and svmask2nsat().

Referenced by decode_qzs_msg().

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

◆ check_bit_width_oc()

int check_bit_width_oc ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1588 of file mrtk_clas.c.

References CSSR_MAX_SV, clas_l6buf_t::havebit, satsys(), cssr_t::svmask, svmask2sat(), and SYS_GAL.

Referenced by decode_qzs_msg().

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

◆ check_bit_width_pb()

int check_bit_width_pb ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1619 of file mrtk_clas.c.

References cssr_t::cellmask, CSSR_MAX_SV, clas_l6buf_t::havebit, cssr_t::sigmask, sigmask2sig(), cssr_t::svmask, and svmask2sat().

Referenced by decode_qzs_msg().

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

◆ check_bit_width_si()

int check_bit_width_si ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1860 of file mrtk_clas.c.

References clas_l6buf_t::buff, getbitu(), and clas_l6buf_t::havebit.

Referenced by decode_qzs_msg().

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

◆ check_bit_width_stec()

int check_bit_width_stec ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1677 of file mrtk_clas.c.

References clas_l6buf_t::buff, CSSR_MAX_SV, getbitu(), clas_l6buf_t::havebit, cssr_t::svmask, and svmask2sat().

Referenced by decode_qzs_msg().

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

◆ check_bit_width_ura()

int check_bit_width_ura ( clas_l6buf_t * l6,
cssr_t * cssr,
int i0 )
static

Definition at line 1672 of file mrtk_clas.c.

References clas_l6buf_t::havebit, cssr_t::svmask, and svmask2sat().

Referenced by decode_qzs_msg().

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

◆ check_cssr_changed_facility()

void check_cssr_changed_facility ( clas_ctx_t * ctx,
int ch,
int facility )
static

Definition at line 619 of file mrtk_clas.c.

References clas_ctx_t::bank, clas_bank_ctrl_t::BiasBank, clas_bank_ctrl_t::ClockBank, clas_bank_ctrl_t::Facility, clas_bank_ctrl_t::LatestTrop, clas_bank_ctrl_t::NextBias, clas_bank_ctrl_t::NextClock, clas_bank_ctrl_t::NextOrbit, clas_bank_ctrl_t::NextTrop, clas_bank_ctrl_t::OrbitBank, clas_bank_ctrl_t::separation, trace(), and clas_bank_ctrl_t::TropBank.

Referenced by decode_cssr_atmos(), decode_cssr_bias(), decode_cssr_cb(), decode_cssr_cc(), decode_cssr_combo(), decode_cssr_grid(), decode_cssr_oc(), and decode_cssr_pb().

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

◆ check_week_ref()

void check_week_ref ( clas_ctx_t * ctx,
clas_l6buf_t * l6,
int tow,
int i )
static

Definition at line 271 of file mrtk_clas.c.

References gpst2time(), clas_ctx_t::obs_ref, gtime_t::sec, gtime_t::time, timediff(), clas_l6buf_t::tow0, clas_ctx_t::tow_ref, trace(), and clas_ctx_t::week_ref.

Referenced by decode_cssr_atmos(), decode_cssr_bias(), decode_cssr_cb(), decode_cssr_cc(), decode_cssr_combo(), decode_cssr_grid(), decode_cssr_mask(), decode_cssr_oc(), decode_cssr_pb(), decode_cssr_stec(), and decode_cssr_ura().

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

◆ clas_backup_current()

void clas_backup_current ( clas_ctx_t * ctx,
const clas_grid_t * grid,
int l6mrg )
extern

Definition at line 1250 of file mrtk_clas.c.

References clas_ctx_t::backup, clas_ctx_t::backup_grid, CLAS_CH_NUM, clas_ctx_t::current, init_grid_index(), and SSR_CH_NUM.

Referenced by ppp_rtk_pos().

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

◆ clas_backup_valid()

int clas_backup_valid ( const clas_ctx_t * ctx,
gtime_t obstime,
int l6mrg )
extern

Save/restore the latest usable CSSR snapshot for short correction gaps.

Mirrors claslib's BackupCSSR/BackupGrid path. The backup is considered valid while its latest global correction time is within 180 s of the observation.

Definition at line 1233 of file mrtk_clas.c.

References clas_ctx_t::backup, backup_cssr_time(), CLAS_CH_NUM, SSR_CH_NUM, timediff(), and clas_corr_t::use.

Referenced by ppp_rtk_pos().

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

◆ clas_bank_get_close()

int clas_bank_get_close ( const clas_ctx_t * ctx,
gtime_t time,
int network,
int ch,
clas_corr_t * corr )
extern

Merge closest corrections from all banks into a clas_corr_t snapshot.

Parameters
[in]ctxCLAS context
[in]timeTarget time for matching
[in]networkNetwork id
[in]chChannel index
[out]corrOutput merged correction snapshot
Returns
0 on success, -1 if no valid corrections found

Definition at line 1121 of file mrtk_clas.c.

References add_data_stec(), add_data_trop(), clas_ctx_t::bank, clas_corr_t::bias_time, clas_clock_bank_t::c0, clas_corr_t::c0, clas_bias_bank_t::cbias, clas_corr_t::cbias, clas_corr_t::clock_time, corr_bias_slot(), CSSR_INVALID_VALUE, clas_corr_t::deph0, clas_orbit_bank_t::deph0, clas_corr_t::deph1, clas_orbit_bank_t::deph1, clas_corr_t::deph2, clas_orbit_bank_t::deph2, clas_bank_ctrl_t::Facility, clas_corr_t::facility, clas_corr_t::flag, clas_corr_t::gridnum, clas_trop_bank_t::gridnum, clas_trop_bank_t::gridpos, init_grid_index(), clas_bias_bank_t::iod, clas_clock_bank_t::iod, clas_corr_t::iod, clas_orbit_bank_t::iod, clas_corr_t::iode, clas_orbit_bank_t::iode, clas_trop_bank_t::iono, MAXCODE, MAXSAT, clas_corr_t::network, clas_corr_t::orbit_time, clas_bias_bank_t::pbias, clas_corr_t::pbias, clas_bias_bank_t::prn, clas_clock_bank_t::prn, clas_corr_t::prn, clas_orbit_bank_t::prn, clas_trop_bank_t::prn, clas_trop_bank_t::satnum, set_grid_data(), clas_bias_bank_t::sflag, clas_bias_bank_t::smode, clas_corr_t::smode, clas_corr_t::stec, sub_get_close_cssr(), clas_bias_bank_t::time, clas_clock_bank_t::time, clas_corr_t::time, clas_orbit_bank_t::time, clas_trop_bank_t::time, clas_trop_bank_t::total, clas_corr_t::trop_time, clas_bias_bank_t::udi, clas_clock_bank_t::udi, clas_corr_t::udi, clas_orbit_bank_t::udi, clas_corr_t::update_time, clas_bank_ctrl_t::use, clas_corr_t::use, clas_trop_bank_t::wet, and clas_corr_t::zwd.

Referenced by clas_ssr2osr(), decoderaw(), ppp_rtk_pos(), and update_clas().

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

◆ clas_bank_init()

void clas_bank_init ( clas_ctx_t * ctx,
int ch )
extern

Initialize bank control for a channel.

Parameters
[in,out]ctxCLAS context
[in]chChannel index

Definition at line 101 of file mrtk_clas.c.

References clas_ctx_t::bank, clas_bank_ctrl_t::BiasBank, CLAS_CH_NUM, CLAS_MAX_NETWORK, clas_bank_ctrl_t::ClockBank, clas_bank_ctrl_t::Facility, clas_bank_ctrl_t::fastfix, clas_bank_ctrl_t::LatestTrop, clas_bank_ctrl_t::NextBias, clas_bank_ctrl_t::NextClock, clas_bank_ctrl_t::NextOrbit, clas_bank_ctrl_t::NextTrop, clas_bank_ctrl_t::OrbitBank, clas_bank_ctrl_t::separation, clas_bank_ctrl_t::TropBank, and clas_bank_ctrl_t::use.

Referenced by clas_ctx_init().

Here is the caller graph for this function:

◆ clas_check_grid_status()

void clas_check_grid_status ( clas_ctx_t * ctx,
const clas_corr_t * corr,
int ch )
extern

Check and update grid status flags based on correction availability.

Validates that orbit, trop, and STEC corrections exist for each grid point and sets grid_stat[ch][network][gp] accordingly. Must be called after clas_bank_get_close() to enable grid-based positioning.

Parameters
[in,out]ctxCLAS context (updates grid_stat)
[in]timeCurrent observation time
[in]chL6 channel index (0..CLAS_CH_NUM-1)

Definition at line 1320 of file mrtk_clas.c.

References clas_ctx_t::bank, CLAS_CH_NUM, CLAS_MAX_GP, CLAS_MAX_NETWORK, clas_bank_ctrl_t::fastfix, clas_ctx_t::grid_stat, clas_corr_t::gridnum, stec_t::n, clas_corr_t::network, clas_corr_t::orbit_time, clas_corr_t::stec, gtime_t::time, timediff(), trace(), clas_corr_t::trop_time, clas_corr_t::update_time, clas_corr_t::use, zwdd_t::valid, and clas_corr_t::zwddata.

Referenced by clas_ssr2osr(), decoderaw(), ppp_rtk_pos(), and update_clas().

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

◆ clas_check_grid_status_time()

void clas_check_grid_status_time ( clas_ctx_t * ctx,
gtime_t time,
int ch )
extern

Definition at line 1365 of file mrtk_clas.c.

References clas_ctx_t::bank, CLAS_CH_NUM, CLAS_MAX_GP, CLAS_MAX_NETWORK, CSSR_INVALID_VALUE, clas_bank_ctrl_t::fastfix, get_close_orbit(), get_close_trop(), clas_ctx_t::grid_stat, clas_trop_bank_t::gridnum, clas_trop_bank_t::iono, clas_orbit_bank_t::network, clas_trop_bank_t::satnum, clas_orbit_bank_t::time, clas_trop_bank_t::time, timediff(), clas_trop_bank_t::total, trace(), clas_bank_ctrl_t::use, and clas_trop_bank_t::wet.

Referenced by update_clas().

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

◆ clas_clear_current()

void clas_clear_current ( clas_ctx_t * ctx,
int ch )
extern

Drop the current correction snapshot of one channel.

Used when a channel supplies no corrections for the epoch, so that clas_update_global() clears nav_t.ssr_ch[ch] instead of re-applying the previous epoch's snapshot.

Parameters
[in,out]ctxCLAS context
[in]chChannel index

Definition at line 1266 of file mrtk_clas.c.

References CLAS_CH_NUM, clas_ctx_t::current, and init_grid_index().

Referenced by ppp_rtk_pos().

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

◆ clas_ctx_free()

void clas_ctx_free ( clas_ctx_t * ctx)
extern

Free CLAS context (release heap-allocated bank control).

Parameters
[in,out]ctxCLAS context to free

Definition at line 88 of file mrtk_clas.c.

References clas_ctx_t::bank, CLAS_CH_NUM, free, and clas_ctx_t::initialized.

Referenced by clas_ctx_init(), freepreceph(), and rtksvrfree().

Here is the caller graph for this function:

◆ clas_ctx_init()

int clas_ctx_init ( clas_ctx_t * ctx)
extern

Initialize CLAS context (allocate bank control on heap).

Parameters
[out]ctxCLAS context to initialize
Returns
0 on success, -1 on allocation failure

Definition at line 54 of file mrtk_clas.c.

References clas_ctx_t::bank, calloc, clas_bank_init(), CLAS_CH_NUM, clas_ctx_free(), CSSR_REF_MAX, clas_ctx_t::initialized, clas_ctx_t::l6delivery, clas_ctx_t::l6facility, clas_ctx_t::l6lock_time, clas_ctx_t::l6pattern, gtime_t::sec, gtime_t::time, and clas_ctx_t::tow_ref.

Referenced by readpreceph(), and rtksvrstart().

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

◆ clas_decode_msg()

int clas_decode_msg ( clas_ctx_t * ctx,
int ch )
extern

Decode the next pending CSSR message from the assembled bit buffer.

Call this after clas_input_cssr() to trigger CSSR message decoding. clas_input_cssr() only assembles L6 frames; this function performs the actual CSSR decode step and returns a completion code.

Parameters
[in,out]ctxCLAS context
[in]chChannel index (0 = primary)
Returns
10 when a complete CSSR correction set is ready, 0 otherwise

Definition at line 3213 of file mrtk_clas.c.

References decode_qzs_msg().

Referenced by decoderaw().

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

◆ clas_get_correct_fac()

int clas_get_correct_fac ( int msgid)
extern

Get L6 facility ID from message ID byte.

Parameters
[in]msgidL6 message ID byte
Returns
Facility ID (0-3)

Definition at line 3037 of file mrtk_clas.c.

Referenced by clas_input_cssr().

Here is the caller graph for this function:

◆ clas_input_cssr()

int clas_input_cssr ( clas_ctx_t * ctx,
uint8_t data,
int ch )
extern

Input CSSR byte stream (one byte at a time, real-time).

Parameters
[in,out]ctxCLAS context
[in]dataInput byte
[in]chChannel index (0 or 1)
Returns
Status (-1:error, 0:no message, 10:SSR message decoded)

Definition at line 3127 of file mrtk_clas.c.

References l6_header_t::alert, BLEN_MSG, clas_l6buf_t::buff, clas_get_correct_fac(), clas_l6buf_t::decode_start, clas_l6buf_t::fbuff, clas_l6buf_t::frame, clas_l6buf_t::ftag, clas_l6buf_t::ftag_last, clas_l6buf_t::havebit, l6_parse_header(), l6_service_name(), L6_SVC_CLAS, L6_SVC_NULL, clas_ctx_t::l6buf, clas_ctx_t::l6delivery, clas_ctx_t::l6facility, L6FRMPREAMB, clas_l6buf_t::len, l6_header_t::msgid, clas_l6buf_t::nbit, clas_l6buf_t::nbyte, clas_l6buf_t::nframe, clas_l6buf_t::preamble, l6_header_t::prn, setbitu(), l6_header_t::sf_ind, l6_header_t::svc, and trace().

Referenced by clas_input_cssrf(), and decoderaw().

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

◆ clas_input_cssrf()

int clas_input_cssrf ( clas_ctx_t * ctx,
FILE * fp,
int ch )
extern

Input CSSR from file (one message at a time, post-processing).

Parameters
[in,out]ctxCLAS context
[in]fpFile pointer
[in]chChannel index
Returns
Status (-2:EOF, -1:error, 0:no message, 10:SSR message decoded)

Definition at line 3217 of file mrtk_clas.c.

References clas_input_cssr(), and decode_qzs_msg().

Referenced by update_clas().

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

◆ clas_read_grid_def()

int clas_read_grid_def ( clas_ctx_t * ctx,
const char * file )
extern

Read CLAS grid definition file.

Parameters
[in,out]ctxCLAS context (stores grid positions)
[in]fileGrid definition file path
Returns
0 on success, -1 on error

Definition at line 3238 of file mrtk_clas.c.

References CLAS_MAX_GP, CLAS_MAX_NETWORK, clas_ctx_t::grid_pos, clas_ctx_t::gridsel, and trace().

Referenced by execses().

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

◆ clas_restore_backup()

void clas_restore_backup ( clas_ctx_t * ctx,
gtime_t time,
clas_grid_t * grid,
int l6mrg )
extern

Definition at line 1274 of file mrtk_clas.c.

References clas_ctx_t::backup, backup_cssr_time(), clas_ctx_t::backup_grid, clas_ctx_t::bank, clas_clock_bank_t::c0, clas_corr_t::c0, CLAS_CH_NUM, clas_corr_t::clock_time, clas_ctx_t::current, clas_corr_t::flag, get_close_clock(), init_grid_index(), clas_clock_bank_t::iod, clas_corr_t::iod, MAXSAT, clas_grid_t::network, clas_corr_t::orbit_time, clas_clock_bank_t::prn, clas_corr_t::prn, SSR_CH_NUM, clas_clock_bank_t::time, clas_corr_t::time, timediff(), clas_clock_bank_t::udi, clas_corr_t::udi, clas_bank_ctrl_t::use, and clas_corr_t::use.

Referenced by ppp_rtk_pos().

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

◆ clas_route_l6frame()

int clas_route_l6frame ( clas_ctx_t * ctx,
int prn,
int ptn,
int l6mrg,
gtime_t now )
extern

Route one interleaved L6D frame to a CLAS channel (or drop it).

A single UBX/SBF stream from a multi-channel L6 receiver (e.g. u-blox D9C, and future receivers with more channels) carries L6D frames from several QZS PRNs interleaved. Each CLAS channel decodes one PRN's subframe sequence statefully, so frames from different PRNs must NOT be mixed into the same channel. This router keeps each channel locked to a single active source PRN and drops frames from any other PRN, re-locking only after the active source has been silent for CLAS_L6_RELOCK_TIMEOUT seconds.

Channels are keyed by CLAS Transmit Pattern ID (IS-QZSS-L6 §4.1.1.2): there are only two patterns, so two channels suffice regardless of how many PRNs the receiver tracks. Single-channel CLAS (l6mrg=0) uses ch 0 only and collapses to whichever pattern is currently active; dual-channel CLAS (l6mrg!=0) maps each pattern to its own channel for merging.

Parameters
[in,out]ctxCLAS context (holds per-channel PRN/pattern/time lock)
[in]prnBroadcasting QZS PRN (L6 frame byte buff[4])
[in]ptnCLAS Transmit Pattern ID, (buff[5] & 0x06) >> 1
[in]l6mrgL6 merge mode (0:single channel, !=0:dual channel)
[in]nowCurrent observation time (GPST) used for the timeout
Returns
Channel index (0..CLAS_CH_NUM-1) to feed, or -1 to drop the frame.

Definition at line 3070 of file mrtk_clas.c.

References CLAS_CH_NUM, CLAS_L6_RELOCK_TIMEOUT, clas_ctx_t::l6delivery, clas_ctx_t::l6lock_time, clas_ctx_t::l6pattern, gtime_t::time, timediff(), and trace().

Referenced by decoderaw().

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

◆ clas_set_l6tag()

void clas_set_l6tag ( clas_ctx_t * ctx,
int ch,
double tag )
extern

Set the receiver time tag of the L6 frame about to be input.

L6 frames are broadcast once per second and the L6 header has no frame counter, so a lost frame can only be seen from the receiver time. Call this before inputting each frame when the receiver reports a per-frame time (SBF QZSRawL6 block TOW, UBX-RXM-QZSSL6 time tag). A subframe with a frame missing is then discarded instead of being decoded from shifted bits (#363). Inputs without a time tag (raw L6 byte streams and files) are not checked.

Parameters
[in,out]ctxCLAS context
[in]chChannel index (0 or 1)
[in]tagReceiver time of the frame (s, any origin; 0: unknown)

Definition at line 3215 of file mrtk_clas.c.

References clas_l6buf_t::ftag, and clas_ctx_t::l6buf.

Referenced by decoderaw().

Here is the caller graph for this function:

◆ clas_update_global()

void clas_update_global ( nav_t * nav,
const clas_corr_t * corr,
int ch )
extern

Apply global corrections (orbit/clock/bias) to nav_t.ssr[].

Parameters
[in,out]navNavigation data
[in]corrMerged correction snapshot
[in]chChannel index

Definition at line 1430 of file mrtk_clas.c.

References clas_corr_t::c0, clas_corr_t::cbias, ssr_t::cbias, ssr_t::dclk, ssr_t::ddeph, ssr_t::deph, clas_corr_t::deph0, clas_corr_t::deph1, clas_corr_t::deph2, ssr_t::discnt, clas_corr_t::facility, nav_s::facility, clas_corr_t::iod, ssr_t::iod, clas_corr_t::iode, ssr_t::iode, MAXCODE, MAXSAT, clas_corr_t::pbias, ssr_t::pbias, clas_corr_t::prn, clas_corr_t::smode, nav_s::ssr_ch, ssr_t::t0, clas_corr_t::time, clas_corr_t::udi, ssr_t::udi, and ssr_t::update.

Referenced by clas_ssr2osr(), decoderaw(), ppp_rtk_pos(), and update_clas().

Here is the caller graph for this function:

◆ clas_update_local()

void clas_update_local ( nav_t * nav,
const clas_corr_t * corr,
int ch )
extern

Apply local corrections (trop/STEC) to nav_t.

Parameters
[in,out]navNavigation data
[in]corrMerged correction snapshot
[in]chChannel index

Definition at line 1493 of file mrtk_clas.c.

Referenced by clas_ssr2osr(), and ppp_rtk_pos().

Here is the caller graph for this function:

◆ corr_bias_slot()

int corr_bias_slot ( const int smode[70],
int mode )
static

Definition at line 1106 of file mrtk_clas.c.

References MAXCODE.

Referenced by clas_bank_get_close().

Here is the caller graph for this function:

◆ cssr_gnss2sys()

int cssr_gnss2sys ( int gnss,
int * prn0 )
extern

Convert CSSR GNSS ID to RTKLIB system bitmask.

Parameters
[in]gnssCSSR GNSS ID (CSSR_SYS_GPS, etc.)
[out]prn0Output base PRN offset (can be NULL)
Returns
RTKLIB system bitmask (SYS_GPS, etc.), 0 on error

Definition at line 175 of file mrtk_clas.c.

References CSSR_SYS_BDS, CSSR_SYS_GAL, CSSR_SYS_GLO, CSSR_SYS_GPS, CSSR_SYS_QZS, CSSR_SYS_SBS, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_NONE, SYS_QZS, and SYS_SBS.

Referenced by svmask2nsatlist(), and svmask2sat().

Here is the caller graph for this function:

◆ cssr_sys2gnss()

int cssr_sys2gnss ( int sys,
int * prn0 )
extern

Convert RTKLIB system bitmask to CSSR GNSS ID.

Parameters
[in]sysRTKLIB system (SYS_GPS, etc.)
[out]prn0Output base PRN offset (can be NULL)
Returns
CSSR GNSS ID, CSSR_SYS_NONE on error

Definition at line 140 of file mrtk_clas.c.

References CSSR_SYS_BDS, CSSR_SYS_GAL, CSSR_SYS_GLO, CSSR_SYS_GPS, CSSR_SYS_NONE, CSSR_SYS_QZS, CSSR_SYS_SBS, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_QZS, and SYS_SBS.

Referenced by sigmask2sig(), and sigmask2sig_p().

Here is the caller graph for this function:

◆ decode_cssr_atmos()

int decode_cssr_atmos ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

◆ decode_cssr_bias()

int decode_cssr_bias ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

◆ decode_cssr_cb()

int decode_cssr_cb ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

Definition at line 2059 of file mrtk_clas.c.

References clas_l6buf_t::buff, clas_dec_ssr_t::cbias, cssr_t::cellmask, check_cssr_changed_facility(), check_week_ref(), clas_ctx_t::cssr, CSSR_MAX_SIG, CSSR_MAX_SV, CSSR_REF_CBIAS, clas_ctx_t::dec_ssr, decode_cssr_head(), decode_sval(), gpst2time(), clas_dec_ssr_t::iod, cssr_t::iod, clas_ctx_t::l6facility, cssr_t::l6facility, MAXCODE, MAXSAT, clas_l6buf_t::nbit, clas_dec_ssr_t::nsig, gtime_t::sec, set_cssr_bank_cbias(), cssr_t::sigmask, sigmask2sig(), clas_dec_ssr_t::smode, cssr_t::svmask, svmask2sat(), clas_dec_ssr_t::t0, clas_l6buf_t::time, gtime_t::time, trace(), clas_dec_ssr_t::udi, clas_dec_ssr_t::update, clas_dec_ssr_t::update_cb, and clas_ctx_t::week_ref.

Referenced by decode_qzs_msg().

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

◆ decode_cssr_cc()

int decode_cssr_cc ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

Definition at line 2007 of file mrtk_clas.c.

References clas_l6buf_t::buff, check_cssr_changed_facility(), check_week_ref(), clas_ctx_t::cssr, CSSR_MAX_SV, CSSR_REF_CLOCK, clas_dec_ssr_t::dclk, clas_ctx_t::dec_ssr, decode_cssr_head(), decode_sval(), gpst2time(), clas_dec_ssr_t::iod, cssr_t::iod, clas_ctx_t::l6facility, cssr_t::l6facility, MAXSAT, clas_l6buf_t::nbit, gtime_t::sec, set_cssr_bank_clock(), cssr_t::svmask, svmask2sat(), clas_dec_ssr_t::t0, clas_l6buf_t::time, gtime_t::time, trace(), clas_dec_ssr_t::udi, clas_dec_ssr_t::update, clas_dec_ssr_t::update_cc, and clas_ctx_t::week_ref.

Referenced by decode_qzs_msg().

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

◆ decode_cssr_combo()

int decode_cssr_combo ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

◆ decode_cssr_grid()

int decode_cssr_grid ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

◆ decode_cssr_head()

int decode_cssr_head ( clas_ctx_t * ctx,
clas_l6buf_t * l6,
cssr_t * cssr,
int * sync,
int * tow,
int * iod,
double * udint,
int * ngnss,
int i0 )
static

Definition at line 1506 of file mrtk_clas.c.

References clas_l6buf_t::buff, CSSR_TYPE_MASK, getbitu(), cssr_t::iod, ssrudint, clas_l6buf_t::subtype, clas_l6buf_t::time, gtime_t::time, clas_l6buf_t::tow0, clas_l6buf_t::tow_last, and trace().

Referenced by decode_cssr_atmos(), decode_cssr_bias(), decode_cssr_cb(), decode_cssr_cc(), decode_cssr_combo(), decode_cssr_grid(), decode_cssr_mask(), decode_cssr_oc(), decode_cssr_pb(), decode_cssr_stec(), and decode_cssr_ura().

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

◆ decode_cssr_mask()

int decode_cssr_mask ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

Definition at line 1875 of file mrtk_clas.c.

References clas_l6buf_t::buff, cssr_t::cellmask, check_week_ref(), cssr_t::cmi, clas_ctx_t::cssr, CSSR_MAX_GNSS, CSSR_MAX_SV, CSSR_REF_MASK, decode_cssr_head(), getbitu(), gpst2time(), cssr_t::iod, clas_ctx_t::l6delivery, cssr_t::l6delivery, clas_ctx_t::l6facility, cssr_t::l6facility, clas_l6buf_t::nbit, cssr_t::sigmask, sigmask2nsig(), cssr_t::svmask, svmask2nsatlist(), clas_l6buf_t::time, clas_l6buf_t::tow0, trace(), and clas_ctx_t::week_ref.

Referenced by decode_qzs_msg().

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

◆ decode_cssr_oc()

int decode_cssr_oc ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

Definition at line 1937 of file mrtk_clas.c.

References clas_l6buf_t::buff, check_cssr_changed_facility(), check_week_ref(), clas_ctx_t::cssr, CSSR_INVALID_VALUE, CSSR_MAX_SV, CSSR_REF_ORBIT, clas_dec_ssr_t::ddeph, clas_ctx_t::dec_ssr, decode_cssr_head(), decode_sval(), clas_dec_ssr_t::deph, getbitu(), gpst2time(), clas_dec_ssr_t::iod, cssr_t::iod, clas_dec_ssr_t::iode, clas_ctx_t::l6facility, cssr_t::l6facility, MAXSAT, clas_l6buf_t::nbit, satsys(), gtime_t::sec, set_cssr_bank_orbit(), cssr_t::svmask, svmask2sat(), SYS_GAL, clas_dec_ssr_t::t0, clas_l6buf_t::time, gtime_t::time, trace(), clas_dec_ssr_t::udi, clas_dec_ssr_t::update, clas_dec_ssr_t::update_oc, and clas_ctx_t::week_ref.

Referenced by decode_qzs_msg().

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

◆ decode_cssr_pb()

int decode_cssr_pb ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

◆ decode_cssr_quality_stec()

float decode_cssr_quality_stec ( int a,
int b )
static

Definition at line 257 of file mrtk_clas.c.

Referenced by decode_cssr_atmos(), and decode_cssr_stec().

Here is the caller graph for this function:

◆ decode_cssr_quality_trop()

float decode_cssr_quality_trop ( int a,
int b )
static

Definition at line 264 of file mrtk_clas.c.

Referenced by decode_cssr_atmos(), and decode_cssr_grid().

Here is the caller graph for this function:

◆ decode_cssr_si()

int decode_cssr_si ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

Definition at line 2534 of file mrtk_clas.c.

References clas_l6buf_t::buff, clas_ctx_t::cssr, getbitu(), clas_l6buf_t::nbit, cssr_t::si_cnt, cssr_t::si_data, and cssr_t::si_sz.

Referenced by decode_qzs_msg().

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

◆ decode_cssr_stec()

int decode_cssr_stec ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

Definition at line 2342 of file mrtk_clas.c.

References ssrn_t::a, clas_l6buf_t::buff, check_week_ref(), clas_ctx_t::cssr, CSSR_MAX_NET, CSSR_MAX_SV, CSSR_REF_STEC, decode_cssr_head(), decode_cssr_quality_stec(), decode_sval(), getbitu(), gpst2time(), cssr_t::iod, ssrn_t::iod, clas_ctx_t::l6facility, cssr_t::l6facility, clas_l6buf_t::nbit, cssr_t::net_svmask, ssrn_t::nsat_f, cssr_t::opt, ssrn_t::quality_f, ssrn_t::sat_f, cssr_t::ssrn, cssropt_t::stec_type, cssr_t::svmask, svmask2sat(), ssrn_t::t0, clas_l6buf_t::time, trace(), ssrn_t::udi, ssrn_t::update, and clas_ctx_t::week_ref.

Referenced by decode_qzs_msg().

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

◆ decode_cssr_ura()

int decode_cssr_ura ( clas_ctx_t * ctx,
int ch,
clas_l6buf_t * l6,
int i0 )
static

Definition at line 2304 of file mrtk_clas.c.

References clas_l6buf_t::buff, check_week_ref(), clas_ctx_t::cssr, CSSR_MAX_SV, CSSR_REF_URA, clas_ctx_t::dec_ssr, decode_cssr_head(), getbitu(), gpst2time(), clas_dec_ssr_t::iod, cssr_t::iod, clas_ctx_t::l6facility, cssr_t::l6facility, clas_l6buf_t::nbit, cssr_t::svmask, svmask2sat(), clas_dec_ssr_t::t0, clas_l6buf_t::time, trace(), clas_dec_ssr_t::udi, clas_dec_ssr_t::update, clas_dec_ssr_t::update_ura, clas_dec_ssr_t::ura, and clas_ctx_t::week_ref.

Referenced by decode_qzs_msg().

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

◆ decode_qzs_msg()

◆ decode_sval()

double decode_sval ( const uint8_t * buff,
int i,
int n,
double lsb )
static

Definition at line 134 of file mrtk_clas.c.

References CSSR_INVALID_VALUE, and getbits().

Referenced by decode_cssr_atmos(), decode_cssr_bias(), decode_cssr_cb(), decode_cssr_cc(), decode_cssr_combo(), decode_cssr_grid(), decode_cssr_oc(), decode_cssr_pb(), and decode_cssr_stec().

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

◆ get_bias_save_point()

int get_bias_save_point ( clas_bias_bank_t * bias,
int prn,
int mode )
static

Definition at line 598 of file mrtk_clas.c.

References MAXCODE, and clas_bias_bank_t::smode.

Referenced by add_base_value_to_cbias(), add_base_value_to_pbias(), set_cssr_bank_cbias(), and set_cssr_bank_pbias().

Here is the caller graph for this function:

◆ get_close_cbias()

clas_bias_bank_t * get_close_cbias ( clas_bank_ctrl_t * bank,
gtime_t time,
int network,
double age )
static

Definition at line 505 of file mrtk_clas.c.

References clas_bias_bank_t::bflag, clas_bank_ctrl_t::BiasBank, CLAS_BANK_NUM, CLAS_MAX_NETWORK, clas_bias_bank_t::network, clas_bias_bank_t::time, timediff(), and clas_bias_bank_t::use.

Referenced by get_close_net_cbias().

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

◆ get_close_clock()

clas_clock_bank_t * get_close_clock ( clas_bank_ctrl_t * bank,
gtime_t obstime,
gtime_t time,
int network,
double age )
static

Definition at line 472 of file mrtk_clas.c.

References CLAS_BANK_NUM, CLAS_MAX_NETWORK, clas_bank_ctrl_t::ClockBank, clas_clock_bank_t::network, search(), clas_bank_ctrl_t::separation, clas_clock_bank_t::time, timediff(), and clas_clock_bank_t::use.

Referenced by clas_restore_backup(), and sub_get_close_cssr().

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

◆ get_close_net_cbias()

clas_bias_bank_t * get_close_net_cbias ( clas_bank_ctrl_t * bank,
gtime_t time,
int network,
double age )
static

Definition at line 551 of file mrtk_clas.c.

References get_close_cbias().

Referenced by sub_get_close_cssr().

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

◆ get_close_net_pbias()

clas_bias_bank_t * get_close_net_pbias ( clas_bank_ctrl_t * bank,
gtime_t time,
int network,
double age )
static

Definition at line 561 of file mrtk_clas.c.

References get_close_pbias().

Referenced by sub_get_close_cssr().

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

◆ get_close_orbit()

clas_orbit_bank_t * get_close_orbit ( clas_bank_ctrl_t * bank,
gtime_t time,
int network,
double age )
static

Definition at line 434 of file mrtk_clas.c.

References CLAS_BANK_NUM, CLAS_MAX_NETWORK, clas_orbit_bank_t::network, clas_bank_ctrl_t::OrbitBank, search(), clas_bank_ctrl_t::separation, clas_orbit_bank_t::time, timediff(), and clas_orbit_bank_t::use.

Referenced by clas_check_grid_status_time(), and sub_get_close_cssr().

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

◆ get_close_pbias()

clas_bias_bank_t * get_close_pbias ( clas_bank_ctrl_t * bank,
gtime_t time,
int network,
double age )
static

Definition at line 528 of file mrtk_clas.c.

References clas_bias_bank_t::bflag, clas_bank_ctrl_t::BiasBank, CLAS_BANK_NUM, CLAS_MAX_NETWORK, clas_bias_bank_t::network, clas_bias_bank_t::time, timediff(), and clas_bias_bank_t::use.

Referenced by get_close_net_pbias().

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

◆ get_close_trop()

clas_trop_bank_t * get_close_trop ( clas_bank_ctrl_t * bank,
gtime_t obstime,
gtime_t time,
int network,
double age,
int tropless )
static

Definition at line 571 of file mrtk_clas.c.

References CLAS_BANK_NUM, CLAS_MAX_NETWORK, clas_trop_bank_t::gridnum, clas_trop_bank_t::time, timediff(), clas_bank_ctrl_t::TropBank, and clas_trop_bank_t::use.

Referenced by clas_check_grid_status_time(), and sub_get_close_cssr().

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

◆ get_cssr_latest_iono()

int get_cssr_latest_iono ( clas_bank_ctrl_t * bank,
double * iono,
gtime_t time,
int network,
int index,
int sat )
static

Definition at line 862 of file mrtk_clas.c.

References CSSR_INVALID_VALUE, CSSR_STECVALIDAGE, FREQ1, FREQ2, clas_bank_ctrl_t::LatestTrop, clas_latest_trop_t::prn, clas_latest_trop_t::stec, clas_latest_trop_t::stec0, clas_latest_trop_t::stectime, and timediff().

Referenced by set_cssr_bank_trop().

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

◆ get_cssr_latest_trop()

int get_cssr_latest_trop ( clas_bank_ctrl_t * bank,
double * total,
double * wet,
gtime_t time,
int network,
int index )
static

Definition at line 849 of file mrtk_clas.c.

References CSSR_INVALID_VALUE, CSSR_TROPVALIDAGE, clas_bank_ctrl_t::LatestTrop, timediff(), clas_latest_trop_t::total, clas_latest_trop_t::troptime, and clas_latest_trop_t::wet.

Referenced by set_cssr_bank_trop().

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

◆ get_same_bias()

clas_bias_bank_t * get_same_bias ( clas_bank_ctrl_t * bank,
gtime_t time,
int network )
static

Definition at line 409 of file mrtk_clas.c.

References clas_bank_ctrl_t::BiasBank, CLAS_BANK_NUM, clas_bias_bank_t::network, clas_bias_bank_t::time, timediff(), and clas_bias_bank_t::use.

Referenced by add_base_value_to_cbias(), add_base_value_to_pbias(), set_cssr_bank_cbias(), and set_cssr_bank_pbias().

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

◆ get_same_clock()

clas_clock_bank_t * get_same_clock ( clas_bank_ctrl_t * bank,
gtime_t time,
int network )
static

Definition at line 398 of file mrtk_clas.c.

References CLAS_BANK_NUM, clas_bank_ctrl_t::ClockBank, clas_clock_bank_t::network, clas_clock_bank_t::time, timediff(), and clas_clock_bank_t::use.

Referenced by set_cssr_bank_clock().

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

◆ get_same_orbit()

clas_orbit_bank_t * get_same_orbit ( clas_bank_ctrl_t * bank,
gtime_t time,
int network )
static

Definition at line 387 of file mrtk_clas.c.

References CLAS_BANK_NUM, clas_orbit_bank_t::network, clas_bank_ctrl_t::OrbitBank, clas_orbit_bank_t::time, timediff(), and clas_orbit_bank_t::use.

Referenced by set_cssr_bank_orbit().

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

◆ get_same_trop()

clas_trop_bank_t * get_same_trop ( clas_bank_ctrl_t * bank,
gtime_t time )
static

Definition at line 420 of file mrtk_clas.c.

References CLAS_BANK_NUM, clas_trop_bank_t::time, timediff(), clas_bank_ctrl_t::TropBank, and clas_trop_bank_t::use.

Referenced by set_cssr_bank_trop().

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

◆ init_grid_index()

void init_grid_index ( clas_corr_t * corr)
static

Definition at line 992 of file mrtk_clas.c.

References CLAS_MAX_GP, stec_t::data, zwd_t::data, MAXSAT, stec_t::nmax, zwd_t::nmax, clas_corr_t::stec, clas_corr_t::stecdata, clas_corr_t::zwd, and clas_corr_t::zwddata.

Referenced by clas_backup_current(), clas_bank_get_close(), clas_clear_current(), and clas_restore_backup().

Here is the caller graph for this function:

◆ set_cssr_bank_cbias()

void set_cssr_bank_cbias ( clas_ctx_t * ctx,
int ch,
gtime_t time,
int network,
int iod )
static

Definition at line 723 of file mrtk_clas.c.

References clas_ctx_t::bank, clas_bias_bank_t::bflag, clas_bank_ctrl_t::BiasBank, clas_bias_bank_t::cbias, clas_dec_ssr_t::cbias, CLAS_BANK_NUM, clas_ctx_t::dec_ssr, get_bias_save_point(), get_same_bias(), clas_bias_bank_t::iod, clas_dec_ssr_t::iod, MAXCODE, MAXSAT, clas_bias_bank_t::network, clas_bank_ctrl_t::NextBias, clas_dec_ssr_t::nsig, clas_bias_bank_t::prn, clas_bias_bank_t::sflag, clas_bias_bank_t::smode, clas_dec_ssr_t::smode, clas_bias_bank_t::time, clas_bias_bank_t::udi, clas_dec_ssr_t::udi, clas_dec_ssr_t::update_cb, and clas_bias_bank_t::use.

Referenced by decode_cssr_bias(), and decode_cssr_cb().

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

◆ set_cssr_bank_clock()

void set_cssr_bank_clock ( clas_ctx_t * ctx,
int ch,
gtime_t time,
int network )
static

Definition at line 681 of file mrtk_clas.c.

References clas_ctx_t::bank, clas_clock_bank_t::c0, CLAS_BANK_NUM, clas_bank_ctrl_t::ClockBank, CSSR_INVALID_VALUE, clas_dec_ssr_t::dclk, clas_ctx_t::dec_ssr, get_same_clock(), clas_clock_bank_t::iod, clas_dec_ssr_t::iod, MAXSAT, clas_clock_bank_t::network, clas_bank_ctrl_t::NextClock, clas_clock_bank_t::prn, clas_clock_bank_t::time, clas_clock_bank_t::udi, clas_dec_ssr_t::udi, clas_dec_ssr_t::update_cc, and clas_clock_bank_t::use.

Referenced by decode_cssr_cc(), and decode_cssr_combo().

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

◆ set_cssr_bank_orbit()

void set_cssr_bank_orbit ( clas_ctx_t * ctx,
int ch,
gtime_t time,
int network )
static

Definition at line 634 of file mrtk_clas.c.

References clas_ctx_t::bank, CLAS_BANK_NUM, CSSR_INVALID_VALUE, clas_ctx_t::dec_ssr, clas_dec_ssr_t::deph, clas_orbit_bank_t::deph0, clas_orbit_bank_t::deph1, clas_orbit_bank_t::deph2, get_same_orbit(), clas_dec_ssr_t::iod, clas_orbit_bank_t::iod, clas_dec_ssr_t::iode, clas_orbit_bank_t::iode, MAXSAT, clas_orbit_bank_t::network, clas_bank_ctrl_t::NextOrbit, clas_bank_ctrl_t::OrbitBank, clas_orbit_bank_t::prn, clas_orbit_bank_t::time, clas_dec_ssr_t::udi, clas_orbit_bank_t::udi, clas_dec_ssr_t::update_oc, and clas_orbit_bank_t::use.

Referenced by decode_cssr_combo(), and decode_cssr_oc().

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

◆ set_cssr_bank_pbias()

void set_cssr_bank_pbias ( clas_ctx_t * ctx,
int ch,
gtime_t time,
int network,
int iod )
static

Definition at line 773 of file mrtk_clas.c.

References clas_ctx_t::bank, clas_bias_bank_t::bflag, clas_bank_ctrl_t::BiasBank, CLAS_BANK_NUM, clas_ctx_t::dec_ssr, get_bias_save_point(), get_same_bias(), clas_bias_bank_t::iod, clas_dec_ssr_t::iod, MAXCODE, MAXSAT, clas_bias_bank_t::network, clas_bank_ctrl_t::NextBias, clas_dec_ssr_t::nsig, clas_bias_bank_t::pbias, clas_dec_ssr_t::pbias, clas_bias_bank_t::prn, clas_bias_bank_t::sflag, clas_bias_bank_t::smode, clas_dec_ssr_t::smode, clas_bias_bank_t::time, clas_bias_bank_t::udi, clas_dec_ssr_t::udi, clas_dec_ssr_t::update_pb, and clas_bias_bank_t::use.

Referenced by decode_cssr_bias(), and decode_cssr_pb().

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

◆ set_cssr_bank_trop()

void set_cssr_bank_trop ( clas_ctx_t * ctx,
int ch,
gtime_t time,
ssrn_t * ssrn,
int network )
static

Definition at line 880 of file mrtk_clas.c.

References clas_ctx_t::bank, CLAS_BANK_NUM, CSSR_INVALID_VALUE, FREQ1, FREQ2, get_cssr_latest_iono(), get_cssr_latest_trop(), get_same_trop(), ssrn_t::grid, clas_trop_bank_t::gridnum, clas_trop_bank_t::gridpos, clas_trop_bank_t::iono, clas_bank_ctrl_t::NextTrop, ssrn_t::ngp, ssrn_t::nsat, clas_trop_bank_t::prn, ssrn_t::sat, clas_trop_bank_t::satnum, ssrn_t::stec, clas_trop_bank_t::time, clas_trop_bank_t::total, ssrn_t::trop_total, ssrn_t::trop_wet, clas_bank_ctrl_t::TropBank, clas_trop_bank_t::use, and clas_trop_bank_t::wet.

Referenced by decode_cssr_atmos(), and decode_cssr_grid().

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

◆ set_cssr_latest_trop()

void set_cssr_latest_trop ( clas_bank_ctrl_t * bank,
gtime_t time,
ssrn_t * ssrn,
int network )
static

◆ set_grid_data()

void set_grid_data ( clas_corr_t * corr,
double * pos,
int index )
static

Definition at line 1002 of file mrtk_clas.c.

References stec_t::n, zwd_t::n, stec_t::pos, zwd_t::pos, R2D, clas_corr_t::stec, and clas_corr_t::zwd.

Referenced by clas_bank_get_close().

Here is the caller graph for this function:

◆ sigmask2nsig()

int sigmask2nsig ( uint16_t sigmask)
static

Definition at line 220 of file mrtk_clas.c.

References CSSR_MAX_SIG.

Referenced by check_bit_width_mask(), and decode_cssr_mask().

Here is the caller graph for this function:

◆ sigmask2sig()

int sigmask2sig ( int nsat,
int * sat,
uint16_t * sigmask,
uint16_t * cellmask,
int * nsig,
int * sig )
static

Definition at line 316 of file mrtk_clas.c.

References CODE_L1B, CODE_L1C, CODE_L1L, CODE_L1P, CODE_L1S, CODE_L1W, CODE_L1X, CODE_L2C, CODE_L2I, CODE_L2L, CODE_L2P, CODE_L2Q, CODE_L2S, CODE_L2W, CODE_L2X, CODE_L3I, CODE_L3Q, CODE_L3X, CODE_L5I, CODE_L5Q, CODE_L5X, CODE_L6I, CODE_L6Q, CODE_L6X, CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L8I, CODE_L8Q, CODE_L8X, CSSR_MAX_SIG, cssr_sys2gnss(), satsys(), SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_QZS, and SYS_SBS.

Referenced by check_bit_width_bias(), check_bit_width_cb(), check_bit_width_pb(), decode_cssr_bias(), decode_cssr_cb(), and decode_cssr_pb().

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

◆ sigmask2sig_p()

int sigmask2sig_p ( int nsat,
int * sat,
uint16_t * sigmask,
uint16_t * cellmask,
int * nsig,
int * sig )
static

Definition at line 289 of file mrtk_clas.c.

References CSSR_MAX_SIG, cssr_sys2gnss(), and satsys().

Here is the call graph for this function:

◆ sub_get_close_cssr()

int sub_get_close_cssr ( clas_bank_ctrl_t * bank,
gtime_t time,
int network,
clas_orbit_bank_t ** orbit,
clas_clock_bank_t ** clock,
clas_bias_bank_t ** cbias,
clas_bias_bank_t ** pbias,
clas_trop_bank_t ** trop,
int * flag )
static

Definition at line 1046 of file mrtk_clas.c.

References add_base_value_to_cbias(), add_base_value_to_pbias(), clas_bank_ctrl_t::fastfix, get_close_clock(), get_close_net_cbias(), get_close_net_pbias(), get_close_orbit(), get_close_trop(), clas_bias_bank_t::time, gtime_t::time, timediff(), and trace().

Referenced by clas_bank_get_close().

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

◆ svmask2nsat()

int svmask2nsat ( uint64_t svmask)
static

Definition at line 210 of file mrtk_clas.c.

References CSSR_MAX_SV_GNSS.

Referenced by check_bit_width_mask().

Here is the caller graph for this function:

◆ svmask2nsatlist()

int svmask2nsatlist ( uint64_t svmask,
int id,
int * sat )
static

Definition at line 230 of file mrtk_clas.c.

References cssr_gnss2sys(), CSSR_MAX_SV_GNSS, and satno().

Referenced by decode_cssr_mask().

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

◆ svmask2sat()

int svmask2sat ( uint64_t * svmask,
int * sat )
static

Definition at line 241 of file mrtk_clas.c.

References cssr_gnss2sys(), CSSR_MAX_GNSS, CSSR_MAX_SV_GNSS, and satno().

Referenced by check_bit_width_atmos(), check_bit_width_bias(), check_bit_width_cb(), check_bit_width_cc(), check_bit_width_combo(), check_bit_width_grid(), check_bit_width_oc(), check_bit_width_pb(), check_bit_width_stec(), check_bit_width_ura(), decode_cssr_atmos(), decode_cssr_bias(), decode_cssr_cb(), decode_cssr_cc(), decode_cssr_combo(), decode_cssr_grid(), decode_cssr_oc(), decode_cssr_pb(), decode_cssr_stec(), and decode_cssr_ura().

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

Variable Documentation

◆ ssrudint

const double ssrudint[16] = {1, 2, 5, 10, 15, 30, 60, 120, 240, 300, 600, 900, 1800, 3600, 7200, 10800}
static