aboutsummaryrefslogtreecommitdiffstats
path: root/figs.hpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-15 15:03:38 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-15 15:03:38 +0100
commit3576bfcd68ff58e022efc07ef8e1f1b757ccf6fb (patch)
treedd8b4ae93ce1b87260794022f56cf8892958692a /figs.hpp
parent275b55e39a84a3877e7e68b7c800bd0de28c128c (diff)
downloadetisnoop-3576bfcd68ff58e022efc07ef8e1f1b757ccf6fb.tar.gz
etisnoop-3576bfcd68ff58e022efc07ef8e1f1b757ccf6fb.tar.bz2
etisnoop-3576bfcd68ff58e022efc07ef8e1f1b757ccf6fb.zip
Refactor all FIG0/x into separate files
Diffstat (limited to 'figs.hpp')
-rw-r--r--figs.hpp96
1 files changed, 96 insertions, 0 deletions
diff --git a/figs.hpp b/figs.hpp
new file mode 100644
index 0000000..0e2efb8
--- /dev/null
+++ b/figs.hpp
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2014 CSP Innovazione nelle ICT s.c.a r.l. (http://www.csp.it/)
+ Copyright (C) 2016 Matthias P. Braendli (http://www.opendigitalradio.org)
+ Copyright (C) 2015 Data Path
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ Authors:
+ Sergio Sagliocco <sergio.sagliocco@csp.it>
+ Matthias P. Braendli <matthias@mpb.li>
+ / | |- ')|) |-|_ _ (|,_ .| _ ,_ \
+ Data Path \(|(||_(|/_| (||_||(a)_||||(|||.(_()|||/
+
+*/
+
+#pragma once
+
+#include <cstdint>
+#include "utils.hpp"
+#include "tables.hpp"
+#include "watermarkdecoder.hpp"
+
+void figs_cleardb(void);
+
+struct fig0_common_t {
+ fig0_common_t(
+ uint8_t* fig_data,
+ uint16_t fig_len,
+ WatermarkDecoder &wm_dec) :
+ f(fig_data),
+ figlen(fig_len),
+ wm_decoder(wm_dec) { }
+
+ uint8_t* f;
+ uint16_t figlen;
+ WatermarkDecoder &wm_decoder;
+
+ uint16_t cn(void) { return (f[0] & 0x80) >> 7; }
+ uint16_t oe(void) { return (f[0] & 0x40) >> 6; }
+ uint16_t pd(void) { return (f[0] & 0x20) >> 5; }
+ uint16_t ext(void) { return f[0] & 0x1F; }
+};
+
+// FIG 0/11 and 0/22 struct
+struct Lat_Lng {
+ double latitude, longitude;
+};
+
+// Which international table has been chosen
+size_t get_international_table(void);
+void set_international_table(size_t intl_table);
+
+// MID is used by some FIGs. It is signalled in LIDATA - FC - MID
+void set_mode_identity(uint8_t mid);
+uint8_t get_mode_identity();
+
+void fig0_select(fig0_common_t& fig0, int indent);
+
+void fig0_0(fig0_common_t& fig0, int indent);
+void fig0_1(fig0_common_t& fig0, int indent);
+void fig0_2(fig0_common_t& fig0, int indent);
+void fig0_3(fig0_common_t& fig0, int indent);
+void fig0_5(fig0_common_t& fig0, int indent);
+void fig0_6_cleardb();
+void fig0_6(fig0_common_t& fig0, int indent);
+void fig0_8(fig0_common_t& fig0, int indent);
+void fig0_9(fig0_common_t& fig0, int indent);
+void fig0_10(fig0_common_t& fig0, int indent);
+void fig0_11(fig0_common_t& fig0, int indent);
+void fig0_13(fig0_common_t& fig0, int indent);
+void fig0_14(fig0_common_t& fig0, int indent);
+void fig0_16(fig0_common_t& fig0, int indent);
+void fig0_17(fig0_common_t& fig0, int indent);
+void fig0_18(fig0_common_t& fig0, int indent);
+void fig0_19(fig0_common_t& fig0, int indent);
+void fig0_21(fig0_common_t& fig0, int indent);
+void fig0_22_cleardb();
+void fig0_22(fig0_common_t& fig0, int indent);
+void fig0_24(fig0_common_t& fig0, int indent);
+void fig0_25(fig0_common_t& fig0, int indent);
+void fig0_26(fig0_common_t& fig0, int indent);
+void fig0_27(fig0_common_t& fig0, int indent);
+void fig0_28(fig0_common_t& fig0, int indent);
+void fig0_31(fig0_common_t& fig0, int indent);
+