From 5340215304193f18af3bc76c7ae7a6a79f008339 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 11 Mar 2020 14:58:05 +0100 Subject: Implement a hash function to calculate FIG 0/7 Count field This might not be strictly standards compliant, but it avoids having to save state across mux restarts and doesn't place the burden of incrementing the number on the operator. --- src/MuxElements.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/MuxElements.cpp') diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index 81466a8..cb2d545 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -400,6 +400,16 @@ vec_sp_component::iterator getComponent( return components.end(); } +uint8_t dabProtection::to_tpl() const +{ + if (form == UEP) { + return 0x10 | ProtectionLevelTable[uep.tableIndex]; + } + else if (form == EEP) { + return 0x20 | (eep.GetOption() << 2) | level; + } + throw logic_error("Invalid protection form"); +} vec_sp_component::iterator getComponent( vec_sp_component& components, -- cgit v1.2.3