|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
Go to the source code of this file.
Macros | |
| #define | GF_PRIM 0x11D /* primitive polynomial a^8+a^4+a^3+a^2+1 */ |
| #define | RS_N 255 /* code vector length (2^8 - 1) */ |
| #define | RS_K 32 /* information vector length */ |
| #define | RS_NPAR (RS_N - RS_K) /* number of parity symbols = 223 */ |
| #define | PAGE_OCT 53 /* octets per page */ |
Functions | |
| static uint8_t | gf_mul (uint8_t a, uint8_t b) |
| static uint8_t | gf_inv (uint8_t a) |
| static void | gf_build_tables (void) |
| static void | gf_build_genpoly (uint8_t gpoly[(255 - 32)+1]) |
| static void | rs_encode_column (int col, const uint8_t gpoly[(255 - 32)+1]) |
| static int | gf_invert (int k, uint8_t a[32][32], uint8_t inv[32][32]) |
| 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). | |
Variables | |
| static uint8_t | gf_exp [2 *255] |
| static uint8_t | gf_log [256] |
| static uint8_t | G [255][32] |
| static int | rs_ready = 0 |
| #define GF_PRIM 0x11D /* primitive polynomial a^8+a^4+a^3+a^2+1 */ |
Definition at line 30 of file mrtk_has_rs.c.
Referenced by gf_build_tables().
| #define PAGE_OCT 53 /* octets per page */ |
Definition at line 34 of file mrtk_has_rs.c.
Referenced by has_rs_decode().
| #define RS_K 32 /* information vector length */ |
Definition at line 32 of file mrtk_has_rs.c.
Referenced by gf_invert(), has_rs_decode(), has_rs_init(), and rs_encode_column().
| #define RS_N 255 /* code vector length (2^8 - 1) */ |
Definition at line 31 of file mrtk_has_rs.c.
Referenced by gf_build_tables(), gf_inv(), has_rs_decode(), and rs_encode_column().
Definition at line 33 of file mrtk_has_rs.c.
Referenced by gf_build_genpoly(), has_rs_init(), and rs_encode_column().
|
static |
Definition at line 75 of file mrtk_has_rs.c.
References gf_exp, gf_mul(), and RS_NPAR.
Referenced by has_rs_init().
|
static |
Definition at line 59 of file mrtk_has_rs.c.
References gf_exp, gf_log, GF_PRIM, and RS_N.
Referenced by has_rs_init().
|
static |
Definition at line 53 of file mrtk_has_rs.c.
References gf_exp, gf_log, and RS_N.
Referenced by gf_invert().
|
static |
Definition at line 142 of file mrtk_has_rs.c.
References gf_inv(), gf_mul(), and RS_K.
Referenced by has_rs_decode().
|
static |
Definition at line 47 of file mrtk_has_rs.c.
References gf_exp, and gf_log.
Referenced by gf_build_genpoly(), gf_invert(), has_rs_decode(), and rs_encode_column().
| 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.
| [in] | pages | k encoded pages, pages[i] is the 53-octet payload of PID pids[i]. |
| [in] | pids | k Page IDs (each 1..255), all distinct. |
| [in] | k | number of received pages / message pages, 1 <= k <= 32. |
| [out] | out | recovered message, k*53 octets (message pages concatenated, page 1 first). |
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().
| 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.
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().
|
static |
Definition at line 101 of file mrtk_has_rs.c.
References G, gf_mul(), RS_K, RS_N, and RS_NPAR.
Referenced by has_rs_init().
|
static |
Definition at line 42 of file mrtk_has_rs.c.
Referenced by has_rs_decode(), and rs_encode_column().
|
static |
Definition at line 38 of file mrtk_has_rs.c.
Referenced by gf_build_genpoly(), gf_build_tables(), gf_inv(), and gf_mul().
|
static |
Definition at line 39 of file mrtk_has_rs.c.
Referenced by gf_build_tables(), gf_inv(), and gf_mul().
|
static |
Definition at line 44 of file mrtk_has_rs.c.
Referenced by has_rs_init().