aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-04-01 11:49:24 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-04-01 11:49:24 +0200
commit553c9901d30ff793363091480928434f6e563e6e (patch)
treee25fda64c283829a4f8b3c3164ea8dddb6dad0d5 /src
parent2ed49ee65a76a3917eda653c52a69bfc5e17ee0e (diff)
parent4593733275789f576a95400feb02eaba7a3ae830 (diff)
downloaddabmux-553c9901d30ff793363091480928434f6e563e6e.tar.gz
dabmux-553c9901d30ff793363091480928434f6e563e6e.tar.bz2
dabmux-553c9901d30ff793363091480928434f6e563e6e.zip
Merge PR 45 with Alarm Handling
Diffstat (limited to 'src')
-rw-r--r--src/ConfigParser.cpp15
-rw-r--r--src/MuxElements.h4
-rw-r--r--src/fig/FIG0_0.cpp2
3 files changed, 18 insertions, 3 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 <<
diff --git a/src/MuxElements.h b/src/MuxElements.h
index 98de70e..77d417b 100644
--- a/src/MuxElements.h
+++ b/src/MuxElements.h
@@ -337,6 +337,10 @@ class dabEnsemble : public RemoteControllable {
static constexpr int RECONFIG_COUNTER_HASH = -2;
int reconfig_counter = RECONFIG_COUNTER_DISABLED;
+ // alarm flag is use for AL flag in FIG 0/0.
+ // set to true if one announcement group with cluster ID 0xFF is available in multiplex file
+ bool alarm_flag = 0;
+
vec_sp_service services;
vec_sp_component components;
vec_sp_subchannel subchannels;
diff --git a/src/fig/FIG0_0.cpp b/src/fig/FIG0_0.cpp
index 9a99984..a793b98 100644
--- a/src/fig/FIG0_0.cpp
+++ b/src/fig/FIG0_0.cpp
@@ -67,7 +67,7 @@ FillStatus FIG0_0::fill(uint8_t *buf, size_t max_size)
fig0_0->EId = htons(m_rti->ensemble->id);
fig0_0->Change = 0;
- fig0_0->Al = 0;
+ fig0_0->Al = m_rti->ensemble->alarm_flag;
fig0_0->CIFcnt_hight = (m_rti->currentFrame / 250) % 20;
fig0_0->CIFcnt_low = (m_rti->currentFrame % 250);