|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
#include "mrtklib/mrtk_has.h"#include <math.h>#include <stdlib.h>#include <string.h>#include "mrtk_has_rs.h"#include "mrtklib/mrtk_bits.h"#include "mrtklib/mrtk_const.h"#include "mrtklib/mrtk_time.h"#include "mrtklib/mrtk_trace.h"Go to the source code of this file.
Macros | |
| #define | HAS_DUMMY_HEADER 0xAF3BC3 /* 24-bit HAS header of a dummy page */ |
| #define | HAS_TIMEOUT 150.0 /* message collection timeout (s) [1] 6.4.1 */ |
| #define | HAS_MT1 1 /* HAS Message Type 1 (satellite corrections) */ |
| #define | HAS_GNSS_GPS 0 /* HAS GNSS ID: GPS ([1] Table 18) */ |
| #define | HAS_GNSS_GAL 2 /* HAS GNSS ID: Galileo ([1] Table 18) */ |
| #define | HAS_HASS_DONTUSE 3 /* HAS Status: don't use ([1] Table 9) */ |
| #define | HAS_SATM_BITS 40 /* satellite mask length ([1] 5.2.1.2) */ |
| #define | HAS_SIGM_BITS 16 /* signal mask length ([1] 5.2.1.3) */ |
| #define | HAS_DR_NA (-4096) /* DR "data not available" (1000...0, 13-bit) */ |
| #define | HAS_DIT_NA (-2048) /* DIT "data not available" (1000...0, 12-bit) */ |
| #define | HAS_DCT_NA (-2048) /* DCT "data not available" (1000...0, 12-bit) */ |
| #define | HAS_DCC_NA (-4096) /* DCC "data not available" (1000...0, 13-bit) */ |
| #define | HAS_DCC_NU (4095) /* DCC "shall not be used" (0111...1, 13-bit) */ |
| #define | HAS_CB_NA (-1024) /* CB "data not available" (1000...0, 11-bit) */ |
| #define | HAS_PB_NA (-1024) /* PB "data not available" (1000...0, 11-bit) */ |
| #define | HAS_MAX_LATENCY 600.0 |
Functions | |
| int | satno (int sys, int prn) |
| void | satno2id (int sat, char *id) |
| double | time2gpst (gtime_t t, int *week) |
| char * | time_str (gtime_t t, int n) |
| static int | has_gnssid2sys (int gnssid) |
| static uint8_t | has_sigcode (int gnssid, int sigidx) |
| static int | has_iodref_bits (int gnssid) |
| static double | has_code2lam (int sys, uint8_t code) |
| static int | has_bits_ok (int i, int n, int nbit) |
| static int | popcount_field (const uint8_t *buff, int pos, int len) |
| static gtime_t | has_t_mt1 (gtime_t time, int toh) |
| static int | decode_has_mask (has_t *has, const uint8_t *msg, int i, int nbit, int mid) |
| static int | decode_has_orbit (has_t *has, const uint8_t *msg, int i, int nbit, int mid, int iodset, gtime_t t0) |
| static int | decode_has_clock (has_t *has, const uint8_t *msg, int i, int nbit, int mid, int iodset, gtime_t t0) |
| static int | decode_has_clock_subset (has_t *has, const uint8_t *msg, int i, int nbit, int mid, int iodset, gtime_t t0) |
| static int | decode_has_codebias (has_t *has, const uint8_t *msg, int i, int nbit, gtime_t t0, const has_mask_t *m) |
| static int | decode_has_phasebias (has_t *has, const uint8_t *msg, int i, int nbit, gtime_t t0, const has_mask_t *m) |
| static int | decode_has_mt1 (has_t *has, const uint8_t *msg, int nbit, gtime_t time) |
| static int | has_complete (has_t *has, has_collect_t *col, gtime_t time) |
| static has_collect_t * | has_find_collect (has_t *has, int mid, int mt, gtime_t time) |
| static void | has_flush (has_t *has) |
| has_t * | has_new (void) |
| Allocate and initialize a Galileo HAS decode context. | |
| void | has_free (has_t *has) |
| Free a Galileo HAS decode context. | |
| int | has_input_page (has_t *has, int prn, const uint8_t *page56, gtime_t time) |
| Input one received Galileo HAS page. | |
| int | has_input_file (has_t *has, FILE *fp, gtime_t tmax) |
| Read .has records from a file and feed them to has_input_page(). | |
| int | has_sel_biascode (int sys, uint8_t code) |
| Select the HAS bias slot obs code for an observation code. | |
Variables | |
| static const uint8_t | has_sig_gal [HAS_MAX_SIG] |
| static const uint8_t | has_sig_gps [HAS_MAX_SIG] |
| #define HAS_CB_NA (-1024) /* CB "data not available" (1000...0, 11-bit) */ |
Definition at line 50 of file mrtk_has.c.
Referenced by decode_has_codebias().
| #define HAS_DCC_NA (-4096) /* DCC "data not available" (1000...0, 13-bit) */ |
Definition at line 48 of file mrtk_has.c.
Referenced by decode_has_clock(), and decode_has_clock_subset().
| #define HAS_DCC_NU (4095) /* DCC "shall not be used" (0111...1, 13-bit) */ |
Definition at line 49 of file mrtk_has.c.
Referenced by decode_has_clock(), and decode_has_clock_subset().
| #define HAS_DCT_NA (-2048) /* DCT "data not available" (1000...0, 12-bit) */ |
Definition at line 47 of file mrtk_has.c.
Referenced by decode_has_orbit().
| #define HAS_DIT_NA (-2048) /* DIT "data not available" (1000...0, 12-bit) */ |
Definition at line 46 of file mrtk_has.c.
Referenced by decode_has_orbit().
| #define HAS_DR_NA (-4096) /* DR "data not available" (1000...0, 13-bit) */ |
Definition at line 45 of file mrtk_has.c.
Referenced by decode_has_orbit().
| #define HAS_DUMMY_HEADER 0xAF3BC3 /* 24-bit HAS header of a dummy page */ |
Definition at line 32 of file mrtk_has.c.
Referenced by has_input_page().
| #define HAS_GNSS_GAL 2 /* HAS GNSS ID: Galileo ([1] Table 18) */ |
Definition at line 38 of file mrtk_has.c.
Referenced by has_gnssid2sys(), has_iodref_bits(), and has_sigcode().
| #define HAS_GNSS_GPS 0 /* HAS GNSS ID: GPS ([1] Table 18) */ |
Definition at line 37 of file mrtk_has.c.
Referenced by has_gnssid2sys(), has_iodref_bits(), and has_sigcode().
| #define HAS_HASS_DONTUSE 3 /* HAS Status: don't use ([1] Table 9) */ |
Definition at line 40 of file mrtk_has.c.
Referenced by has_input_page().
| #define HAS_MAX_LATENCY 600.0 |
Definition at line 165 of file mrtk_has.c.
Referenced by decode_has_mt1().
| #define HAS_MT1 1 /* HAS Message Type 1 (satellite corrections) */ |
Definition at line 35 of file mrtk_has.c.
Referenced by has_complete(), and has_input_page().
| #define HAS_PB_NA (-1024) /* PB "data not available" (1000...0, 11-bit) */ |
Definition at line 51 of file mrtk_has.c.
Referenced by decode_has_phasebias().
| #define HAS_SATM_BITS 40 /* satellite mask length ([1] 5.2.1.2) */ |
Definition at line 42 of file mrtk_has.c.
Referenced by decode_has_mask().
| #define HAS_SIGM_BITS 16 /* signal mask length ([1] 5.2.1.3) */ |
Definition at line 43 of file mrtk_has.c.
Referenced by decode_has_mask().
| #define HAS_TIMEOUT 150.0 /* message collection timeout (s) [1] 6.4.1 */ |
Definition at line 33 of file mrtk_has.c.
Referenced by has_find_collect().
|
static |
Definition at line 377 of file mrtk_has.c.
References ssr_t::dclk, getbits(), getbitu(), has_mask_t::gnssid, has_bits_ok(), HAS_DCC_NA, HAS_DCC_NU, HAS_MAX_SIG, ssr_t::hrclk, ssr_t::iod, has_t::mask, has_mask_t::nsat, has_mask_t::nsys, has_mask_t::sat, gtime_t::sec, has_t::ssr, ssr_t::t0, gtime_t::time, ssr_t::udi, and ssr_t::update.
Referenced by decode_has_mt1().
|
static |
Definition at line 436 of file mrtk_has.c.
References ssr_t::dclk, getbits(), getbitu(), has_mask_t::gnssid, has_bits_ok(), HAS_DCC_NA, HAS_DCC_NU, ssr_t::hrclk, ssr_t::iod, has_t::mask, has_mask_t::nsat, has_mask_t::sat, gtime_t::sec, has_t::ssr, ssr_t::t0, gtime_t::time, trace(), ssr_t::udi, and ssr_t::update.
Referenced by decode_has_mt1().
|
static |
Definition at line 516 of file mrtk_has.c.
References ssr_t::cbias, has_mask_t::cellmask, has_mask_t::code, CODE_NONE, getbits(), has_bits_ok(), HAS_CB_NA, has_mask_t::nsat, has_mask_t::nsig, has_mask_t::sat, has_t::ssr, ssr_t::t0, ssr_t::udi, ssr_t::update, and ssr_t::vcbias.
Referenced by decode_has_mt1().
|
static |
Definition at line 195 of file mrtk_has.c.
References has_mask_t::cellmask, has_mask_t::code, getbitu(), has_mask_t::gnssid, has_bits_ok(), has_gnssid2sys(), HAS_MAX_SIG, HAS_SATM_BITS, has_sigcode(), HAS_SIGM_BITS, has_t::mask, MAXSAT, has_mask_t::navmsg, has_mask_t::nsat, has_mask_t::nsig, has_mask_t::nsys, popcount_field(), has_mask_t::sat, satno(), satno2id(), SYS_NONE, trace(), and has_mask_t::valid.
Referenced by decode_has_mt1().
Definition at line 629 of file mrtk_has.c.
References decode_has_clock(), decode_has_clock_subset(), decode_has_codebias(), decode_has_mask(), decode_has_orbit(), decode_has_phasebias(), getbitu(), HAS_MAX_LATENCY, has_t_mt1(), has_t::iodset, has_t::mask, time2gpst(), time_str(), trace(), has_iodset_t::valid, and has_mask_t::valid.
Referenced by has_complete().
|
static |
Definition at line 318 of file mrtk_has.c.
References ssr_t::ddeph, ssr_t::deph, getbits(), getbitu(), has_mask_t::gnssid, has_bits_ok(), HAS_DCT_NA, HAS_DIT_NA, HAS_DR_NA, has_iodref_bits(), ssr_t::iod, ssr_t::iode, has_iodset_t::iodref, has_t::iodset, has_t::mask, has_mask_t::nsat, has_mask_t::sat, has_t::ssr, ssr_t::t0, ssr_t::udi, ssr_t::update, and has_iodset_t::valid.
Referenced by decode_has_mt1().
|
static |
Definition at line 568 of file mrtk_has.c.
References has_mask_t::cellmask, has_mask_t::code, CODE_NONE, ssr_t::discnt, getbits(), getbitu(), has_mask_t::gnssid, has_bits_ok(), has_code2lam(), has_gnssid2sys(), HAS_PB_NA, has_mask_t::nsat, has_mask_t::nsig, ssr_t::pbias, has_mask_t::sat, has_t::ssr, SYS_NONE, ssr_t::t0, ssr_t::udi, ssr_t::update, and ssr_t::vpbias.
Referenced by decode_has_mt1().
|
static |
Definition at line 160 of file mrtk_has.c.
Referenced by decode_has_clock(), decode_has_clock_subset(), decode_has_codebias(), decode_has_mask(), decode_has_orbit(), and decode_has_phasebias().
|
static |
Definition at line 100 of file mrtk_has.c.
References CLIGHT, CODE_L1B, CODE_L1C, CODE_L1L, CODE_L1S, CODE_L1X, CODE_L2L, CODE_L2S, CODE_L2W, CODE_L2X, CODE_L5I, CODE_L5Q, CODE_L5X, CODE_L6B, CODE_L6C, CODE_L6X, CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L8I, CODE_L8Q, CODE_L8X, FREQ1, FREQ2, FREQ5, FREQ6, FREQ7, FREQ8, SYS_GAL, and SYS_GPS.
Referenced by decode_has_phasebias().
|
static |
Definition at line 725 of file mrtk_has.c.
References has_collect_t::active, calloc, decode_has_mt1(), free, HAS_MT1, HAS_PAGE_BYTES, has_rs_decode(), has_collect_t::mid, has_collect_t::ms, has_collect_t::mt, has_collect_t::page, has_collect_t::pid, and trace().
Referenced by has_input_page().
|
static |
Definition at line 749 of file mrtk_has.c.
References has_collect_t::active, has_t::collect, HAS_MAX_INFLIGHT, HAS_TIMEOUT, has_collect_t::mid, has_collect_t::mt, has_collect_t::t0, and timediff().
Referenced by has_input_page().
|
static |
Definition at line 777 of file mrtk_has.c.
References has_collect_t::active, has_t::collect, HAS_MAX_INFLIGHT, HAS_MAX_MID, has_t::mask, trace(), and has_mask_t::valid.
Referenced by has_input_page().
|
extern |
Free a Galileo HAS decode context.
| [in,out] | has | Context allocated by has_new() (NULL: no-op) |
Definition at line 801 of file mrtk_has.c.
References free.
Referenced by freepreceph(), and rtksvrfree().
|
static |
Definition at line 64 of file mrtk_has.c.
References HAS_GNSS_GAL, HAS_GNSS_GPS, SYS_GAL, SYS_GPS, and SYS_NONE.
Referenced by decode_has_mask(), and decode_has_phasebias().
Read .has records from a file and feed them to has_input_page().
| [in,out] | has | HAS decode context |
| [in] | fp | Open .has file pointer (64-byte little-endian records) |
| [in] | tmax | Stop after reading records past this time (GPST) |
Definition at line 872 of file mrtk_has.c.
References gpst2time(), has_input_page(), gtime_t::time, timediff(), and trace().
Referenced by update_gal_has().
Input one received Galileo HAS page.
| [in,out] | has | HAS decode context |
| [in] | prn | Galileo PRN of the transmitting satellite (1-40) |
| [in] | page56 | 56-byte HAS page (24-bit header + 424-bit encoded page) |
| [in] | time | Page reception time (GPST) |
Definition at line 804 of file mrtk_has.c.
References has_collect_t::active, getbitu(), has_complete(), HAS_DUMMY_HEADER, has_find_collect(), has_flush(), HAS_HASS_DONTUSE, HAS_MAX_PAGES, HAS_MT1, HAS_PAGE_BYTES, has_collect_t::mid, has_collect_t::ms, has_collect_t::mt, has_collect_t::npid, has_collect_t::page, has_collect_t::pid, has_collect_t::t0, and trace().
Referenced by decoderaw(), and has_input_file().
|
static |
Definition at line 89 of file mrtk_has.c.
References HAS_GNSS_GAL, and HAS_GNSS_GPS.
Referenced by decode_has_orbit().
|
extern |
Allocate and initialize a Galileo HAS decode context.
Definition at line 790 of file mrtk_has.c.
References calloc, and has_rs_init().
Referenced by readpreceph(), and rtksvrstart().
|
extern |
Select the HAS bias slot obs code for an observation code.
| [in] | sys | Satellite system (SYS_GPS or SYS_GAL) |
| [in] | code | Observation code (CODE_???) |
Definition at line 902 of file mrtk_has.c.
References CODE_L1B, CODE_L1C, CODE_L1L, CODE_L1S, CODE_L1X, CODE_L2L, CODE_L2S, CODE_L2W, CODE_L2X, CODE_L5I, CODE_L5Q, CODE_L5X, CODE_L6B, CODE_L6C, CODE_L6X, CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L8I, CODE_L8Q, CODE_L8X, CODE_NONE, SYS_GAL, and SYS_GPS.
Referenced by corr_meas().
|
static |
Definition at line 75 of file mrtk_has.c.
References CODE_NONE, HAS_GNSS_GAL, HAS_GNSS_GPS, HAS_MAX_SIG, has_sig_gal, and has_sig_gps.
Referenced by decode_has_mask().
Definition at line 180 of file mrtk_has.c.
References gpst2time(), and time2gpst().
Referenced by decode_has_mt1().
|
static |
Definition at line 168 of file mrtk_has.c.
References getbitu().
Referenced by decode_has_mask().
|
extern |
Definition at line 58 of file mrtk_nav.c.
Referenced by decode_has_mask().
|
extern |
Definition at line 817 of file mrtk_nav.c.
Referenced by decode_has_mask().
|
extern |
Definition at line 181 of file mrtk_time.c.
Referenced by decode_has_mt1(), and has_t_mt1().
|
extern |
Definition at line 530 of file mrtk_time.c.
Referenced by decode_has_mt1().
|
static |
|
static |