MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_madoca_iono.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_bits.h"
#include "mrtklib/mrtk_const.h"
#include "mrtklib/mrtk_l6.h"
#include "mrtklib/mrtk_nav.h"
#include "mrtklib/mrtk_ppp.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_madoca_iono.c:

Go to the source code of this file.

Classes

struct  miono_t

Macros

#define MIONO_MAX_FRAME   40 /* dependent on Length of Correction Messages */
#define MIONO_MT_COV   1 /* STEC Coverage Message Type */
#define MIONO_MT_COR   2 /* STEC Correction Message Type */
#define MIONO_MAX_SYS   5 /* GNSS ID (Table 6.3.2-8) */
#define MIONO_SYS_GPS   0
#define MIONO_SYS_GLO   1
#define MIONO_SYS_GAL   2
#define MIONO_SYS_BDS   3
#define MIONO_SYS_QZS   4
#define MIONO_INVALID_14BIT   -8192 /* Invalid Value (Table 6.3.2-9) */
#define MIONO_INVALID_12BIT   -2048
#define MIONO_INVALID_10BIT   -512
#define MIONO_INVALID_8BIT   -128
#define SQR(x)

Functions

int satsys (int sat, int *prn)
void satno2id (int sat, char *id)
int satno (int sys, int prn)
char * time_str (gtime_t t, int n)
double timediff (gtime_t t1, gtime_t t2)
double time2gpst (gtime_t t, int *week)
gtime_t gpst2time (int week, double sec)
gtime_t utc2gpst (gtime_t t)
gtime_t timeget (void)
static int gnssid2sys (int gnssid)
static void adjweek (gtime_t *gt, double tow)
static int decode_miono_coverage (miono_t *mi, miono_region_t *re, int i, int *imax, int *rid)
static int decode_miono_correction (miono_t *mi, miono_region_t *re, int i, int apply)
int decode_qzss_l6dmsg (mdcl6d_t *mdcl6d)
 Decode QZSS L6D message.
void init_miono (const gtime_t gt)
 Initialize MADOCA-PPP L6D ionospheric correction control.
int input_qzssl6d (mdcl6d_t *mdcl6d, const uint8_t data)
 Input QZSS L6D message byte-by-byte.
int input_qzssl6df (mdcl6d_t *mdcl6d, FILE *fp)
 Input QZSS L6D message from file.

Variables

static miono_t _miono [MIONO_MAX_PRN] = {{0}}

Macro Definition Documentation

◆ MIONO_INVALID_10BIT

#define MIONO_INVALID_10BIT   -512

Definition at line 69 of file mrtk_madoca_iono.c.

Referenced by decode_miono_correction().

◆ MIONO_INVALID_12BIT

#define MIONO_INVALID_12BIT   -2048

Definition at line 68 of file mrtk_madoca_iono.c.

Referenced by decode_miono_correction().

◆ MIONO_INVALID_14BIT

#define MIONO_INVALID_14BIT   -8192 /* Invalid Value (Table 6.3.2-9) */

Definition at line 67 of file mrtk_madoca_iono.c.

Referenced by decode_miono_correction().

◆ MIONO_INVALID_8BIT

#define MIONO_INVALID_8BIT   -128

Definition at line 70 of file mrtk_madoca_iono.c.

Referenced by decode_miono_correction().

◆ MIONO_MAX_FRAME

#define MIONO_MAX_FRAME   40 /* dependent on Length of Correction Messages */

Definition at line 55 of file mrtk_madoca_iono.c.

◆ MIONO_MAX_SYS

#define MIONO_MAX_SYS   5 /* GNSS ID (Table 6.3.2-8) */

Definition at line 60 of file mrtk_madoca_iono.c.

Referenced by decode_miono_correction().

◆ MIONO_MT_COR

#define MIONO_MT_COR   2 /* STEC Correction Message Type */

Definition at line 58 of file mrtk_madoca_iono.c.

Referenced by decode_qzss_l6dmsg().

