summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-11-02 14:01:00 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-11-02 14:01:00 +0100
commit57fb9afea4c1db9d33c4ba94a681a36b0f80af40 (patch)
tree2ff9d435f765b8dbc5feb86855cdc37f9e4993ca /src
parent1a04e4ba650099538e7790c1a2f33fe4267831e4 (diff)
downloaddabmux-57fb9afea4c1db9d33c4ba94a681a36b0f80af40.tar.gz
dabmux-57fb9afea4c1db9d33c4ba94a681a36b0f80af40.tar.bz2
dabmux-57fb9afea4c1db9d33c4ba94a681a36b0f80af40.zip
FIG0/13 fix user application data length for packet subchannels
Diffstat (limited to 'src')
-rw-r--r--src/fig/FIG0_13.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/fig/FIG0_13.cpp b/src/fig/FIG0_13.cpp
index 2fa9a54..5cd046c 100644
--- a/src/fig/FIG0_13.cpp
+++ b/src/fig/FIG0_13.cpp
@@ -101,26 +101,23 @@ FillStatus FIG0_13::fill(uint8_t *buf, size_t max_size)
const size_t num_apps = uaTypes.size();
- const size_t xpadapp_length = 2;
static_assert(sizeof(FIG0_13_shortAppInfo) == 3);
static_assert(sizeof(FIG0_13_longAppInfo) == 5);
static_assert(sizeof(FIG0_13_app) == 2);
+ size_t xpaddata_length = 0;
int required_size = 0;
if (m_transmit_programme) {
required_size += sizeof(FIG0_13_shortAppInfo);
+ xpaddata_length = 2; // CAOrg is always absent
}
else {
required_size += sizeof(FIG0_13_longAppInfo);
+ xpaddata_length = 0; // X-PAD data field is absent
}
for (const auto& ua : uaTypes) {
- if (m_transmit_programme) {
- required_size += sizeof(FIG0_13_app) + xpadapp_length;
- }
- else {
- required_size += sizeof(FIG0_13_app);
- }
+ required_size += sizeof(FIG0_13_app) + xpaddata_length;
if (ua.uaType == FIG0_13_APPTYPE_SPI) {
required_size += 2; // For the "basic profile" user application data
@@ -167,7 +164,7 @@ FillStatus FIG0_13::fill(uint8_t *buf, size_t max_size)
for (const auto& ua : uaTypes) {
FIG0_13_app* app = (FIG0_13_app*)buf;
app->setType(ua.uaType);
- app->length = xpadapp_length;
+ app->length = xpaddata_length;
if (ua.uaType == FIG0_13_APPTYPE_SPI) {
app->length += 2;
}