summaryrefslogtreecommitdiffstats
path: root/src/MuxElements.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-21 16:10:36 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-21 16:10:36 +0100
commit9b5dad36648022a1d78f4060a30edc0fb8e32001 (patch)
treef36eadec48d78a61da6501f45748175eadedb0fd /src/MuxElements.cpp
parent3fd45e66348aff78f189795414d4480813a19fb5 (diff)
downloaddabmux-9b5dad36648022a1d78f4060a30edc0fb8e32001.tar.gz
dabmux-9b5dad36648022a1d78f4060a30edc0fb8e32001.tar.bz2
dabmux-9b5dad36648022a1d78f4060a30edc0fb8e32001.zip
Check Linkage set key service on startup
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r--src/MuxElements.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp
index 954e712..ef04507 100644
--- a/src/MuxElements.cpp
+++ b/src/MuxElements.cpp
@@ -650,6 +650,27 @@ const string dabEnsemble::get_parameter(const string& parameter) const
return ss.str();
}
+bool dabEnsemble::validate_linkage_sets()
+{
+ for (const auto& ls : linkagesets) {
+ const std::string keyserviceuid = ls->keyservice;
+ const auto& keyservice = std::find_if(
+ services.cbegin(),
+ services.cend(),
+ [&](const std::shared_ptr<DabService>& srv) {
+ return srv->uid == keyserviceuid;
+ });
+
+ if (keyservice == services.end()) {
+ etiLog.log(error, "Invalid key service %s in linkage set 0x%04x",
+ keyserviceuid.c_str(), ls->lsn);
+ return false;
+ }
+ }
+
+ return true;
+}
+
unsigned short DabSubchannel::getSizeCu() const
{
if (protection.form == UEP) {