MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_has_rs.h File Reference
#include <stdint.h>
Include dependency graph for mrtk_has_rs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int has_rs_init (void)
 Build the GF(256) log/antilog tables and the systematic generator matrix G. Idempotent: safe to call repeatedly; builds only once.
int has_rs_decode (const uint8_t pages[][53], const uint8_t *pids, int k, uint8_t *out)
 Decode a k-page HAS message from k distinct received encoded pages using the RS(255,32,224) erasure decoder (ICD section 6.4).

Function Documentation

◆ has_rs_decode()

int has_rs_decode ( const uint8_t pages[][53],
const uint8_t * pids,
int k,
uint8_t * out )

Decode a k-page HAS message from k distinct received encoded pages using the RS(255,32,224) erasure decoder (ICD section 6.4).

Each received page is a 53-octet encoded payload carrying Page ID pids[i] (1..255). The encoded page with PID p corresponds to row p-1 of G; output column j (0-based) corresponds to message page j+1.

Parameters
[in]pagesk encoded pages, pages[i] is the 53-octet payload of PID pids[i].
[in]pidsk Page IDs (each 1..255), all distinct.
[in]knumber of received pages / message pages, 1 <= k <= 32.
[out]outrecovered message, k*53 octets (message pages concatenated, page 1 first).
Returns
0 on success, -1 on invalid input (bad k, PID out of range, duplicate PID, or singular decoding matrix).

Definition at line 196 of file mrtk_has_rs.c.

References G, gf_invert(), gf_mul(), has_rs_init(), PAGE_OCT, RS_K, and RS_N.

Referenced by has_complete().

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

◆ has_rs_init()

int has_rs_init ( void )

Build the GF(256) log/antilog tables and the systematic generator matrix G. Idempotent: safe to call repeatedly; builds only once.

Returns
0 on success.

Definition at line 186 of file mrtk_has_rs.c.

References gf_build_genpoly(), gf_build_tables(), rs_encode_column(), RS_K, RS_NPAR, and rs_ready.

Referenced by has_new(), and has_rs_decode().

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