aboutsummaryrefslogtreecommitdiffstats
path: root/src/fig
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-08-16 16:37:38 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-08-16 16:37:38 +0200
commitd57f046c40e716069d37f9e6b7911afd41c7b116 (patch)
treefd7cec78dd7fd8c3e195aab2a3a01c9525fd37bb /src/fig
parent76bd144a8bbedfceceeb9ad2975a3d3f9436e311 (diff)
downloaddabmux-d57f046c40e716069d37f9e6b7911afd41c7b116.tar.gz
dabmux-d57f046c40e716069d37f9e6b7911afd41c7b116.tar.bz2
dabmux-d57f046c40e716069d37f9e6b7911afd41c7b116.zip
Add support for sending empty linkage sets to clear receiver databases
Diffstat (limited to 'src/fig')
-rw-r--r--src/fig/FIG0_6.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/fig/FIG0_6.cpp b/src/fig/FIG0_6.cpp
index b7776f4..8af8ded 100644
--- a/src/fig/FIG0_6.cpp
+++ b/src/fig/FIG0_6.cpp
@@ -80,8 +80,11 @@ FillStatus FIG0_6::fill(uint8_t *buf, size_t max_size)
const bool PD = false;
const bool ILS = linkageSetFIG0_6->international;
- // need to add key service to num_ids
- const size_t num_ids = 1 + linkageSetFIG0_6->id_list.size();
+ // need to add key service to num_ids, unless it is empty which means we
+ // send a CEI
+ const size_t num_ids = linkageSetFIG0_6->keyservice.empty() ?
+ // do not transmit list if keyservice empty, it should anyway be empty
+ 0 : (1 + linkageSetFIG0_6->id_list.size());
if (num_ids > 0x0F) {
etiLog.log(error,
@@ -117,7 +120,7 @@ FillStatus FIG0_6::fill(uint8_t *buf, size_t max_size)
FIGtype0_6 *fig0_6 = (FIGtype0_6*)buf;
- fig0_6->IdListFlag = (num_ids > 0);
+ fig0_6->IdListFlag = (num_ids > 0); // C/N=0 and IdListFlag=0 is CEI
fig0_6->LA = linkageSetFIG0_6->active;
fig0_6->SH = linkageSetFIG0_6->hard;
fig0_6->ILS = ILS;
@@ -127,6 +130,10 @@ FillStatus FIG0_6::fill(uint8_t *buf, size_t max_size)
buf += sizeof(struct FIGtype0_6);
remaining -= sizeof(struct FIGtype0_6);
+ etiLog.log(debug,
+ "Linkage set 0x%04x wrote %d",
+ linkageSetFIG0_6->lsn, fig0->Length);
+
if (num_ids > 0) {
FIGtype0_6_header *header = (FIGtype0_6_header*)buf;
header->rfu = 0;
@@ -243,7 +250,10 @@ void FIG0_6::update()
for (const auto& linkageset : m_rti->ensemble->linkagesets) {
const auto lsn = linkageset->lsn;
- for (const auto& link : linkageset->id_list) {
+ if (linkageset->keyservice.empty()) {
+ linkageSubsets.push_back(*linkageset);
+ }
+ else for (const auto& link : linkageset->id_list) {
const auto type = link.type;
const auto subset =