From 58feaebf9c1a98644305b8c7e20e7b73054ae743 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Wed, 4 Oct 2023 07:49:57 +1030 Subject: [PATCH] rebase rs41mod, change field name for subframe data --- auto_rx/autorx/decode.py | 8 ++++---- demod/mod/rs41mod.c | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/auto_rx/autorx/decode.py b/auto_rx/autorx/decode.py index 17bcd9b..75679a2 100644 --- a/auto_rx/autorx/decode.py +++ b/auto_rx/autorx/decode.py @@ -1710,15 +1710,15 @@ class SondeDecoder(object): # RS41 Subframe Data Actions # We only upload the subframe data once. - if 'rs41_calconf320' in _telemetry: + if 'rs41_calconf51x16' in _telemetry: # Remove subframe data if we have already uploaded it once. if _telemetry['id'] in self.rs41_subframe_uploads: - _telemetry.pop('rs41_calconf320') + _telemetry.pop('rs41_calconf51x16') else: self.rs41_subframe_uploads.append(_telemetry['id']) self.log_info(f"Received complete calibration dataset for {_telemetry['id']}.") - _telemetry['rs41_subframe'] = _telemetry['rs41_calconf320'] - _telemetry.pop('rs41_calconf320') + _telemetry['rs41_subframe'] = _telemetry['rs41_calconf51x16'] + _telemetry.pop('rs41_calconf51x16') diff --git a/demod/mod/rs41mod.c b/demod/mod/rs41mod.c index 0beb630..937f7ed 100644 --- a/demod/mod/rs41mod.c +++ b/demod/mod/rs41mod.c @@ -2132,9 +2132,16 @@ static int print_position(gpx_t *gpx, int ec) { } if (gpx->option.cal == 1) { // cal/conf + int _j; if ( !gpx->calconf_sent && gpx->calconf_complete ) { - fprintf(stdout, ", \"rs41_calconf320\": \""); - for (int _j = 0; _j < 51*16; _j++) { + /* + fprintf(stdout, ", \"rs41_calconf320h\": \""); // only constant/crc part + for (int _j = 0; _j < 50*16; _j++) { + fprintf(stdout, "%02X", gpx->calibytes[_j]); + } + */ + fprintf(stdout, ", \"rs41_calconf51x16\": \""); + for (_j = 0; _j < 51*16; _j++) { fprintf(stdout, "%02X", gpx->calibytes[_j]); } fprintf(stdout, "\""); @@ -2142,15 +2149,16 @@ static int print_position(gpx_t *gpx, int ec) { } if (gpx->calconf_subfrm[0] == 0x32) { fprintf(stdout, ", \"rs41_conf0x32\": \""); - for (int _j = 0; _j < 16; _j++) { + for (_j = 0; _j < 16; _j++) { fprintf(stdout, "%02X", gpx->calconf_subfrm[1+_j]); } fprintf(stdout, "\""); } } if (gpx->option.cal == 2) { // cal/conf + int _j; fprintf(stdout, ", \"rs41_subfrm\": \"0x%02X:", gpx->calconf_subfrm[0]); - for (int _j = 0; _j < 16; _j++) { + for (_j = 0; _j < 16; _j++) { fprintf(stdout, "%02X", gpx->calconf_subfrm[1+_j]); } fprintf(stdout, "\"");