MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_l6.c File Reference
#include "mrtklib/mrtk_l6.h"
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for mrtk_l6.c:

Go to the source code of this file.

Functions

int l6_is_null (const uint8_t *frame)
 Test whether an L6 frame is a null message.
int l6_parse_header (const uint8_t *frame, l6_header_t *h)
 Parse the header of one L6 frame and classify its service.
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.

Variables

static const l6_prn_info_t l6_prn_table []

Function Documentation

◆ l6_file_service()

l6_service_t l6_file_service ( const char * file)
extern

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.

Parameters
[in]fileFile path (no keyword expansion).
Returns
Service, or L6_SVC_UNKNOWN if the file cannot be read or holds no classifiable frame. The file is read in L6_FILE_SCAN_BYTES chunks until the first classifiable frame, so a leading run of null messages of any length is skipped.

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

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

◆ l6_file_type()

l6_file_type_t l6_file_type ( const char * file)
extern

Classify a file name by its QZSS L6 extension (case-insensitive).

Parameters
[in]fileFile path or name.
Returns
L6 file type, L6_FILE_NONE if the extension is not .l6/.l6d/.l6e.

Definition at line 100 of file mrtk_l6.c.

References L6_FILE_L6, and L6_FILE_NONE.

Referenced by postpos(), readobsnav(), and readpreceph().

Here is the caller graph for this function:

◆ l6_is_null()

int l6_is_null ( const uint8_t * frame)
extern

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.

Parameters
[in]frameL6 frame starting at the preamble; at least L6_FRAME_LEN bytes.
Returns
1 if the frame is a null message, 0 otherwise.

Definition at line 29 of file mrtk_l6.c.

References L6_FRAME_LEN.

Referenced by l6_parse_header().

Here is the caller graph for this function:

◆ l6_parse_header()

int l6_parse_header ( const uint8_t * frame,
l6_header_t * h )
extern

Parse the header of one L6 frame and classify its service.

Parameters
[in]frameL6 frame starting at the preamble; at least L6_FRAME_LEN bytes.
[out]hDecoded header. All fields are filled even when the preamble is invalid.
Returns
1 if the preamble is valid, 0 otherwise (h->svc is L6_SVC_UNKNOWN).

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

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

◆ l6_prn_info()

const l6_prn_info_t * l6_prn_info ( int prn)
extern

Look up the auxiliary information of an L6 PRN.

Parameters
[in]prnL6 PRN (header byte 4).
Returns
Table entry, or NULL if the PRN has no nominal L6 assignment.

Definition at line 74 of file mrtk_l6.c.

References l6_prn_table.

Referenced by decode_qzss_l6dmsg(), decoderaw(), and l6_service_expected().

Here is the caller graph for this function:

◆ l6_service_expected()

int l6_service_expected ( const l6_header_t * h)
extern

Test whether a classified frame matches the nominal assignment of its PRN.

Null messages always match; on L6E PRNs both MADOCA and QZNMA match.

Parameters
[in]hParsed header.
Returns
1 if consistent, 0 if the PRN is unassigned or carries an unexpected service.

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

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

◆ l6_service_name()

const char * l6_service_name ( l6_service_t svc)
extern

Short name of an L6 service, for logs.

Parameters
[in]svcService.
Returns
Static string (e.g. "CLAS", "MADOCA", "QZNMA").

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

Here is the caller graph for this function:

Variable Documentation

◆ l6_prn_table

const l6_prn_info_t l6_prn_table[]
static
Initial value:
= {
{193, "QZS1", 0, L6_SVC_CLAS, -1, 0}, {194, "QZS2", 0, L6_SVC_CLAS, -1, 204},
{195, "QZS4", 0, L6_SVC_CLAS, -1, 205}, {196, "QZS1R", 0, L6_SVC_CLAS, -1, 206},
{197, "QZS5", 0, L6_SVC_CLAS, -1, 207}, {199, "QZS3", 0, L6_SVC_CLAS, -1, 209},
{200, "QZS6", 0, L6_SVC_MADOCA_IONO, 0, 210}, {201, "QZS7", 0, L6_SVC_MADOCA_IONO, 1, 211},
{204, "QZS2", 1, L6_SVC_MADOCA, -1, 194}, {205, "QZS4", 1, L6_SVC_MADOCA, -1, 195},
{206, "QZS1R", 1, L6_SVC_MADOCA, -1, 196}, {207, "QZS5", 1, L6_SVC_MADOCA, -1, 197},
{209, "QZS3", 1, L6_SVC_MADOCA, -1, 199}, {210, "QZS6", 1, L6_SVC_MADOCA, -1, 200},
{211, "QZS7", 1, L6_SVC_MADOCA, -1, 201},
}
@ L6_SVC_CLAS
Definition mrtk_l6.h:61
@ L6_SVC_MADOCA
Definition mrtk_l6.h:62
@ L6_SVC_MADOCA_IONO
Definition mrtk_l6.h:63

Definition at line 18 of file mrtk_l6.c.

Referenced by l6_prn_info().