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

MRTKLIB Galileo HAS Module — E6-B C/NAV HAS page collection and Message Type 1 (MT1) decode into ssr_t corrections. More...

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

Go to the source code of this file.

Classes

struct  has_mask_t
struct  has_iodset_t
struct  has_collect_t
struct  has_t

Macros

#define HAS_MAX_MID   32 /* number of distinct Mask IDs (5-bit field) */
#define HAS_MAX_IODSET   32 /* number of distinct IOD Set IDs (5-bit field) */
#define HAS_MAX_PAGES   32 /* max non-encoded pages per message (MS, 1..32) */
#define HAS_PAGE_BYTES   53 /* encoded-page payload length (424 bits) */
#define HAS_MAX_INFLIGHT   2 /* in-flight collection slots (current + previous) */
#define HAS_MAX_GNSS_SAT   40 /* satellites per GNSS satellite mask (SatM) */
#define HAS_MAX_SIG   16 /* signals per GNSS signal mask (SigM) */

Functions

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.

Detailed Description

MRTKLIB Galileo HAS Module — E6-B C/NAV HAS page collection and Message Type 1 (MT1) decode into ssr_t corrections.

This header provides the public API for collecting Galileo HAS pages (keyed by Message ID / Message Type), recovering the encoded message via the RS(255,32) erasure decoder, decoding MT1 (mask, orbit, clock, code bias, phase bias blocks) and filling an internal ssr_t array that callers copy into nav->ssr_ch[0].

Note
Functions declared here are implemented in src/has/mrtk_has.c.

Definition in file mrtk_has.h.

Macro Definition Documentation

◆ HAS_MAX_GNSS_SAT

#define HAS_MAX_GNSS_SAT   40 /* satellites per GNSS satellite mask (SatM) */

Definition at line 48 of file mrtk_has.h.

◆ HAS_MAX_INFLIGHT

#define HAS_MAX_INFLIGHT   2 /* in-flight collection slots (current + previous) */

Definition at line 47 of file mrtk_has.h.

Referenced by has_find_collect(), and has_flush().

◆ HAS_MAX_IODSET

#define HAS_MAX_IODSET   32 /* number of distinct IOD Set IDs (5-bit field) */

Definition at line 44 of file mrtk_has.h.

◆ HAS_MAX_MID

#define HAS_MAX_MID   32 /* number of distinct Mask IDs (5-bit field) */

Definition at line 43 of file mrtk_has.h.

Referenced by has_flush().

◆ HAS_MAX_PAGES

#define HAS_MAX_PAGES   32 /* max non-encoded pages per message (MS, 1..32) */

Definition at line 45 of file mrtk_has.h.

Referenced by has_input_page().

◆ HAS_MAX_SIG

#define HAS_MAX_SIG   16 /* signals per GNSS signal mask (SigM) */

Definition at line 49 of file mrtk_has.h.

Referenced by decode_has_clock(), decode_has_mask(), and has_sigcode().

◆ HAS_PAGE_BYTES

#define HAS_PAGE_BYTES   53 /* encoded-page payload length (424 bits) */

Definition at line 46 of file mrtk_has.h.

Referenced by has_complete(), and has_input_page().

Function Documentation

◆ has_free()

void has_free ( has_t * has)

Free a Galileo HAS decode context.

Parameters
[in,out]hasContext allocated by has_new() (NULL: no-op)

Definition at line 801 of file mrtk_has.c.

References free.

Referenced by freepreceph(), and rtksvrfree().

Here is the caller graph for this function:

◆ has_input_file()

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().

Parameters
[in,out]hasHAS decode context
[in]fpOpen .has file pointer (64-byte little-endian records)
[in]tmaxStop after reading records past this time (GPST)
Returns
10 if any message completed during the call, 0 otherwise (including at end of file).

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().

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

◆ has_input_page()

int has_input_page ( has_t * has,
int prn,
const uint8_t * page56,
gtime_t time )

Input one received Galileo HAS page.

Parameters
[in,out]hasHAS decode context
[in]prnGalileo PRN of the transmitting satellite (1-40)
[in]page5656-byte HAS page (24-bit header + 424-bit encoded page)
[in]timePage reception time (GPST)
Returns
10 when a complete MT1 was decoded and ssr[] updated, 0 when no message completed, <0 on error.

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().

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

◆ has_new()

has_t * has_new ( void )

Allocate and initialize a Galileo HAS decode context.

Returns
Pointer to a heap-allocated has_t (NULL on allocation failure or RS init failure). Free with has_free().
Note
Calls has_rs_init() to build the RS(255,32) erasure-decoder tables.

Definition at line 790 of file mrtk_has.c.

References calloc, and has_rs_init().

Referenced by readpreceph(), and rtksvrstart().

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

◆ has_sel_biascode()

int has_sel_biascode ( int sys,
uint8_t code )

Select the HAS bias slot obs code for an observation code.

Parameters
[in]sysSatellite system (SYS_GPS or SYS_GAL)
[in]codeObservation code (CODE_???)
Returns
Obs code under which the HAS bias is stored, with same-frequency fallback (component <-> combined on the same carrier per HAS SIS ICD Table 20); 0 (CODE_NONE) if no mapping exists.

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().

Here is the caller graph for this function: