MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_rcv_binex.c File Reference
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_bits.h"
#include "mrtklib/mrtk_coords.h"
#include "mrtklib/mrtk_eph.h"
#include "mrtklib/mrtk_mat.h"
#include "mrtklib/mrtk_nav.h"
#include "mrtklib/mrtk_obs.h"
#include "mrtklib/mrtk_opt.h"
#include "mrtklib/mrtk_rcvraw.h"
#include "mrtklib/mrtk_rtcm.h"
#include "mrtklib/mrtk_sys.h"
#include "mrtklib/mrtk_time.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_rcv_binex.c:

Go to the source code of this file.

Macros

#define PI   3.1415926535897932 /* pi */
#define D2R   (PI / 180.0) /* deg to rad */
#define R2D   (180.0 / PI) /* rad to deg */
#define CLIGHT   299792458.0 /* speed of light (m/s) */
#define SC2RAD   3.1415926535898 /* semi-circle to radian (IS-GPS) */
#define SYS_NONE   0x00
#define SYS_GPS   0x01
#define SYS_SBS   0x02
#define SYS_GLO   0x04
#define SYS_GAL   0x08
#define SYS_QZS   0x10
#define SYS_CMP   0x20
#define SYS_IRN   0x40
#define TSYS_GPS   0
#define TSYS_UTC   1
#define TSYS_GLO   2
#define TSYS_GAL   3
#define TSYS_QZS   4
#define TSYS_CMP   5
#define TSYS_IRN   6
#define FREQ1   1.57542E9 /* L1/E1/B1C frequency (Hz) */
#define FREQ2   1.22760E9 /* L2 frequency (Hz) */
#define FREQ5   1.17645E9 /* L5/E5a/B2a frequency (Hz) */
#define FREQ6   1.27875E9 /* E6/L6 frequency (Hz) */
#define FREQ7   1.20714E9 /* E5b/B2I frequency (Hz) */
#define FREQ8   1.191795E9 /* E5ab/B2ab frequency (Hz) */
#define FREQ9   2.492028E9 /* S frequency (Hz) */
#define FREQ1_GLO   1.60200E9 /* GLONASS G1 base frequency (Hz) */
#define DFRQ1_GLO   0.56250E6 /* GLONASS G1 bias frequency (Hz/n) */
#define FREQ2_GLO   1.24600E9 /* GLONASS G2 base frequency (Hz) */
#define DFRQ2_GLO   0.43750E6 /* GLONASS G2 bias frequency (Hz/n) */
#define FREQ3_GLO   1.202025E9 /* GLONASS G3 frequency (Hz) */
#define FREQ1a_GLO   1.600995E9 /* GLONASS G1a frequency (Hz) */
#define FREQ2a_GLO   1.248060E9 /* GLONASS G2a frequency (Hz) */
#define FREQ1_CMP   1.561098E9 /* BDS B1I frequency (Hz) */
#define MINPRNGPS   1
#define MAXPRNGPS   32
#define MINPRNSBS   120
#define MAXPRNSBS   158
#define P2_5   0.03125
#define P2_6   0.015625
#define P2_11   4.882812500000000E-04
#define P2_15   3.051757812500000E-05
#define P2_17   7.629394531250000E-06
#define P2_19   1.907348632812500E-06
#define P2_20   9.536743164062500E-07
#define P2_21   4.768371582031250E-07
#define P2_23   1.192092895507810E-07
#define P2_24   5.960464477539063E-08
#define P2_27   7.450580596923828E-09
#define P2_29   1.862645149230957E-09
#define P2_30   9.313225746154785E-10
#define P2_31   4.656612873077393E-10
#define P2_32   2.328306436538696E-10
#define P2_33   1.164153218269348E-10
#define P2_34   5.820766091346740E-11
#define P2_35   2.910383045673370E-11
#define P2_38   3.637978807091710E-12
#define P2_40   9.094947017729280E-13
#define P2_43   1.136868377216160E-13
#define P2_46   1.421085471520200E-14
#define P2_50   8.881784197001252E-16
#define P2_55   2.775557561562891E-17
#define P2_59   1.734723475976810E-18
#define BNXSYNC1   0xC2 /* BINEX sync (little-endian,regular-crc) */
#define BNXSYNC2   0xE2 /* BINEX sync (big-endian ,regular-crc) */
#define BNXSYNC3   0xC8 /* BINEX sync (little-endian,enhanced-crc) */
#define BNXSYNC4   0xE8 /* BINEX sync (big-endian ,enhanced-crc) */
#define BNXSYNC1R   0xD2 /* BINEX sync (little-endian,regular-crc,rev) */
#define BNXSYNC2R   0xF2 /* BINEX sync (big-endian ,regular-crc,rev) */
#define BNXSYNC3R   0xD8 /* BINEX sync (little-endian,enhanced-crc,rev) */
#define BNXSYNC4R   0xF8 /* BINEX sync (big-endian ,enhanced-crc,rev) */
#define MIN(x, y)
#define SQR(x)
#define U1(p)
#define I1(p)
#define NINCOBS   262144 /* incremental number of obs data */

