aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-02 15:50:58 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-02 15:50:58 +0200
commit0fa7f1d17cd8554db8e3d3bbe7603495b2ac07c7 (patch)
treead859d6a5893d15a215d648e5941ea03f63be3ca /src
parent5736f17d34ffc86aeedb95cf652968eadf256051 (diff)
downloaddabmux-0fa7f1d17cd8554db8e3d3bbe7603495b2ac07c7.tar.gz
dabmux-0fa7f1d17cd8554db8e3d3bbe7603495b2ac07c7.tar.bz2
dabmux-0fa7f1d17cd8554db8e3d3bbe7603495b2ac07c7.zip
Set IdLQ properly in FIG0/6
Diffstat (limited to 'src')
-rw-r--r--src/fig/FIG0_6.cpp24
1 files changed, 16 insertions, 8 deletions
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;