From ea70b9953faaf9155b60400e306c71432a049d94 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 9 Oct 2018 15:27:35 +0200 Subject: Add -e option --- src/etianalyse.cpp | 74 ++++++++++++++++++++++++++++-------------------------- src/etisnoop.cpp | 1 + 2 files changed, 40 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/etianalyse.cpp b/src/etianalyse.cpp index df7eca0..8ba1924 100644 --- a/src/etianalyse.cpp +++ b/src/etianalyse.cpp @@ -458,25 +458,27 @@ void ETI_Analyser::eti_analyse() strprintf("Mismatch: %04x %04x", crc, figcrc)); } - printvalue("FIGs", 3); - - bool endmarker = false; - int figcount = 0; - while (!endmarker) { - uint8_t figtype, figlen; - figtype = (fig[0] & 0xE0) >> 5; - if (figtype != 7) { - figlen = fig[0] & 0x1F; - - printsequencestart(4); - decodeFIG(config, figs, fig+1, figlen, figtype, 5, crccorrect); - fig += figlen + 1; - figcount += figlen + 1; - if (figcount >= 29) + if (crccorrect or config.ignore_error) { + printvalue("FIGs", 3); + + bool endmarker = false; + int figcount = 0; + while (!endmarker) { + uint8_t figtype, figlen; + figtype = (fig[0] & 0xE0) >> 5; + if (figtype != 7) { + figlen = fig[0] & 0x1F; + + printsequencestart(4); + decodeFIG(config, figs, fig+1, figlen, figtype, 5, crccorrect); + fig += figlen + 1; + figcount += figlen + 1; + if (figcount >= 29) + endmarker = true; + } + else { endmarker = true; - } - else { - endmarker = true; + } } } @@ -698,26 +700,28 @@ void ETI_Analyser::fic_analyse() strprintf("Mismatch: %04x %04x", crc, figcrc)); } - printvalue("FIGs", 3); + if (crccorrect or config.ignore_error) { + printvalue("FIGs", 3); - uint8_t *fig = fib; - bool endmarker = false; - int figcount = 0; - while (!endmarker) { - uint8_t figtype, figlen; - figtype = (fig[0] & 0xE0) >> 5; - if (figtype != 7) { - figlen = fig[0] & 0x1F; + uint8_t *fig = fib; + bool endmarker = false; + int figcount = 0; + while (!endmarker) { + uint8_t figtype, figlen; + figtype = (fig[0] & 0xE0) >> 5; + if (figtype != 7) { + figlen = fig[0] & 0x1F; - printsequencestart(4); - decodeFIG(config, figs, fig+1, figlen, figtype, 5, crccorrect); - fig += figlen + 1; - figcount += figlen + 1; - if (figcount >= 29) + printsequencestart(4); + decodeFIG(config, figs, fig+1, figlen, figtype, 5, crccorrect); + fig += figlen + 1; + figcount += figlen + 1; + if (figcount >= 29) + endmarker = true; + } + else { endmarker = true; - } - else { - endmarker = true; + } } } diff --git a/src/etisnoop.cpp b/src/etisnoop.cpp index fa07ea2..45f4f9e 100644 --- a/src/etisnoop.cpp +++ b/src/etisnoop.cpp @@ -102,6 +102,7 @@ void usage(void) " -r analyse FIG rates in FIGs per second\n" " -R analyse FIG rates in frames per FIG\n" " -w decode CRC-DABMUX and ODR-DabMux watermark.\n" + " -e decode frames with SYNC error and decode FIGs with invalid CRC\n" " -F /\n" " add FIG type/ext to list of FIGs to display.\n" " if the option is not given, all FIGs are displayed.\n" -- cgit v1.2.3