diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-04-01 11:49:24 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-04-01 11:49:24 +0200 |
commit | 553c9901d30ff793363091480928434f6e563e6e (patch) | |
tree | e25fda64c283829a4f8b3c3164ea8dddb6dad0d5 /src/ConfigParser.cpp | |
parent | 2ed49ee65a76a3917eda653c52a69bfc5e17ee0e (diff) | |
parent | 4593733275789f576a95400feb02eaba7a3ae830 (diff) | |
download | dabmux-553c9901d30ff793363091480928434f6e563e6e.tar.gz dabmux-553c9901d30ff793363091480928434f6e563e6e.tar.bz2 dabmux-553c9901d30ff793363091480928434f6e563e6e.zip |
Merge PR 45 with Alarm Handling
Diffstat (limited to 'src/ConfigParser.cpp')
-rw-r--r-- | src/ConfigParser.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index 4240add..30140bf 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -504,10 +504,15 @@ static void parse_general(ptree& pt, auto cl = make_shared<AnnouncementCluster>(name); cl->cluster_id = hexparse(pt_announcement.get<string>("cluster")); - if (cl->cluster_id == 0 or cl->cluster_id == 0xFF) { + if (cl->cluster_id == 0) { throw runtime_error("Announcement cluster id " + to_string(cl->cluster_id) + " is not allowed"); } + if (cl->cluster_id == 255) { + etiLog.level(debug) << + "Alarm flag for FIG 0/0 is set 1, because announcement group with cluster id oxFF is found."; + ensemble->alarm_flag = 1; + } cl->flags = get_announcement_flag_from_ptree( pt_announcement.get_child("flags")); cl->subchanneluid = pt_announcement.get<string>("subchannel"); @@ -574,7 +579,13 @@ void parse_ptree( continue; } try { - service->clusters.push_back(hexparse(cluster_s)); + auto cluster_id = hexparse(cluster_s); + if (cluster_id == 255) { + etiLog.level(warn) << "Announcement cluster id " + + to_string(cluster_id) + " is not allowed and is ignored in FIG 0/18."; + continue; + } + service->clusters.push_back(cluster_id); } catch (const std::exception& e) { etiLog.level(warn) << "Cannot parse '" << clusterlist << |