Functions

static uint16_t U2 (uint8_t *p)
static uint32_t U4 (uint8_t *p)
static int32_t I4 (uint8_t *p)
static float R4 (uint8_t *p)
static double R8 (uint8_t *p)
static int getbnxi (uint8_t *p, uint32_t *val)
static uint8_t csum8 (const uint8_t *buff, int len)
static gtime_t adjweek (gtime_t time, double tow)
static gtime_t adjday (gtime_t time, double tod)
static int uraindex (double value)
static int sisaindex (double value)
static int decode_bnx_00 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01_00 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01_01 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01_02 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01_03 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01_04 (raw_t *raw, uint8_t *buff, int len)
static double bds_tgd (int tgd)
static int decode_bnx_01_05 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01_06 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01_07 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01_14 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_01 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_02 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_03 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_7d (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_7e (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_7f_00 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_7f_01 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_7f_02 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_7f_03 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_7f_04 (raw_t *raw, uint8_t *buff, int len)
static uint8_t * decode_bnx_7f_05_obs (raw_t *raw, uint8_t *buff, int sat, int nobs, obsd_t *data)
static int decode_bnx_7f_05 (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx_7f (raw_t *raw, uint8_t *buff, int len)
static int decode_bnx (raw_t *raw)
static int sync_bnx (uint8_t *buff, uint8_t data)
int input_bnx (raw_t *raw, uint8_t data)
int input_bnxf (raw_t *raw, FILE *fp)
static void setstr_bnx (char *dst, const char *src, int n)
static void saveslips (unsigned char slips[][5], obsd_t *data)
static void restslips (unsigned char slips[][5], obsd_t *data)
static int addobsdata (obs_t *obs, const obsd_t *data)
static int add_eph (nav_t *nav, const eph_t *eph)
static int add_geph (nav_t *nav, const geph_t *geph)
static int add_seph (nav_t *nav, const seph_t *seph)
static int readbnxfp (FILE *fp, gtime_t ts, gtime_t te, double tint, const char *opt, int flag, int index, char *type, obs_t *obs, nav_t *nav, sta_t *sta, const prcopt_t *popt)
static int readbnxfile (const char *file, gtime_t ts, gtime_t te, double tint, const char *opt, int flag, int index, char *type, obs_t *obs, nav_t *nav, sta_t *sta, const prcopt_t *popt)
int readbnxt (const char *file, int rcv, gtime_t ts, gtime_t te, double tint, const char *opt, obs_t *obs, nav_t *nav, sta_t *sta, const prcopt_t *popt)
 Read BINEX observation/navigation data from file(s).

Variables

static const double ura_eph []

Macro Definition Documentation

◆ BNXSYNC1

#define BNXSYNC1   0xC2 /* BINEX sync (little-endian,regular-crc) */

Definition at line 109 of file mrtk_rcv_binex.c.

◆ BNXSYNC1R

#define BNXSYNC1R   0xD2 /* BINEX sync (little-endian,regular-crc,rev) */

Definition at line 114 of file mrtk_rcv_binex.c.

◆ BNXSYNC2

#define BNXSYNC2   0xE2 /* BINEX sync (big-endian ,regular-crc) */

Definition at line 110 of file mrtk_rcv_binex.c.

Referenced by sync_bnx().

◆ BNXSYNC2R

#define BNXSYNC2R   0xF2 /* BINEX sync (big-endian ,regular-crc,rev) */

Definition at line 115 of file mrtk_rcv_binex.c.

◆ BNXSYNC3

#define BNXSYNC3   0xC8 /* BINEX sync (little-endian,enhanced-crc) */

Definition at line 111 of file mrtk_rcv_binex.c.

◆ BNXSYNC3R

#define BNXSYNC3R   0xD8 /* BINEX sync (little-endian,enhanced-crc,rev) */

Definition at line 116 of file mrtk_rcv_binex.c.

◆ BNXSYNC4

#define BNXSYNC4   0xE8 /* BINEX sync (big-endian ,enhanced-crc) */

Definition at line 112 of file mrtk_rcv_binex.c.

◆ BNXSYNC4R

#define BNXSYNC4R   0xF8 /* BINEX sync (big-endian ,enhanced-crc,rev) */

Definition at line 117 of file mrtk_rcv_binex.c.

◆ CLIGHT

#define CLIGHT   299792458.0 /* speed of light (m/s) */

Definition at line 39 of file mrtk_rcv_binex.c.

◆ D2R

#define D2R   (PI / 180.0) /* deg to rad */

Definition at line 37 of file mrtk_rcv_binex.c.

◆ DFRQ1_GLO

#define DFRQ1_GLO   0.56250E6 /* GLONASS G1 bias frequency (Hz/n) */

Definition at line 67 of file mrtk_rcv_binex.c.

◆ DFRQ2_GLO

#define DFRQ2_GLO   0.43750E6 /* GLONASS G2 bias frequency (Hz/n) */

Definition at line 69 of file mrtk_rcv_binex.c.

◆ FREQ1

#define FREQ1   1.57542E9 /* L1/E1/B1C frequency (Hz) */

Definition at line 59 of file mrtk_rcv_binex.c.

◆ FREQ1_CMP

#define FREQ1_CMP   1.561098E9 /* BDS B1I frequency (Hz) */

Definition at line 73 of file mrtk_rcv_binex.c.

◆ FREQ1_GLO

#define FREQ1_GLO   1.60200E9 /* GLONASS G1 base frequency (Hz) */

Definition at line 66 of file mrtk_rcv_binex.c.

◆ FREQ1a_GLO

#define FREQ1a_GLO   1.600995E9 /* GLONASS G1a frequency (Hz) */

Definition at line 71 of file mrtk_rcv_binex.c.

◆ FREQ2

#define FREQ2   1.22760E9 /* L2 frequency (Hz) */

Definition at line 60 of file mrtk_rcv_binex.c.

◆ FREQ2_GLO

#define FREQ2_GLO   1.24600E9 /* GLONASS G2 base frequency (Hz) */

Definition at line 68 of file mrtk_rcv_binex.c.

◆ FREQ2a_GLO

#define FREQ2a_GLO   1.248060E9 /* GLONASS G2a frequency (Hz) */

Definition at line 72 of file mrtk_rcv_binex.c.

◆ FREQ3_GLO

#define FREQ3_GLO   1.202025E9 /* GLONASS G3 frequency (Hz) */

Definition at line 70 of file mrtk_rcv_binex.c.

◆ FREQ5

#define FREQ5   1.17645E9 /* L5/E5a/B2a frequency (Hz) */

Definition at line 61 of file mrtk_rcv_binex.c.

◆ FREQ6

#define FREQ6   1.27875E9 /* E6/L6 frequency (Hz) */

Definition at line 62 of file mrtk_rcv_binex.c.

◆ FREQ7

#define FREQ7   1.20714E9 /* E5b/B2I frequency (Hz) */

Definition at line 63 of file mrtk_rcv_binex.c.

◆ FREQ8

#define FREQ8   1.191795E9 /* E5ab/B2ab frequency (Hz) */

Definition at line 64 of file mrtk_rcv_binex.c.

◆ FREQ9

#define FREQ9   2.492028E9 /* S frequency (Hz) */

Definition at line 65 of file mrtk_rcv_binex.c.

◆ I1

#define I1 ( p)
Value:
(*((int8_t*)(p)))

Definition at line 127 of file mrtk_rcv_binex.c.

Referenced by decode_bnx_01_02().

◆ MAXPRNGPS

#define MAXPRNGPS   32

◆ MAXPRNSBS

#define MAXPRNSBS   158

◆ MIN

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

Definition at line 119 of file mrtk_rcv_binex.c.

Referenced by decode_bnx_00().

◆ MINPRNGPS

#define MINPRNGPS   1

◆ MINPRNSBS

◆ NINCOBS

#define NINCOBS   262144 /* incremental number of obs data */

Definition at line 1648 of file mrtk_rcv_binex.c.

◆ P2_11

#define P2_11   4.882812500000000E-04

Definition at line 83 of file mrtk_rcv_binex.c.

◆ P2_15

#define P2_15   3.051757812500000E-05

Definition at line 84 of file mrtk_rcv_binex.c.

◆ P2_17

#define P2_17   7.629394531250000E-06

Definition at line 85 of file mrtk_rcv_binex.c.

◆ P2_19

#define P2_19   1.907348632812500E-06

Definition at line 86 of file mrtk_rcv_binex.c.

◆ P2_20

#define P2_20   9.536743164062500E-07

Definition at line 87 of file mrtk_rcv_binex.c.

◆ P2_21

#define P2_21   4.768371582031250E-07

Definition at line 88 of file mrtk_rcv_binex.c.

◆ P2_23

#define P2_23   1.192092895507810E-07

Definition at line 89 of file mrtk_rcv_binex.c.

◆ P2_24

#define P2_24   5.960464477539063E-08

Definition at line 90 of file mrtk_rcv_binex.c.

◆ P2_27

#define P2_27   7.450580596923828E-09

Definition at line 91 of file mrtk_rcv_binex.c.

◆ P2_29

#define P2_29   1.862645149230957E-09

Definition at line 92 of file mrtk_rcv_binex.c.

◆ P2_30

#define P2_30   9.313225746154785E-10

Definition at line 93 of file mrtk_rcv_binex.c.

◆ P2_31

#define P2_31   4.656612873077393E-10

Definition at line 94 of file mrtk_rcv_binex.c.

◆ P2_32

#define P2_32   2.328306436538696E-10

Definition at line 95 of file mrtk_rcv_binex.c.

◆ P2_33

#define P2_33   1.164153218269348E-10

Definition at line 96 of file mrtk_rcv_binex.c.

◆ P2_34

#define P2_34   5.820766091346740E-11

Definition at line 97 of file mrtk_rcv_binex.c.

◆ P2_35

#define P2_35   2.910383045673370E-11

Definition at line 98 of file mrtk_rcv_binex.c.

◆ P2_38

#define P2_38   3.637978807091710E-12

Definition at line 99 of file mrtk_rcv_binex.c.

◆ P2_40

#define P2_40   9.094947017729280E-13

Definition at line 100 of file mrtk_rcv_binex.c.

◆ P2_43

#define P2_43   1.136868377216160E-13

Definition at line 101 of file mrtk_rcv_binex.c.

◆ P2_46

#define P2_46   1.421085471520200E-14

Definition at line 102 of file mrtk_rcv_binex.c.

◆ P2_5

#define P2_5   0.03125

Definition at line 81 of file mrtk_rcv_binex.c.

◆ P2_50

#define P2_50   8.881784197001252E-16

Definition at line 103 of file mrtk_rcv_binex.c.

◆ P2_55

#define P2_55   2.775557561562891E-17

Definition at line 104 of file mrtk_rcv_binex.c.

◆ P2_59

#define P2_59   1.734723475976810E-18

Definition at line 105 of file mrtk_rcv_binex.c.

◆ P2_6

#define P2_6   0.015625

Definition at line 82 of file mrtk_rcv_binex.c.

◆ PI

#define PI   3.1415926535897932 /* pi */

Definition at line 36 of file mrtk_rcv_binex.c.

◆ R2D

#define R2D   (180.0 / PI) /* rad to deg */

Definition at line 38 of file mrtk_rcv_binex.c.

◆ SC2RAD

#define SC2RAD   3.1415926535898 /* semi-circle to radian (IS-GPS) */

Definition at line 40 of file mrtk_rcv_binex.c.

◆ SQR

#define SQR ( x)

◆ SYS_CMP

#define SYS_CMP   0x20

Definition at line 48 of file mrtk_rcv_binex.c.

◆ SYS_GAL

#define SYS_GAL   0x08

Definition at line 46 of file mrtk_rcv_binex.c.

◆ SYS_GLO

#define SYS_GLO   0x04

Definition at line 45 of file mrtk_rcv_binex.c.

◆ SYS_GPS

#define SYS_GPS   0x01

Definition at line 43 of file mrtk_rcv_binex.c.

◆ SYS_IRN

#define SYS_IRN   0x40

Definition at line 49 of file mrtk_rcv_binex.c.

◆ SYS_NONE

#define SYS_NONE   0x00

Definition at line 42 of file mrtk_rcv_binex.c.

◆ SYS_QZS

#define SYS_QZS   0x10

Definition at line 47 of file mrtk_rcv_binex.c.

◆ SYS_SBS

#define SYS_SBS   0x02

Definition at line 44 of file mrtk_rcv_binex.c.

◆ TSYS_CMP

#define TSYS_CMP   5

Definition at line 56 of file mrtk_rcv_binex.c.

◆ TSYS_GAL

#define TSYS_GAL   3

Definition at line 54 of file mrtk_rcv_binex.c.

◆ TSYS_GLO

#define TSYS_GLO   2

Definition at line 53 of file mrtk_rcv_binex.c.

◆ TSYS_GPS

#define TSYS_GPS   0

Definition at line 51 of file mrtk_rcv_binex.c.

◆ TSYS_IRN

#define TSYS_IRN   6

Definition at line 57 of file mrtk_rcv_binex.c.

◆ TSYS_QZS

#define TSYS_QZS   4

Definition at line 55 of file mrtk_rcv_binex.c.

◆ TSYS_UTC

#define TSYS_UTC   1

Definition at line 52 of file mrtk_rcv_binex.c.

◆ U1

Function Documentation

◆ add_eph()

int add_eph ( nav_t * nav,
const eph_t * eph )
static

Definition at line 1704 of file mrtk_rcv_binex.c.

References nav_s::eph, free, nav_s::n, nav_s::nmax, and trace().

Referenced by readbnxfp().

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

◆ add_geph()

int add_geph ( nav_t * nav,
const geph_t * geph )
static

Definition at line 1722 of file mrtk_rcv_binex.c.

References free, nav_s::geph, nav_s::ng, nav_s::ngmax, and trace().

Referenced by readbnxfp().

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

◆ add_seph()

int add_seph ( nav_t * nav,
const seph_t * seph )
static

Definition at line 1740 of file mrtk_rcv_binex.c.

References free, nav_s::ns, nav_s::nsmax, nav_s::seph, and trace().

Referenced by readbnxfp().

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

◆ addobsdata()

int addobsdata ( obs_t * obs,
const obsd_t * data )
static

Definition at line 1682 of file mrtk_rcv_binex.c.

References obs_t::data, free, obs_t::n, NINCOBS, obs_t::nmax, and trace().

Referenced by readbnxfp().

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

◆ adjday()

gtime_t adjday ( gtime_t time,
double tod )
static

Definition at line 202 of file mrtk_rcv_binex.c.

References epoch2time(), time2epoch(), and timeadd().

Referenced by decode_bnx_01_02().

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

◆ adjweek()

gtime_t adjweek ( gtime_t time,
double tow )
static

Definition at line 190 of file mrtk_rcv_binex.c.

References gpst2time(), and time2gpst().

Referenced by decode_bnx_01_01(), decode_bnx_01_03(), decode_bnx_01_04(), decode_bnx_01_05(), decode_bnx_01_06(), decode_bnx_01_07(), and decode_bnx_01_14().

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

◆ bds_tgd()

double bds_tgd ( int tgd)
static

Definition at line 676 of file mrtk_rcv_binex.c.

Referenced by decode_bnx_01_05().

Here is the caller graph for this function:

◆ csum8()

uint8_t csum8 ( const uint8_t * buff,
int len )
static

Definition at line 180 of file mrtk_rcv_binex.c.

Referenced by decode_bnx().

Here is the caller graph for this function:

◆ decode_bnx()

int decode_bnx ( raw_t * raw)
static

Definition at line 1469 of file mrtk_rcv_binex.c.

References raw_t::buff, csum8(), decode_bnx_00(), decode_bnx_01(), decode_bnx_02(), decode_bnx_03(), decode_bnx_7d(), decode_bnx_7e(), decode_bnx_7f(), getbnxi(), raw_t::len, raw_t::msgtype, raw_t::outtype, rtk_crc16(), trace(), U1, and U2.

Referenced by input_bnx(), input_bnxf(), and readbnxfp().

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

◆ decode_bnx_00()

int decode_bnx_00 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 241 of file mrtk_rcv_binex.c.

References sta_t::antdes, sta_t::antsno, D2R, sta_t::del, sta_t::deltype, epoch2time(), getbnxi(), gpst0, sta_t::marker, matcpy(), MAXANT, MIN, raw_t::msgtype, sta_t::name, raw_t::outtype, sta_t::pos, pos2ecef(), R8, sta_t::recsno, sta_t::rectype, sta_t::recver, raw_t::sta, raw_t::time, time_str(), timeadd(), trace(), U1, and U4.

Referenced by decode_bnx().

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

◆ decode_bnx_01()

int decode_bnx_01 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1066 of file mrtk_rcv_binex.c.

References decode_bnx_01_00(), decode_bnx_01_01(), decode_bnx_01_02(), decode_bnx_01_03(), decode_bnx_01_04(), decode_bnx_01_05(), decode_bnx_01_06(), decode_bnx_01_07(), decode_bnx_01_14(), raw_t::msgtype, raw_t::outtype, and U1.

Referenced by decode_bnx().

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

◆ decode_bnx_01_00()

int decode_bnx_01_00 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 323 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx_01().

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

◆ decode_bnx_01_01()

int decode_bnx_01_01 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 328 of file mrtk_rcv_binex.c.

References eph_t::A, adjweek(), eph_t::cic, eph_t::cis, eph_t::code, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, eph_t::e, nav_s::eph, raw_t::ephsat, raw_t::ephset, eph_t::f0, eph_t::f1, eph_t::f2, eph_t::fit, eph_t::flag, gpst2time(), eph_t::i0, I4, eph_t::idot, eph_t::iodc, eph_t::iode, eph_t::M0, raw_t::nav, eph_t::omg, eph_t::OMG0, eph_t::OMGd, raw_t::opt, R4, R8, eph_t::sat, satno(), SC2RAD, SQR, eph_t::sva, eph_t::svh, SYS_GPS, eph_t::tgd, eph_t::toc, eph_t::toe, eph_t::toes, trace(), eph_t::ttr, eph_t::type, U1, U2, uraindex(), and eph_t::week.

Referenced by decode_bnx_01().

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

◆ decode_bnx_01_02()

int decode_bnx_01_02 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 422 of file mrtk_rcv_binex.c.

References geph_t::acc, adjday(), geph_t::age, geph_t::dtaun, raw_t::ephsat, raw_t::ephset, geph_t::frq, geph_t::gamn, nav_s::geph, I1, geph_t::iode, MINPRNGLO, raw_t::nav, raw_t::opt, geph_t::pos, R8, geph_t::sat, satno(), geph_t::svh, SYS_GLO, geph_t::taun, gtime_t::time, raw_t::time, timediff(), geph_t::toe, geph_t::tof, trace(), U1, U2, U4, utc2gpst(), and geph_t::vel.

Referenced by decode_bnx_01().

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

◆ decode_bnx_01_03()

int decode_bnx_01_03 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 500 of file mrtk_rcv_binex.c.

References seph_t::acc, adjweek(), seph_t::af0, raw_t::ephsat, raw_t::ephset, gpst2time(), MINPRNSBS, raw_t::nav, raw_t::opt, seph_t::pos, R4, R8, seph_t::sat, satno(), nav_s::seph, seph_t::sva, seph_t::svh, SYS_SBS, seph_t::t0, timediff(), seph_t::tof, trace(), U1, U2, U4, and seph_t::vel.

Referenced by decode_bnx_01().

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

◆ decode_bnx_01_04()

int decode_bnx_01_04 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 568 of file mrtk_rcv_binex.c.

References eph_t::A, adjweek(), eph_t::cic, eph_t::cis, eph_t::code, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, eph_t::e, nav_s::eph, eph_sel, raw_t::ephsat, raw_t::ephset, eph_t::f0, eph_t::f1, eph_t::f2, gpst2time(), eph_t::i0, I4, eph_t::idot, eph_t::iodc, eph_t::iode, eph_t::M0, MAXSAT, raw_t::nav, eph_t::omg, eph_t::OMG0, eph_t::OMGd, raw_t::opt, R4, R8, eph_t::sat, satno(), SC2RAD, sisaindex(), SQR, eph_t::sva, eph_t::svh, SYS_GAL, eph_t::tgd, timediff(), eph_t::toc, eph_t::toe, eph_t::toes, trace(), eph_t::ttr, eph_t::type, U1, U2, and eph_t::week.

Referenced by decode_bnx_01().

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

◆ decode_bnx_01_05()

int decode_bnx_01_05 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 681 of file mrtk_rcv_binex.c.

References eph_t::A, adjweek(), bds_tgd(), eph_t::cic, eph_t::cis, eph_t::code, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, eph_t::e, nav_s::eph, raw_t::ephsat, raw_t::ephset, eph_t::f0, eph_t::f1, eph_t::f2, eph_t::flag, gpst2time(), eph_t::i0, I4, eph_t::idot, eph_t::iodc, eph_t::iode, eph_t::M0, raw_t::nav, eph_t::omg, eph_t::OMG0, eph_t::OMGd, raw_t::opt, R4, R8, eph_t::sat, satno(), SC2RAD, SQR, eph_t::sva, eph_t::svh, SYS_CMP, eph_t::tgd, timediff(), eph_t::toc, eph_t::toe, eph_t::toes, trace(), eph_t::ttr, eph_t::type, U1, U2, U4, and eph_t::week.

Referenced by decode_bnx_01().

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

◆ decode_bnx_01_06()

int decode_bnx_01_06 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 774 of file mrtk_rcv_binex.c.

References eph_t::A, adjweek(), eph_t::cic, eph_t::cis, eph_t::code, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, eph_t::e, nav_s::eph, raw_t::ephsat, raw_t::ephset, eph_t::f0, eph_t::f1, eph_t::f2, eph_t::fit, gpst2time(), eph_t::i0, I4, eph_t::idot, eph_t::iodc, eph_t::iode, eph_t::M0, raw_t::nav, eph_t::omg, eph_t::OMG0, eph_t::OMGd, raw_t::opt, R4, R8, eph_t::sat, satno(), SC2RAD, SQR, eph_t::sva, eph_t::svh, SYS_QZS, eph_t::tgd, eph_t::toc, eph_t::toe, eph_t::toes, trace(), eph_t::ttr, eph_t::type, U1, U2, uraindex(), and eph_t::week.

Referenced by decode_bnx_01().

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

◆ decode_bnx_01_07()

int decode_bnx_01_07 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 867 of file mrtk_rcv_binex.c.

References eph_t::A, adjweek(), eph_t::cic, eph_t::cis, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, eph_t::e, nav_s::eph, raw_t::ephsat, raw_t::ephset, eph_t::f0, eph_t::f1, eph_t::f2, gpst2time(), eph_t::i0, I4, eph_t::idot, eph_t::iodc, eph_t::iode, eph_t::M0, raw_t::nav, eph_t::omg, eph_t::OMG0, eph_t::OMGd, raw_t::opt, P2_31, R4, R8, eph_t::sat, satno(), SC2RAD, SQR, eph_t::sva, eph_t::svh, SYS_IRN, eph_t::tgd, timediff(), eph_t::toc, eph_t::toe, eph_t::toes, trace(), eph_t::ttr, eph_t::type, U1, U2, and eph_t::week.

Referenced by decode_bnx_01().

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

◆ decode_bnx_01_14()

int decode_bnx_01_14 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 956 of file mrtk_rcv_binex.c.

References eph_t::A, adjweek(), eph_t::cic, eph_t::cis, eph_t::code, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, eph_t::e, nav_s::eph, eph_sel, raw_t::ephsat, raw_t::ephset, eph_t::f0, eph_t::f1, eph_t::f2, gpst2time(), eph_t::i0, I4, eph_t::idot, eph_t::iodc, eph_t::iode, eph_t::M0, MAXSAT, raw_t::nav, eph_t::omg, eph_t::OMG0, eph_t::OMGd, raw_t::opt, R4, R8, eph_t::sat, satno(), SC2RAD, sisaindex(), SQR, eph_t::sva, eph_t::svh, SYS_GAL, eph_t::tgd, timediff(), eph_t::toc, eph_t::toe, eph_t::toes, trace(), eph_t::ttr, eph_t::type, U1, U2, and eph_t::week.

Referenced by decode_bnx_01().

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

◆ decode_bnx_02()

int decode_bnx_02 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1096 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx().

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

◆ decode_bnx_03()

int decode_bnx_03 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1101 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx().

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

◆ decode_bnx_7d()

int decode_bnx_7d ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1106 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx().

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

◆ decode_bnx_7e()

int decode_bnx_7e ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1111 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx().

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

◆ decode_bnx_7f()

int decode_bnx_7f ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1433 of file mrtk_rcv_binex.c.

References decode_bnx_7f_00(), decode_bnx_7f_01(), decode_bnx_7f_02(), decode_bnx_7f_03(), decode_bnx_7f_04(), decode_bnx_7f_05(), epoch2time(), gpst0, raw_t::msgtype, raw_t::outtype, raw_t::time, time_str(), timeadd(), U1, U2, and U4.

Referenced by decode_bnx().

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

◆ decode_bnx_7f_00()

int decode_bnx_7f_00 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1116 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx_7f().

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

◆ decode_bnx_7f_01()

int decode_bnx_7f_01 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1121 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx_7f().

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

◆ decode_bnx_7f_02()

int decode_bnx_7f_02 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1126 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx_7f().

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

◆ decode_bnx_7f_03()

int decode_bnx_7f_03 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1131 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx_7f().

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

◆ decode_bnx_7f_04()

int decode_bnx_7f_04 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1136 of file mrtk_rcv_binex.c.

References trace().

Referenced by decode_bnx_7f().

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

◆ decode_bnx_7f_05()

int decode_bnx_7f_05 ( raw_t * raw,
uint8_t * buff,
int len )
static

Definition at line 1349 of file mrtk_rcv_binex.c.

References obs_t::data, decode_bnx_7f_05_obs(), getbits(), getbitu(), MAXOBS, raw_t::msgtype, obs_t::n, raw_t::obs, raw_t::outtype, obsd_t::sat, satno(), SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, SYS_SBS, trace(), and U1.

Referenced by decode_bnx_7f().

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

◆ decode_bnx_7f_05_obs()

uint8_t * decode_bnx_7f_05_obs ( raw_t * raw,
uint8_t * buff,
int sat,
int nobs,
obsd_t * data )
static

◆ getbnxi()

int getbnxi ( uint8_t * p,
uint32_t * val )
static

Definition at line 167 of file mrtk_rcv_binex.c.

Referenced by decode_bnx(), decode_bnx_00(), input_bnx(), input_bnxf(), and readbnxfp().

Here is the caller graph for this function:

◆ I4()

int32_t I4 ( uint8_t * p)
static

Definition at line 147 of file mrtk_rcv_binex.c.

References U4.

◆ input_bnx()

int input_bnx ( raw_t * raw,
uint8_t data )
extern

Definition at line 1555 of file mrtk_rcv_binex.c.

References raw_t::buff, decode_bnx(), getbnxi(), raw_t::len, raw_t::nbyte, sync_bnx(), and trace().

Referenced by input_raw().

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

◆ input_bnxf()

int input_bnxf ( raw_t * raw,
FILE * fp )
extern

Definition at line 1599 of file mrtk_rcv_binex.c.

References raw_t::buff, decode_bnx(), getbnxi(), raw_t::len, raw_t::nbyte, sync_bnx(), and trace().

Referenced by input_rawf().

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

◆ R4()

float R4 ( uint8_t * p)
static

Definition at line 148 of file mrtk_rcv_binex.c.

◆ R8()

double R8 ( uint8_t * p)
static

Definition at line 157 of file mrtk_rcv_binex.c.

◆ readbnxfile()

int readbnxfile ( const char * file,
gtime_t ts,
gtime_t te,
double tint,
const char * opt,
int flag,
int index,
char * type,
obs_t * obs,
nav_t * nav,
sta_t * sta,
const prcopt_t * popt )
static

Definition at line 1857 of file mrtk_rcv_binex.c.

References sta_t::antdes, sta_t::antsetup, sta_t::antsno, sta_t::deltype, sta_t::hgt, sta_t::itrf, sta_t::marker, sta_t::name, readbnxfp(), sta_t::recsno, sta_t::rectype, sta_t::recver, rtk_uncompress(), and trace().

Referenced by readbnxt().

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

◆ readbnxfp()

int readbnxfp ( FILE * fp,
gtime_t ts,
gtime_t te,
double tint,
const char * opt,
int flag,
int index,
char * type,
obs_t * obs,
nav_t * nav,
sta_t * sta,
const prcopt_t * popt )
static

Definition at line 1758 of file mrtk_rcv_binex.c.

References add_eph(), add_geph(), add_seph(), addobsdata(), raw_t::buff, obs_t::data, decode_bnx(), nav_s::eph, raw_t::ephsat, free_raw(), nav_s::geph, getbnxi(), init_raw(), raw_t::len, MAXSAT, MINPRNSBS, obs_t::n, raw_t::nav, prcopt_t::navsys, raw_t::nbyte, raw_t::obs, raw_t::opt, obsd_t::rcv, restslips(), obsd_t::sat, satsys(), saveslips(), screent(), nav_s::seph, STRFMT_BINEX, sync_bnx(), SYS_GLO, SYS_SBS, obsd_t::time, and trace().

Referenced by readbnxfile(), and readbnxt().

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

◆ readbnxt()

int readbnxt ( const char * file,
int rcv,
gtime_t ts,
gtime_t te,
double tint,
const char * opt,
obs_t * obs,
nav_t * nav,
sta_t * sta,
const prcopt_t * popt )
extern

Read BINEX observation/navigation data from file(s).

Parameters
[in]fileFile path (supports wildcards)
[in]rcvReceiver number (1:rover, 2:base)
[in]tsStart time (ts.time==0: no limit)
[in]teEnd time (te.time==0: no limit)
[in]tintTime interval (0: all)
[in]optRINEX options string
[in,out]obsObservation data
[in,out]navNavigation data
[in,out]staStation information (NULL: not output)
[in]poptProcessing options (for navsys filtering)
Returns
Status (-1:error, 0:no data, 1:ok)

Definition at line 1908 of file mrtk_rcv_binex.c.

References expath(), FILEPATHSEP, free, malloc, MAXEXFILE, sta_t::name, readbnxfile(), readbnxfp(), setstr_bnx(), and trace().

Referenced by readobsnav().

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

◆ restslips()

void restslips ( unsigned char slips[][5],
obsd_t * data )
static

Definition at line 1672 of file mrtk_rcv_binex.c.

References obsd_t::LLI, and obsd_t::sat.

Referenced by readbnxfp().

Here is the caller graph for this function:

◆ saveslips()

void saveslips ( unsigned char slips[][5],
obsd_t * data )
static

Definition at line 1663 of file mrtk_rcv_binex.c.

References obsd_t::LLI, and obsd_t::sat.

Referenced by readbnxfp().

Here is the caller graph for this function:

◆ setstr_bnx()

void setstr_bnx ( char * dst,
const char * src,
int n )
static

Definition at line 1651 of file mrtk_rcv_binex.c.

Referenced by readbnxt().

Here is the caller graph for this function:

◆ sisaindex()

int sisaindex ( double value)
static

Definition at line 225 of file mrtk_rcv_binex.c.

Referenced by decode_bnx_01_04(), and decode_bnx_01_14().

Here is the caller graph for this function:

◆ sync_bnx()

int sync_bnx ( uint8_t * buff,
uint8_t data )
static

Definition at line 1515 of file mrtk_rcv_binex.c.

References BNXSYNC2.

Referenced by input_bnx(), input_bnxf(), and readbnxfp().

Here is the caller graph for this function:

◆ U2()

uint16_t U2 ( uint8_t * p)
static

Definition at line 129 of file mrtk_rcv_binex.c.

◆ U4()

uint32_t U4 ( uint8_t * p)
static

Definition at line 138 of file mrtk_rcv_binex.c.

◆ uraindex()

int uraindex ( double value)
static

Definition at line 215 of file mrtk_rcv_binex.c.

References ura_eph.

Referenced by decode_bnx_01_01(), and decode_bnx_01_06().

Here is the caller graph for this function:

Variable Documentation

◆ ura_eph

const double ura_eph[]
static
Initial value:
= {2.4, 3.4, 4.85, 6.85, 9.65, 13.65, 24.0, 48.0,
96.0, 192.0, 384.0, 768.0, 1536.0, 3072.0, 6144.0, 0.0}

Definition at line 123 of file mrtk_rcv_binex.c.