◆ MIONO_MT_COV

#define MIONO_MT_COV   1 /* STEC Coverage Message Type */

Definition at line 57 of file mrtk_madoca_iono.c.

Referenced by decode_qzss_l6dmsg().

◆ MIONO_SYS_BDS

#define MIONO_SYS_BDS   3

Definition at line 64 of file mrtk_madoca_iono.c.

Referenced by gnssid2sys().

◆ MIONO_SYS_GAL

#define MIONO_SYS_GAL   2

Definition at line 63 of file mrtk_madoca_iono.c.

Referenced by gnssid2sys().

◆ MIONO_SYS_GLO

#define MIONO_SYS_GLO   1

Definition at line 62 of file mrtk_madoca_iono.c.

Referenced by gnssid2sys().

◆ MIONO_SYS_GPS

#define MIONO_SYS_GPS   0

Definition at line 61 of file mrtk_madoca_iono.c.

Referenced by gnssid2sys().

◆ MIONO_SYS_QZS

#define MIONO_SYS_QZS   4

Definition at line 65 of file mrtk_madoca_iono.c.

Referenced by decode_miono_correction(), and gnssid2sys().

◆ SQR

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

Definition at line 72 of file mrtk_madoca_iono.c.

Function Documentation

◆ adjweek()

void adjweek ( gtime_t * gt,
double tow )
static

Definition at line 106 of file mrtk_madoca_iono.c.

References gpst2time(), gtime_t::time, time2gpst(), timeget(), and utc2gpst().

Referenced by decode_miono_correction(), and decode_miono_coverage().

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

◆ decode_miono_correction()

int decode_miono_correction ( miono_t * mi,
miono_region_t * re,
int i,
int apply )
static

Definition at line 200 of file mrtk_madoca_iono.c.

References adjweek(), miono_region_t::area, miono_area_t::avalid, miono_t::buff, miono_sat_t::coef, miono_t::ep0, getbits(), getbitu(), gnssid2sys(), miono_t::gt, miono_t::iod, MIONO_INVALID_10BIT, MIONO_INVALID_12BIT, MIONO_INVALID_14BIT, MIONO_INVALID_8BIT, MIONO_MAX_SYS, MIONO_SYS_QZS, miono_area_t::sat, satno(), satno2id(), miono_sat_t::sqi, miono_sat_t::t0, time_str(), miono_t::tow0, trace(), and miono_area_t::type.

Referenced by decode_qzss_l6dmsg().

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

◆ decode_miono_coverage()

int decode_miono_coverage ( miono_t * mi,
miono_region_t * re,
int i,
int * imax,
int * rid )
static

Definition at line 124 of file mrtk_madoca_iono.c.

References adjweek(), miono_region_t::area, miono_t::buff, miono_t::ep0, getbits(), getbitu(), miono_t::gt, miono_t::iod, miono_region_t::narea, miono_region_t::ralert, miono_area_t::ref, miono_region_t::rvalid, miono_area_t::sid, miono_area_t::span, time_str(), miono_t::tow0, and trace().

Referenced by decode_qzss_l6dmsg().

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

◆ decode_qzss_l6dmsg()

int decode_qzss_l6dmsg ( mdcl6d_t * mdcl6d)
extern

Decode QZSS L6D message.

Parameters
[in,out]mdcl6dL6D message control struct
Returns
status (-1: error, 0: no message, 10: iono correction decoded)

Definition at line 322 of file mrtk_madoca_iono.c.

References _miono, l6_header_t::alert, l6_header_t::anme, l6_header_t::csid, decode_miono_correction(), decode_miono_coverage(), l6_header_t::fac, getbitu(), l6_prn_info_t::iono_slot, L6_DATA_BITS, L6_HEADER_BITS, l6_parse_header(), L6_PREAMBLE, l6_prn_info(), mdcl6d, MIONO_MT_COR, MIONO_MT_COV, l6_header_t::msgid, l6_header_t::preamble, l6_header_t::prn, l6_header_t::sf_ind, time_str(), trace(), and l6_header_t::vid.

