diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-01-22 14:08:58 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-01-22 14:08:58 +0100 |
commit | 74e2beb5b80470a26054c8c51665996b10303f68 (patch) | |
tree | 55032f4b62aea432d03c8a49adfab51740b4640b /fig0_5.cpp | |
parent | e05c1b5903709651aac348fd5144de3ccbbd77a3 (diff) | |
download | etisnoop-74e2beb5b80470a26054c8c51665996b10303f68.tar.gz etisnoop-74e2beb5b80470a26054c8c51665996b10303f68.tar.bz2 etisnoop-74e2beb5b80470a26054c8c51665996b10303f68.zip |
Add repetition rate analyser
Diffstat (limited to 'fig0_5.cpp')
-rw-r--r-- | fig0_5.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -28,16 +28,34 @@ #include <cstdio> #include <cstring> #include <map> +#include <unordered_set> + +static std::unordered_set<int> components_seen; + +bool fig0_5_is_complete(int components_id) +{ + bool complete = components_seen.count(components_id); + + if (complete) { + components_seen.clear(); + } + else { + components_seen.insert(components_id); + } + + return complete; +} // FIG 0/5 Service component language // ETSI EN 300 401 8.1.2 -void fig0_5(fig0_common_t& fig0, int indent) +bool fig0_5(fig0_common_t& fig0, int indent) { uint16_t SCId; uint8_t i = 1, SubChId, FIDCId, Language, Rfa; char tmpbuf[256]; char desc[256]; bool LS_flag, MSC_FIC_flag; + bool complete = false; uint8_t* f = fig0.f; @@ -62,6 +80,9 @@ void fig0_5(fig0_common_t& fig0, int indent) LS_flag, MSC_FIC_flag, FIDCId, Language, get_language_name(Language)); } + + int key = (MSC_FIC_flag << 7) | (f[i] % 0x3F); + complete |= fig0_5_is_complete(key); printbuf(desc, indent+1, NULL, 0); i += 2; } @@ -70,6 +91,8 @@ void fig0_5(fig0_common_t& fig0, int indent) if (i < (fig0.figlen - 2)) { Rfa = (f[i] >> 4) & 0x07; SCId = (((uint16_t)f[i] & 0x0F) << 8) | (uint16_t)f[i+1]; + int key = (LS_flag << 15) | SCId; + complete |= fig0_5_is_complete(key); Language = f[i+2]; sprintf(desc, "L/S flag=%d long form", LS_flag); if (Rfa != 0) { @@ -85,5 +108,7 @@ void fig0_5(fig0_common_t& fig0, int indent) i += 3; } } + + return complete; } |