From 07b303a738c82c53c835221f675d6d3b82948357 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 17 Feb 2018 17:12:56 +0100 Subject: Add OE=1 support for FrequencyInformation --- src/fig/FIG0_21.cpp | 19 +++++++++++++++---- src/fig/FIG0_21.h | 5 +++-- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'src/fig') 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 >::iterator freqInfoFIG0_21; -- cgit v1.2.3