diff options
-rw-r--r-- | doc/servicelinking.mux | 5 | ||||
-rw-r--r-- | src/fig/FIG0_6.cpp | 24 |
2 files changed, 18 insertions, 11 deletions
diff --git a/doc/servicelinking.mux b/doc/servicelinking.mux index 7fd90ba..b9a64d9 100644 --- a/doc/servicelinking.mux +++ b/doc/servicelinking.mux @@ -7,7 +7,7 @@ ; general { dabmode 1 - nbframes 0 + nbframes 10000 syslog false tist false @@ -132,7 +132,6 @@ components { } outputs { - tcp "tcp://0.0.0.0:9200" - throttle "simul://" + file "file://./test.eti?type=raw" } diff --git a/src/fig/FIG0_6.cpp b/src/fig/FIG0_6.cpp index 8c0e53d..fa8cbfa 100644 --- a/src/fig/FIG0_6.cpp +++ b/src/fig/FIG0_6.cpp @@ -104,7 +104,22 @@ FillStatus FIG0_6::fill(uint8_t *buf, size_t max_size) throw MuxInitException(); } - header->IdLQ = 0; // TODO not only DAB + // update() guarantees us that all entries in a linkage set + // have the same type + for (const auto& l : linkageSetFIG0_6->id_list) { + if (l.type != linkageSetFIG0_6->id_list.front().type) { + etiLog.log(error, "INTERNAL ERROR: invalid linkage subset 0x%04x", + linkageSetFIG0_6->lsn); + throw std::runtime_error("INTERNAL ERROR"); + } + } + + switch (linkageSetFIG0_6->id_list.front().type) { + case ServiceLinkType::DAB: header->IdLQ = FIG0_6_IDLQ_DAB; break; + case ServiceLinkType::FM: header->IdLQ = FIG0_6_IDLQ_RDS; break; + case ServiceLinkType::DRM: header->IdLQ = FIG0_6_IDLQ_DRM_AMSS; break; + case ServiceLinkType::AMSS: header->IdLQ = FIG0_6_IDLQ_DRM_AMSS; break; + } header->rfa = 0; header->num_ids = num_ids; @@ -126,13 +141,6 @@ FillStatus FIG0_6::fill(uint8_t *buf, size_t max_size) keyserviceuid.c_str(), linkageSetFIG0_6->lsn); throw MuxInitException(); } - for (const auto& l : linkageSetFIG0_6->id_list) { - if (l.type != ServiceLinkType::DAB) { - etiLog.log(error, "TODO only DAB links supported. (linkage set 0x%04x)", - linkageSetFIG0_6->lsn); - throw MuxInitException(); - } - } if (not PD and not ILS) { buf[0] = (*keyservice)->id >> 8; |