aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ConfigParser.cpp5
-rw-r--r--src/fig/FIG0.cpp31
2 files changed, 23 insertions, 13 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 1176efe..38a4efb 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -134,6 +134,8 @@ uint16_t get_announcement_flag_from_ptree(
std::string announcement_name(annoucement_flags_names[flag]);
bool flag_set = pt.get<bool>(announcement_name, false);
+ cerr << " CHECK FOR " << announcement_name << " " << flag_set << endl;
+
if (flag_set) {
flags |= (1 << flag);
}
@@ -243,7 +245,8 @@ void parse_ptree(boost::property_tree::ptree& pt,
auto cl = make_shared<AnnouncementCluster>(name);
cl->cluster_id = pt_announcement.get<uint8_t>("cluster");
- cl->flags = get_announcement_flag_from_ptree(pt_announcement);
+ cl->flags = get_announcement_flag_from_ptree(
+ pt_announcement.get_child("flags"));
cl->subchanneluid = pt_announcement.get<string>("subchannel");
cl->enrol_at(*rc);
diff --git a/src/fig/FIG0.cpp b/src/fig/FIG0.cpp
index eec09b0..6c3b6dc 100644
--- a/src/fig/FIG0.cpp
+++ b/src/fig/FIG0.cpp
@@ -955,12 +955,12 @@ FillStatus FIG0_18::fill(uint8_t *buf, size_t max_size)
const ssize_t numclusters = (*service)->clusters.size();
- if (remaining < (int)sizeof(FIGtype0_18) + numclusters) {
+ if (remaining < 5 + numclusters) {
break;
}
if (fig0 == NULL) {
- if (remaining < 2 + (int)sizeof(FIGtype0_18) + numclusters) {
+ if (remaining < 2 + 5 + numclusters) {
break;
}
@@ -980,14 +980,14 @@ FillStatus FIG0_18::fill(uint8_t *buf, size_t max_size)
programme->ASu = htons((*service)->ASu);
programme->Rfa = 0;
programme->NumClusters = numclusters;
- buf += sizeof(FIGtype0_18);
+ buf += 5;
for (uint8_t cluster : (*service)->clusters) {
*(buf++) = cluster;
}
- fig0->Length += sizeof(FIGtype0_18) + numclusters;
- remaining -= sizeof(FIGtype0_18) + numclusters;
+ fig0->Length += 5 + numclusters;
+ remaining -= 5 + numclusters;
}
fs.num_bytes_written = max_size - remaining;
@@ -1012,6 +1012,8 @@ FillStatus FIG0_19::fill(uint8_t *buf, size_t max_size)
auto ensemble = m_rti->ensemble;
FIGtype0* fig0 = NULL;
+
+ // Combine all clusters into one list
set<AnnouncementCluster*> allclusters;
for (const auto& cluster : m_new_announcements) {
allclusters.insert(cluster.first.get());
@@ -1026,13 +1028,14 @@ FillStatus FIG0_19::fill(uint8_t *buf, size_t max_size)
fs.complete_fig_transmitted = true;
for (const auto& cluster : allclusters) {
- if (remaining < (int)sizeof(FIGtype0_19)) {
+ if (remaining < 6) {
fs.complete_fig_transmitted = false;
break;
}
if (fig0 == NULL) {
- if (remaining < 2 + (int)sizeof(FIGtype0_19)) {
+ if (remaining < 2 + 6) {
+ fs.complete_fig_transmitted = false;
break;
}
@@ -1061,9 +1064,6 @@ FillStatus FIG0_19::fill(uint8_t *buf, size_t max_size)
bool found = false;
for (const auto& subchannel : ensemble->subchannels) {
- cerr << "*****" << subchannel->uid << " vs " <<
- cluster->subchanneluid << endl;
-
if (subchannel->uid == cluster->subchanneluid) {
fig0_19->SubChId = subchannel->id;
found = true;
@@ -1077,10 +1077,16 @@ FillStatus FIG0_19::fill(uint8_t *buf, size_t max_size)
continue;
}
- buf += sizeof(FIGtype0_19);
- remaining -= sizeof(FIGtype0_19);
+ buf += 6;
+ remaining -= 6;
}
+ if (not fs.complete_fig_transmitted) {
+ etiLog.level(warn) << "FIG0/19 incomplete!";
+ }
+ else {
+ etiLog.level(warn) << "FIG0/19 complete " << remaining;
+ }
fs.num_bytes_written = max_size - remaining;
return fs;
}
@@ -1092,6 +1098,7 @@ void FIG0_19::update_state()
// We are called every 24ms, and must timeout after 2s
const int timeout = 2000/24;
+#define DEBUG_FIG0_19
#ifdef DEBUG_FIG0_19
etiLog.level(info) << " FIG0/19 new";
for (const auto& cluster : m_new_announcements) {