summaryrefslogtreecommitdiffstats
path: root/src/fig/FIG0_6.cpp
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/FIG0_6.cpp
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/FIG0_6.cpp')
-rw-r--r--src/fig/FIG0_6.cpp91
1 files changed, 4 insertions, 87 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;
-}
-
}