From 12f38eb6c66ea34fd062fb3b639f3359a55284fb Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 21 Feb 2024 16:32:45 +0100 Subject: Add uatype journaline to config --- doc/advanced.mux | 3 +++ src/ConfigParser.cpp | 4 ++++ src/fig/FIG0_13.cpp | 16 +++++++++++++--- src/fig/FIG0structs.h | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/advanced.mux b/doc/advanced.mux index 61328d7..95e6902 100644 --- a/doc/advanced.mux +++ b/doc/advanced.mux @@ -332,6 +332,9 @@ components { ; 0xFF "unrestricted profile" ; Only for packet-mode, not X-PAD. userapp "website" + + ; Journaline, adds uaType 0x44a and user application data 0x00 0x00 (TS 102 979 Clause 8.1.2) + userapp "journaline" } ; Deprecated figtype setting: diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index a845bef..74e627b 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -833,6 +833,10 @@ void parse_ptree( ua.uaType = FIG0_13_APPTYPE_WEBSITE; ua.xpadAppType = 12; } + else if (ua_value == "journaline") { + ua.uaType = FIG0_13_APPTYPE_JOURNALINE; + ua.xpadAppType = 12; + } if (component->isPacketComponent(ensemble->subchannels)) { component->packet.uaTypes.push_back(ua); diff --git a/src/fig/FIG0_13.cpp b/src/fig/FIG0_13.cpp index 4233302..097b2ae 100644 --- a/src/fig/FIG0_13.cpp +++ b/src/fig/FIG0_13.cpp @@ -3,7 +3,7 @@ 2011, 2012 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2022 + Copyright (C) 2024 Matthias P. Braendli, matthias.braendli@mpb.li */ /* @@ -122,7 +122,8 @@ FillStatus FIG0_13::fill(uint8_t *buf, size_t max_size) if (ua.uaType == FIG0_13_APPTYPE_SPI) { required_size += 1; } - else if (ua.uaType == FIG0_13_APPTYPE_WEBSITE) { + else if (ua.uaType == FIG0_13_APPTYPE_WEBSITE || + ua.uaType == FIG0_13_APPTYPE_JOURNALINE) { required_size += 2; } } @@ -171,7 +172,8 @@ FillStatus FIG0_13::fill(uint8_t *buf, size_t max_size) if (ua.uaType == FIG0_13_APPTYPE_SPI) { app->length += 1; } - else if (ua.uaType == FIG0_13_APPTYPE_WEBSITE) { + else if (ua.uaType == FIG0_13_APPTYPE_WEBSITE || + ua.uaType == FIG0_13_APPTYPE_JOURNALINE) { app->length += 2; } @@ -211,6 +213,14 @@ FillStatus FIG0_13::fill(uint8_t *buf, size_t max_size) remaining -= 2; fig0->Length += 2; } + else if (ua.uaType == FIG0_13_APPTYPE_JOURNALINE) { + // According to ETSI TS 102 979 Clause 8.1.2 + buf[0] = 0x00; + buf[1] = 0x00; + buf += 2; + remaining -= 2; + fig0->Length += 2; + } } } } diff --git a/src/fig/FIG0structs.h b/src/fig/FIG0structs.h index a82e59e..eb77df4 100644 --- a/src/fig/FIG0structs.h +++ b/src/fig/FIG0structs.h @@ -38,7 +38,7 @@ #define FIG0_13_APPTYPE_TMC 0x6 #define FIG0_13_APPTYPE_SPI 0x7 #define FIG0_13_APPTYPE_DABJAVA 0x8 -#define FIG0_13_APPTYPE_JOURNALINE 0x441 +#define FIG0_13_APPTYPE_JOURNALINE 0x44a struct FIGtype0 { -- cgit v1.2.3