summaryrefslogtreecommitdiffstats
path: root/src/fig
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-17 17:12:56 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-17 17:12:56 +0100
commit07b303a738c82c53c835221f675d6d3b82948357 (patch)
tree06760b26a8320f685d2ca682f5490be97dc1ceb5 /src/fig
parent131cbad6d9d368e4eee0206dbccfd6ecfd023fa1 (diff)
downloaddabmux-07b303a738c82c53c835221f675d6d3b82948357.tar.gz
dabmux-07b303a738c82c53c835221f675d6d3b82948357.tar.bz2
dabmux-07b303a738c82c53c835221f675d6d3b82948357.zip
Add OE=1 support for FrequencyInformation
Diffstat (limited to 'src/fig')
-rw-r--r--src/fig/FIG0_21.cpp19
-rw-r--r--src/fig/FIG0_21.h5
2 files changed, 18 insertions, 6 deletions
diff --git a/src/fig/FIG0_21.cpp b/src/fig/FIG0_21.cpp
index ad56439..1972a19 100644
--- a/src/fig/FIG0_21.cpp
+++ b/src/fig/FIG0_21.cpp
@@ -3,7 +3,7 @@
2011, 2012 Her Majesty the Queen in Right of Canada (Communications
Research Center Canada)
- Copyright (C) 2017
+ Copyright (C) 2018
Matthias P. Braendli, matthias.braendli@mpb.li
*/
/*
@@ -69,8 +69,7 @@ struct FIGtype0_21_fi_dab_entry {
FIG0_21::FIG0_21(FIGRuntimeInformation *rti) :
- m_rti(rti),
- m_initialised(false)
+ m_rti(rti)
{
}
@@ -86,6 +85,10 @@ FillStatus FIG0_21::fill(uint8_t *buf, size_t max_size)
if (not m_initialised) {
freqInfoFIG0_21 = ensemble->frequency_information.begin();
+
+ if (freqInfoFIG0_21 != ensemble->frequency_information.end()) {
+ m_last_oe = (*freqInfoFIG0_21)->other_ensemble;
+ }
m_initialised = true;
}
@@ -120,6 +123,14 @@ FillStatus FIG0_21::fill(uint8_t *buf, size_t max_size)
etiLog.level(FIG0_21_TRACE) << "FIG0_21::loop " << (*freqInfoFIG0_21)->uid;
+ if (m_last_oe != (*freqInfoFIG0_21)->other_ensemble) {
+ // Trigger resend of FIG0 when OE changes
+ fig0 = nullptr;
+ m_last_oe = (*freqInfoFIG0_21)->other_ensemble;
+ etiLog.level(FIG0_21_TRACE) << "FIG0_21::switch OE to " <<
+ (*freqInfoFIG0_21)->other_ensemble;
+ }
+
if (fig0 == nullptr) {
if (remaining < 2 + required_size) {
etiLog.level(FIG0_21_TRACE) << "FIG0_21::no space for fig0";
@@ -132,7 +143,7 @@ FillStatus FIG0_21::fill(uint8_t *buf, size_t max_size)
// Database start or continuation flag, EN 300 401 Clause 5.2.2.1 part b)
fig0->CN =
(freqInfoFIG0_21 == ensemble->frequency_information.begin() ? 0 : 1);
- fig0->OE = 0;
+ fig0->OE = (*freqInfoFIG0_21)->other_ensemble ? 1 : 0;
fig0->PD = false;
fig0->Extension = 21;
diff --git a/src/fig/FIG0_21.h b/src/fig/FIG0_21.h
index a321541..018727a 100644
--- a/src/fig/FIG0_21.h
+++ b/src/fig/FIG0_21.h
@@ -3,7 +3,7 @@
2011, 2012 Her Majesty the Queen in Right of Canada (Communications
Research Center Canada)
- Copyright (C) 2017
+ Copyright (C) 2018
Matthias P. Braendli, matthias.braendli@mpb.li
*/
/*
@@ -46,7 +46,8 @@ class FIG0_21 : public IFIG
private:
FIGRuntimeInformation *m_rti;
- bool m_initialised;
+ bool m_initialised = false;
+ bool m_last_oe = false;
std::vector<std::shared_ptr<FrequencyInformation> >::iterator
freqInfoFIG0_21;