summaryrefslogtreecommitdiffstats
path: root/src/DabMultiplexer.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-03 08:51:42 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-03 08:51:42 +0200
commit85853c4ae5e48359feac44370b4c0f05fbb23147 (patch)
treec8f72bf013f6a9b687c5c5d0f4622f24a3cff983 /src/DabMultiplexer.cpp
parent93cb9dc6d1492ac2ed58c24a016b579813177a13 (diff)
downloaddabmux-85853c4ae5e48359feac44370b4c0f05fbb23147.tar.gz
dabmux-85853c4ae5e48359feac44370b4c0f05fbb23147.tar.bz2
dabmux-85853c4ae5e48359feac44370b4c0f05fbb23147.zip
Move some EDI things around
Diffstat (limited to 'src/DabMultiplexer.cpp')
-rw-r--r--src/DabMultiplexer.cpp48
1 files changed, 34 insertions, 14 deletions
diff --git a/src/DabMultiplexer.cpp b/src/DabMultiplexer.cpp
index 71a8b4b..4ca93aa 100644
--- a/src/DabMultiplexer.cpp
+++ b/src/DabMultiplexer.cpp
@@ -128,13 +128,45 @@ void DabMultiplexer::update_config(boost::property_tree::ptree pt)
void DabMultiplexer::reconfigure()
{
- parse_ptree(m_pt_next, ensemble_next, m_rc, &edi_conf);
+ parse_ptree(m_pt_next, ensemble_next, m_rc);
}
+void DabMultiplexer::set_edi_config(const edi_configuration_t& new_edi_conf)
+{
+ edi_conf = new_edi_conf;
+
+#if HAVE_OUTPUT_EDI
+ if (edi_conf.verbose) {
+ etiLog.log(info, "Setup EDI");
+ }
+
+ if (edi_conf.dump) {
+ edi_debug_file.open("./edi.debug");
+ }
+
+ if (edi_conf.enabled) {
+ edi_output.create(edi_conf.source_port);
+ }
+
+ if (edi_conf.verbose) {
+ etiLog.log(info, "EDI set up");
+ }
+
+ // The TagPacket will then be placed into an AFPacket
+ AFPacketiser afPacketiser;
+ edi_afPacketiser = afPacketiser;
+
+ // The AF Packet will be protected with reed-solomon and split in fragments
+ PFT pft(207, 3, edi_conf);
+ edi_pft = pft;
+#endif
+}
+
+
// Run a set of checks on the configuration
void DabMultiplexer::prepare()
{
- parse_ptree(m_pt, ensemble, m_rc, &edi_conf);
+ parse_ptree(m_pt, ensemble, m_rc);
ensemble->enrol_at(m_rc);
@@ -180,18 +212,6 @@ void DabMultiplexer::prepare()
* synchronisation is preserved.
*/
gettimeofday(&mnsc_time, NULL);
-
-#if HAVE_OUTPUT_EDI
- // Defaults for edi
- edi_conf.enabled = db.get_numeric("output.edi.enabled", 0) == 1;
- if (edi_conf.enabled) {
- edi_conf.dest_addr = db.get("output.edi.dest_addr");
- edi_conf.dest_port = db.get_numeric("output.edi.dest_port");
- edi_conf.source_port = db.get_numeric("output.edi.source_port");
- edi_conf.dump = db.get_numeric("output.edi.dump") == 1;
- edi_conf.enable_pft = db.get_numeric("output.edi.enable_pft") == 1;
- }
-#endif // HAVE_OUTPUT_EDI
}