aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/etianalyse.cpp19
-rw-r--r--src/figs.cpp7
-rw-r--r--src/figs.hpp27
3 files changed, 40 insertions, 13 deletions
diff --git a/src/etianalyse.cpp b/src/etianalyse.cpp
index 1b4c5a2..df7eca0 100644
--- a/src/etianalyse.cpp
+++ b/src/etianalyse.cpp
@@ -801,15 +801,12 @@ void ETI_Analyser::decodeFIG(
break;
case 2:
{// EXTENDED LABELS
- uint16_t ext,oe;
-
- uint8_t toggle_flag = (f[0] & 0x80) >> 7;
- uint8_t segment_index = (f[0] & 0x70) >> 4;
- oe = (f[0] & 0x08) >> 3;
- ext = f[0] & 0x07;
-
+ const uint16_t ext = f[0] & 0x07;
const display_settings_t disp(config.is_fig_to_be_printed(figtype, ext), indent);
+ fig2_common_t fig2(ensemble, f, figlen);
+ auto fig_result = fig2_select(fig2, disp);
+
printvalue("FIG", disp, "", strprintf("2/%d", ext));
if (get_verbosity() > 0) {
@@ -818,12 +815,12 @@ void ETI_Analyser::decodeFIG(
if (disp.print) {
printvalue("Length", disp, "", to_string(figlen));
- printvalue("OE", disp, "", to_string(oe));
- printvalue("Toggle flag", disp, "", to_string(toggle_flag));
- printvalue("Segment index", disp, "", to_string(segment_index));
+ printvalue("RFU", disp, "", to_string(fig2.rfu()));
+ printvalue("Toggle flag", disp, "", to_string(fig2.toggle_flag()));
+ printvalue("Segment index", disp, "", to_string(fig2.segment_index()));
}
- figs.push_back(figtype, ext, figlen);
+ figs.push_back(figtype, fig2.ext(), figlen);
bool complete = true;
rate_announce_fig(figtype, ext, complete);
diff --git a/src/figs.cpp b/src/figs.cpp
index 4a6729a..6f8a119 100644
--- a/src/figs.cpp
+++ b/src/figs.cpp
@@ -1,6 +1,6 @@
/*
Copyright (C) 2014 CSP Innovazione nelle ICT s.c.a r.l. (http://www.csp.it/)
- Copyright (C) 2017 Matthias P. Braendli (http://www.opendigitalradio.org)
+ Copyright (C) 2018 Matthias P. Braendli (http://www.opendigitalradio.org)
Copyright (C) 2015 Data Path
This program is free software: you can redistribute it and/or modify
@@ -110,3 +110,8 @@ fig_result_t fig0_select(fig0_common_t& fig0, const display_settings_t &disp)
return r;
}
+
+fig_result_t fig2_select(fig2_common_t& fig2, const display_settings_t &disp)
+{
+ return {};
+}
diff --git a/src/figs.hpp b/src/figs.hpp
index 64cfa48..bd144d7 100644
--- a/src/figs.hpp
+++ b/src/figs.hpp
@@ -1,6 +1,6 @@
/*
Copyright (C) 2014 CSP Innovazione nelle ICT s.c.a r.l. (http://www.csp.it/)
- Copyright (C) 2017 Matthias P. Braendli (http://www.opendigitalradio.org)
+ Copyright (C) 2018 Matthias P. Braendli (http://www.opendigitalradio.org)
Copyright (C) 2015 Data Path
This program is free software: you can redistribute it and/or modify
@@ -102,6 +102,29 @@ struct fig1_common_t {
uint8_t ext() { return f[0] & 0x07; }
};
+struct fig2_common_t {
+ fig2_common_t(
+ ensemble_database::ensemble_t &ens,
+ uint8_t* fig_data,
+ uint16_t fig_len) :
+ fibcrccorrect(true),
+ ensemble(ens),
+ f(fig_data),
+ figlen(fig_len) { }
+
+ // The ensemble only gets updated when the fib crc is ok
+ bool fibcrccorrect;
+ ensemble_database::ensemble_t& ensemble;
+
+ uint8_t* f;
+ uint16_t figlen;
+
+ uint8_t toggle_flag() { return (f[0] & 0x80) >> 7; }
+ uint8_t segment_index() { return (f[0] & 0x70) >> 4; }
+ uint16_t rfu() { return (f[0] & 0x08) >> 3; }
+ uint16_t ext() { return f[0] & 0x07; }
+};
+
// FIG 0/11 and 0/22 struct
struct Lat_Lng {
double latitude, longitude;
@@ -146,3 +169,5 @@ fig_result_t fig0_31(fig0_common_t& fig0, const display_settings_t &disp);
fig_result_t fig1_select(fig1_common_t& fig1, const display_settings_t &disp);
+fig_result_t fig2_select(fig2_common_t& fig2, const display_settings_t &disp);
+