summaryrefslogtreecommitdiffstats
path: root/src/fig
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-11-28 20:08:56 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-11-28 20:08:56 +0100
commit6800fb66282525542366bc58df3095b93e3bf8ca (patch)
treec6e7607b5090ceff1e69a1f0fff206b1a7a9c07b /src/fig
parent96b4dc4efca1b164f79a7f7394449866f034ac31 (diff)
downloaddabmux-6800fb66282525542366bc58df3095b93e3bf8ca.tar.gz
dabmux-6800fb66282525542366bc58df3095b93e3bf8ca.tar.bz2
dabmux-6800fb66282525542366bc58df3095b93e3bf8ca.zip
Remove service linking active from RC
This can be added later if the need arises, and when proper testing validates the implementation.
Diffstat (limited to 'src/fig')
-rw-r--r--src/fig/FIG0_6.cpp91
-rw-r--r--src/fig/FIG0_6.h32
-rw-r--r--src/fig/FIGCarousel.cpp2
-rw-r--r--src/fig/FIGCarousel.h1
4 files changed, 12 insertions, 114 deletions
diff --git a/src/fig/FIG0_6.cpp b/src/fig/FIG0_6.cpp
index 411d47c..5174ec2 100644
--- a/src/fig/FIG0_6.cpp
+++ b/src/fig/FIG0_6.cpp
@@ -210,21 +210,21 @@ void FIG0_6::update()
// TODO check if AMSS and DRM have to be put into a single subset
for (const auto& linkageset : m_rti->ensemble->linkagesets) {
- const auto lsn = linkageset->data.lsn;
+ const auto lsn = linkageset->lsn;
- for (const auto& link : linkageset->data.id_list) {
+ for (const auto& link : linkageset->id_list) {
const auto type = link.type;
const auto subset =
std::find_if(linkageSubsets.begin(), linkageSubsets.end(),
- [&](const LinkageSetData& l) {
+ [&](const LinkageSet& l) {
return not l.id_list.empty() and
l.lsn == lsn and l.id_list.front().type == type;
});
if (subset == linkageSubsets.end()) {
// A subset with that LSN and type does not exist yet
- linkageSubsets.push_back( linkageset->data.filter_type(type) );
+ linkageSubsets.push_back( linkageset->filter_type(type) );
}
}
}
@@ -266,88 +266,5 @@ void FIG0_6::update()
#endif
}
-
-FIG0_6_CEI::FIG0_6_CEI(FIGRuntimeInformation *rti) :
- m_rti(rti)
-{
-}
-
-FillStatus FIG0_6_CEI::fill(uint8_t *buf, size_t max_size)
-{
- using namespace std;
-
- auto ensemble = m_rti->ensemble;
-
- // We are called every 24ms, and must timeout after 5s
- const int timeout = 5000/24;
-
- m_transition.update_state(timeout, ensemble->linkagesets);
-
- FillStatus fs;
- ssize_t remaining = max_size;
-
- FIGtype0* fig0 = NULL;
-
- // Combine all links into one list
- set<LinkageSet*> alllinks;
- for (const auto& l : m_transition.new_entries) {
- alllinks.insert(l.first.get());
- }
- for (const auto& l : m_transition.repeated_entries) {
- alllinks.insert(l.get());
- }
- for (const auto& l : m_transition.disabled_entries) {
- alllinks.insert(l.first.get());
- }
-
- for (auto& link : alllinks) {
- const bool PD = false;
- const bool ILS = link->data.international;
-
- // The CEI does not send list contents
- const size_t num_ids = 0;
-
- const size_t headersize = sizeof(struct FIGtype0_6_header);
- const int required_size = sizeof(struct FIGtype0_6) + headersize +
- (num_ids > 0 ?
- (PD == 0 ? (ILS == 0 ? 2*num_ids : 3*num_ids) : 4*num_ids) :
- 0);
-
- if (fig0 == NULL) {
- if (remaining < 2 + required_size) {
- break;
- }
- fig0 = (FIGtype0*)buf;
- fig0->FIGtypeNumber = 0;
- fig0->Length = 1;
- fig0->CN = 1; // This is a CEI
- fig0->OE = 0;
- fig0->PD = PD;
- fig0->Extension = 6;
-
- buf += 2;
- remaining -= 2;
- }
- else if (remaining < required_size) {
- break;
- }
-
- FIGtype0_6 *fig0_6 = (FIGtype0_6*)buf;
-
- fig0_6->IdListFlag = (num_ids > 0);
- fig0_6->LA = link->data.active;
- fig0_6->SH = link->data.hard;
- fig0_6->ILS = ILS;
- fig0_6->setLSN(link->data.lsn);
-
- fig0->Length += sizeof(struct FIGtype0_6);
- buf += sizeof(struct FIGtype0_6);
- remaining -= sizeof(struct FIGtype0_6);
- }
-
- fs.complete_fig_transmitted = true;
- return fs;
-}
-
}
diff --git a/src/fig/FIG0_6.h b/src/fig/FIG0_6.h
index e970102..e7c81c5 100644
--- a/src/fig/FIG0_6.h
+++ b/src/fig/FIG0_6.h
@@ -30,10 +30,15 @@
#include <memory>
#include "fig/FIG0structs.h"
-#include "fig/TransitionHandler.h"
namespace FIC {
+/* TODO
+ * This FIG code is unable to transmit the CEI to announce
+ * activation/deactivation of linkage sets.
+ * The TransitionHandler.h would be useful for that purpose
+ */
+
// FIG type 0/6
// Service Linking
//
@@ -70,29 +75,8 @@ class FIG0_6 : public IFIG
* We reorganise all LinkageSets into subsets that have
* the same type.
*/
- std::vector<LinkageSetData> linkageSubsets;
- std::vector<LinkageSetData>::iterator linkageSetFIG0_6;
-};
-
-// FIG0/6 needs a change indicator, which is a short-form FIG (i.e. without the list)
-// and with C/N 1. Since this has another rate, it's implemented in another class.
-//
-// This is signalled once per second for a period of five seconds
-// (TS 103 176 5.2.4.3).
-class FIG0_6_CEI : public IFIG
-{
- public:
- FIG0_6_CEI(FIGRuntimeInformation* rti);
- virtual FillStatus fill(uint8_t *buf, size_t max_size);
- virtual FIG_rate repetition_rate(void) { return FIG_rate::B; }
-
- virtual const int figtype(void) const { return 0; }
- virtual const int figextension(void) const { return 6; }
-
- private:
- FIGRuntimeInformation *m_rti;
-
- TransitionHandler<LinkageSet> m_transition;
+ std::vector<LinkageSet> linkageSubsets;
+ std::vector<LinkageSet>::iterator linkageSetFIG0_6;
};
}
diff --git a/src/fig/FIGCarousel.cpp b/src/fig/FIGCarousel.cpp
index 2fc6718..ac2a80b 100644
--- a/src/fig/FIGCarousel.cpp
+++ b/src/fig/FIGCarousel.cpp
@@ -65,7 +65,6 @@ FIGCarousel::FIGCarousel(std::shared_ptr<dabEnsemble> ensemble) :
m_fig0_3(&m_rti),
m_fig0_5(&m_rti),
m_fig0_6(&m_rti),
- m_fig0_6_cei(&m_rti),
m_fig0_17(&m_rti),
m_fig0_8(&m_rti),
m_fig1_0(&m_rti),
@@ -97,7 +96,6 @@ FIGCarousel::FIGCarousel(std::shared_ptr<dabEnsemble> ensemble) :
load_and_allocate(m_fig0_3, FIBAllocation::FIB_ANY);
load_and_allocate(m_fig0_5, FIBAllocation::FIB_ANY);
load_and_allocate(m_fig0_6, FIBAllocation::FIB_ANY);
- load_and_allocate(m_fig0_6_cei, FIBAllocation::FIB_ANY);
load_and_allocate(m_fig0_8, FIBAllocation::FIB_ANY);
load_and_allocate(m_fig0_13, FIBAllocation::FIB_ANY);
diff --git a/src/fig/FIGCarousel.h b/src/fig/FIGCarousel.h
index 209fe19..f52f266 100644
--- a/src/fig/FIGCarousel.h
+++ b/src/fig/FIGCarousel.h
@@ -90,7 +90,6 @@ class FIGCarousel {
FIG0_3 m_fig0_3;
FIG0_5 m_fig0_5;
FIG0_6 m_fig0_6;
- FIG0_6_CEI m_fig0_6_cei;
FIG0_17 m_fig0_17;
FIG0_8 m_fig0_8;
FIG1_0 m_fig1_0;