Referenced by input_qzssl6d().

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

◆ gnssid2sys()

int gnssid2sys ( int gnssid)
static

Definition at line 89 of file mrtk_madoca_iono.c.

References MIONO_SYS_BDS, MIONO_SYS_GAL, MIONO_SYS_GLO, MIONO_SYS_GPS, MIONO_SYS_QZS, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, and SYS_QZS.

Referenced by decode_miono_correction().

Here is the caller graph for this function:

◆ gpst2time()

gtime_t gpst2time ( int week,
double sec )
extern

Definition at line 165 of file mrtk_time.c.

Referenced by adjweek().

Here is the caller graph for this function:

◆ init_miono()

void init_miono ( gtime_t gt)
extern

Initialize MADOCA-PPP L6D ionospheric correction control.

Parameters
[in]gtGPST for week number determination

Definition at line 513 of file mrtk_madoca_iono.c.

References _miono, and MIONO_MAX_PRN.

Referenced by decoderaw(), and init_mdcl6d().

Here is the caller graph for this function:

◆ input_qzssl6d()

int input_qzssl6d ( mdcl6d_t * mdcl6d,
uint8_t data )
extern

Input QZSS L6D message byte-by-byte.

Parameters
[in,out]mdcl6dL6D message control struct
[in]dataL6D 1-byte data
Returns
status (-1: error, 0: no message, 10: iono correction decoded)

Definition at line 532 of file mrtk_madoca_iono.c.

References decode_qzss_l6dmsg(), L6_FRAME_LEN, mdcl6d, and trace().

Referenced by decoderaw(), and input_qzssl6df().

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

◆ input_qzssl6df()

int input_qzssl6df ( mdcl6d_t * mdcl6d,
FILE * fp )
extern

Input QZSS L6D message from file.

Parameters
[in,out]mdcl6dL6D message control struct
[in]fpfile pointer
Returns
status (-2: EOF, -1..10: same as input_qzssl6d)

Definition at line 562 of file mrtk_madoca_iono.c.

References input_qzssl6d(), mdcl6d, and trace().

Referenced by update_qzssl6d().

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

◆ satno()

int satno ( int sys,
int prn )
extern

Definition at line 58 of file mrtk_nav.c.

Referenced by decode_miono_correction().

Here is the caller graph for this function:

◆ satno2id()

void satno2id ( int sat,
char * id )
extern

Definition at line 817 of file mrtk_nav.c.

Referenced by decode_miono_correction().

Here is the caller graph for this function:

◆ satsys()

int satsys ( int sat,
int * prn )
extern

Definition at line 117 of file mrtk_nav.c.

◆ time2gpst()

double time2gpst ( gtime_t t,
int * week )
extern

Definition at line 181 of file mrtk_time.c.

Referenced by adjweek().

Here is the caller graph for this function:

◆ time_str()

char * time_str ( gtime_t t,
int n )
extern

Definition at line 530 of file mrtk_time.c.

Referenced by decode_miono_correction(), decode_miono_coverage(), and decode_qzss_l6dmsg().

Here is the caller graph for this function:

◆ timediff()

double timediff ( gtime_t t1,
gtime_t t2 )
extern

Definition at line 279 of file mrtk_time.c.

◆ timeget()

gtime_t timeget ( void )
extern

Definition at line 289 of file mrtk_time.c.

Referenced by adjweek().

Here is the caller graph for this function:

◆ utc2gpst()

gtime_t utc2gpst ( gtime_t t)
extern

Definition at line 440 of file mrtk_time.c.

Referenced by adjweek().

Here is the caller graph for this function:

Variable Documentation

◆ _miono

miono_t _miono[MIONO_MAX_PRN] = {{0}}
static

Definition at line 86 of file mrtk_madoca_iono.c.

Referenced by decode_qzss_l6dmsg(), and init_miono().