|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
MRTKLIB L6 Module — QZSS L6 frame header parsing. More...
#include <stdint.h>Go to the source code of this file.
Classes | |
| struct | l6_header_t |
| Decoded L6 frame header. Raw bit fields; no service-specific remapping. More... | |
| struct | l6_prn_info_t |
| Auxiliary per-PRN information for one L6 PRN. More... | |
Macros | |
| #define | L6_PREAMBLE 0x1ACFFC1DU /* L6 frame preamble */ |
| #define | L6_FRAME_LEN 218 /* frame length without R-S parity (bytes) */ |
| #define | L6_RAW_LEN 250 /* frame length with R-S parity (bytes) */ |
| #define | L6_HEADER_BITS 49 /* preamble + PRN + type ID + alert (bits) */ |
| #define | L6_DATA_BITS 1695 /* data part (bits) */ |
| #define | L6_FILE_SCAN_BYTES 65536 /* read chunk of l6_file_service() */ |
| #define | L6_VID_MADOCA 2 /* vendor ID 010b: MADOCA-PPP (L6D and L6E) [3] */ |
| #define | L6_VID_QZNMA 3 /* vendor ID 011b: QZNMA (L6E only) [3] */ |
| #define | L6_VID_CLAS 5 /* vendor ID 101b: CLAS (L6D only) [3] */ |
Enumerations | |
| enum | l6_service_t { L6_SVC_UNKNOWN = 0 , L6_SVC_NULL , L6_SVC_CLAS , L6_SVC_MADOCA , L6_SVC_MADOCA_IONO , L6_SVC_QZNMA } |
| Service carried by an L6 frame. More... | |
| enum | l6_file_type_t { L6_FILE_NONE = 0 , L6_FILE_L6 , L6_FILE_L6D , L6_FILE_L6E } |
| QZSS L6 file type from the file name extension. More... | |
Functions | |
| int | l6_parse_header (const uint8_t *frame, l6_header_t *h) |
| Parse the header of one L6 frame and classify its service. | |
| int | l6_is_null (const uint8_t *frame) |
| Test whether an L6 frame is a null message. | |
| const l6_prn_info_t * | l6_prn_info (int prn) |
| Look up the auxiliary information of an L6 PRN. | |
| int | l6_service_expected (const l6_header_t *h) |
| Test whether a classified frame matches the nominal assignment of its PRN. | |
| l6_file_type_t | l6_file_type (const char *file) |
| Classify a file name by its QZSS L6 extension (case-insensitive). | |
| l6_service_t | l6_file_service (const char *file) |
| Service of an L6 frame file, from the first non-null frame header. | |
| const char * | l6_service_name (l6_service_t svc) |
| Short name of an L6 service, for logs. | |
MRTKLIB L6 Module — QZSS L6 frame header parsing.
Every QZSS L6 frame (L6D and L6E) starts with a 49-bit header: 32-bit preamble, 8-bit PRN, 8-bit L6 message type ID and 1-bit alert flag, followed by 1695 data bits and a 256-bit Reed-Solomon parity. The service carried by a frame (CLAS, MADOCA-PPP, QZNMA) is identified by the vendor ID in the message type ID [3], never by the PRN: L6E PRNs time-multiplex MADOCA-PPP and QZNMA frames, and PRN-to-service assignments change over time.
The functions here are stateless; byte synchronisation and subframe assembly stay with each service decoder.
Definition in file mrtk_l6.h.
| #define L6_DATA_BITS 1695 /* data part (bits) */ |
Definition at line 46 of file mrtk_l6.h.
Referenced by decode_qzss_l6dmsg(), and decode_qzss_l6emsg().
| #define L6_FILE_SCAN_BYTES 65536 /* read chunk of l6_file_service() */ |
Definition at line 47 of file mrtk_l6.h.
Referenced by l6_file_service().
| #define L6_FRAME_LEN 218 /* frame length without R-S parity (bytes) */ |
Definition at line 43 of file mrtk_l6.h.
Referenced by input_qzssl6d(), input_qzssl6e(), l6_file_service(), and l6_is_null().
| #define L6_HEADER_BITS 49 /* preamble + PRN + type ID + alert (bits) */ |
Definition at line 45 of file mrtk_l6.h.
Referenced by decode_qzss_l6dmsg(), and decode_qzss_l6emsg().
| #define L6_PREAMBLE 0x1ACFFC1DU /* L6 frame preamble */ |
Definition at line 42 of file mrtk_l6.h.
Referenced by decode_qzss_l6dmsg(), decode_qzss_l6emsg(), and l6_parse_header().
| #define L6_RAW_LEN 250 /* frame length with R-S parity (bytes) */ |
| #define L6_VID_CLAS 5 /* vendor ID 101b: CLAS (L6D only) [3] */ |
Definition at line 51 of file mrtk_l6.h.
Referenced by l6_parse_header().
| #define L6_VID_MADOCA 2 /* vendor ID 010b: MADOCA-PPP (L6D and L6E) [3] */ |
Definition at line 49 of file mrtk_l6.h.
Referenced by l6_parse_header().
| #define L6_VID_QZNMA 3 /* vendor ID 011b: QZNMA (L6E only) [3] */ |
Definition at line 50 of file mrtk_l6.h.
Referenced by l6_parse_header().
| enum l6_file_type_t |
| enum l6_service_t |
Service carried by an L6 frame.
| l6_service_t l6_file_service | ( | const char * | file | ) |
Service of an L6 frame file, from the first non-null frame header.
Scans the start of the file (concatenated 218- or 250-byte frames, as written by receivers and archives) for the preamble and classifies the first frame that is not a null message.
| [in] | file | File path (no keyword expansion). |
Definition at line 120 of file mrtk_l6.c.
References free, L6_FILE_SCAN_BYTES, L6_FRAME_LEN, l6_parse_header(), L6_SVC_NULL, L6_SVC_UNKNOWN, malloc, and l6_header_t::svc.
Referenced by readpreceph().
| l6_file_type_t l6_file_type | ( | const char * | file | ) |
Classify a file name by its QZSS L6 extension (case-insensitive).
| [in] | file | File path or name. |
Definition at line 100 of file mrtk_l6.c.
References L6_FILE_L6, and L6_FILE_NONE.
Referenced by postpos(), readobsnav(), and readpreceph().
| int l6_is_null | ( | const uint8_t * | frame | ) |
Test whether an L6 frame is a null message.
Null message [1] 4.1.2.3: message type ID 0, alert flag 1, data part "0101010"b followed by repeated "10101010"b, i.e. bytes 6..217 all 0xAA.
| [in] | frame | L6 frame starting at the preamble; at least L6_FRAME_LEN bytes. |
Definition at line 29 of file mrtk_l6.c.
References L6_FRAME_LEN.
Referenced by l6_parse_header().
| int l6_parse_header | ( | const uint8_t * | frame, |
| l6_header_t * | h ) |
Parse the header of one L6 frame and classify its service.
| [in] | frame | L6 frame starting at the preamble; at least L6_FRAME_LEN bytes. |
| [out] | h | Decoded header. All fields are filled even when the preamble is invalid. |
Definition at line 44 of file mrtk_l6.c.
References l6_header_t::alert, l6_header_t::anme, l6_header_t::csid, l6_header_t::fac, l6_is_null(), L6_PREAMBLE, L6_SVC_CLAS, L6_SVC_MADOCA, L6_SVC_MADOCA_IONO, L6_SVC_NULL, L6_SVC_QZNMA, L6_SVC_UNKNOWN, L6_VID_CLAS, L6_VID_MADOCA, L6_VID_QZNMA, l6_header_t::msgid, l6_header_t::preamble, l6_header_t::prn, l6_header_t::ptn, l6_header_t::sf_ind, l6_header_t::svc, and l6_header_t::vid.
Referenced by clas_input_cssr(), decode_qzss_l6dmsg(), decode_qzss_l6emsg(), decode_qzss_l6frame(), decoderaw(), and l6_file_service().
| const l6_prn_info_t * l6_prn_info | ( | int | prn | ) |
Look up the auxiliary information of an L6 PRN.
| [in] | prn | L6 PRN (header byte 4). |
Definition at line 74 of file mrtk_l6.c.
References l6_prn_table.
Referenced by decode_qzss_l6dmsg(), decoderaw(), and l6_service_expected().
| int l6_service_expected | ( | const l6_header_t * | h | ) |
Test whether a classified frame matches the nominal assignment of its PRN.
Null messages always match; on L6E PRNs both MADOCA and QZNMA match.
| [in] | h | Parsed header. |
Definition at line 85 of file mrtk_l6.c.
References l6_prn_info(), L6_SVC_MADOCA, L6_SVC_NULL, L6_SVC_QZNMA, l6_prn_info_t::l6e, l6_header_t::prn, l6_header_t::svc, and l6_prn_info_t::svc.
Referenced by decode_qzss_l6frame().
| const char * l6_service_name | ( | l6_service_t | svc | ) |
Short name of an L6 service, for logs.
| [in] | svc | Service. |
Definition at line 162 of file mrtk_l6.c.
References L6_SVC_CLAS, L6_SVC_MADOCA, L6_SVC_MADOCA_IONO, L6_SVC_NULL, and L6_SVC_QZNMA.
Referenced by clas_input_cssr(), and decode_qzss_l6frame().