From 61635ab8d9462a639f32018eb14cbe19f1deabc1 Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Wed, 27 Oct 2021 23:27:14 +0200 Subject: [PATCH] JSON: tx_frequency from telemetry (RS41, RS92, MEISEI) --- demod/mod/meisei100mod.c | 11 +++++++++++ demod/mod/rs41mod.c | 6 ++++++ demod/mod/rs92mod.c | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/demod/mod/meisei100mod.c b/demod/mod/meisei100mod.c index 9597f41..0e190ce 100644 --- a/demod/mod/meisei100mod.c +++ b/demod/mod/meisei100mod.c @@ -700,6 +700,7 @@ int main(int argc, char **argv) { gpx.sek = (double)ms/1000.0; if (option_jsn && err_blks==0 && gpx.frnr1-gpx.frnr==1) { + char *ver_jsn = NULL; char id_str[] = "xxxxxx\0\0\0\0\0\0"; //if (gpx._sn > 0) { sprintf(id_str, "%08x", gpx._sn); } if (gpx.sn > 0 && gpx.sn < 1e9) { @@ -712,6 +713,13 @@ int main(int argc, char **argv) { if (gpx.jsn_freq > 0) { printf(", \"freq\": %d", gpx.jsn_freq); } + if (gpx.fq > 0) { // include frequency derived from subframe information if available + fprintf(stdout, ", \"tx_frequency\": %.0f", gpx.fq ); + } + #ifdef VER_JSN_STR + ver_jsn = VER_JSN_STR; + #endif + if (ver_jsn && *ver_jsn != '\0') printf(", \"version\": \"%s\"", ver_jsn); printf(" }\n"); printf("\n"); } @@ -934,6 +942,9 @@ int main(int argc, char **argv) { if (gpx.jsn_freq > 0) { // not gpx.fq, because gpx.sn not in every frame printf(", \"freq\": %d", gpx.jsn_freq); } + if (gpx.fq > 0) { // include frequency derived from subframe information if available + fprintf(stdout, ", \"tx_frequency\": %.0f", gpx.fq ); + } #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/rs41mod.c b/demod/mod/rs41mod.c index 54b6a04..8cd09c7 100644 --- a/demod/mod/rs41mod.c +++ b/demod/mod/rs41mod.c @@ -1848,6 +1848,12 @@ static int print_position(gpx_t *gpx, int ec) { if (gpx->freq > 0) fq_kHz = gpx->freq; fprintf(stdout, ", \"freq\": %d", fq_kHz); } + + // Include frequency derived from subframe information if available. + if (gpx->freq > 0) { + fprintf(stdout, ", \"tx_frequency\": %d", gpx->freq ); + } + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/rs92mod.c b/demod/mod/rs92mod.c index 471f7ab..e18a929 100644 --- a/demod/mod/rs92mod.c +++ b/demod/mod/rs92mod.c @@ -1518,6 +1518,12 @@ static int print_position(gpx_t *gpx, int ec) { // GPS-Hoehe ueber Ellipsoid //if (gpx->freq > 0) fq_kHz = gpx->freq; // L-band: option.ngp ? fprintf(stdout, ", \"freq\": %d", fq_kHz); } + + // Include frequency derived from subframe information if available. + if (gpx->freq > 0) { + fprintf(stdout, ", \"tx_frequency\": %d", gpx->freq); + } + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif