diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-03-11 14:58:05 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-03-11 14:58:05 +0100 |
commit | 5340215304193f18af3bc76c7ae7a6a79f008339 (patch) | |
tree | 2f702ce20225c8a345df677b223faf387dac6d1b /src/MuxElements.cpp | |
parent | ccbb69188c53eb693853969327bd081c73f02552 (diff) | |
download | dabmux-5340215304193f18af3bc76c7ae7a6a79f008339.tar.gz dabmux-5340215304193f18af3bc76c7ae7a6a79f008339.tar.bz2 dabmux-5340215304193f18af3bc76c7ae7a6a79f008339.zip |
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.
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r-- | src/MuxElements.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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, |