diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-03-11 10:38:53 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-03-11 10:39:11 +0100 |
commit | b5d43cff287d75de370ee94193b1162b5ab1038c (patch) | |
tree | 779e4ac7c0eb92f661be34144b551074d353dc00 /src/fig/FIG0_7.cpp | |
parent | 79d31b0dfc67e33bab442c59b5c4d0d48d16872d (diff) | |
download | dabmux-b5d43cff287d75de370ee94193b1162b5ab1038c.tar.gz dabmux-b5d43cff287d75de370ee94193b1162b5ab1038c.tar.bz2 dabmux-b5d43cff287d75de370ee94193b1162b5ab1038c.zip |
Make FIG 0/7 optional and document
Diffstat (limited to 'src/fig/FIG0_7.cpp')
-rw-r--r-- | src/fig/FIG0_7.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fig/FIG0_7.cpp b/src/fig/FIG0_7.cpp index e6df66b..50a12cf 100644 --- a/src/fig/FIG0_7.cpp +++ b/src/fig/FIG0_7.cpp @@ -43,12 +43,21 @@ struct FIGtype0_7 { uint8_t ReconfigCounter_low:8; } PACKED; -//=========== FIG 0/0 =========== +//=========== FIG 0/7 =========== FillStatus FIG0_7::fill(uint8_t *buf, size_t max_size) { FillStatus fs; + auto ensemble = m_rti->ensemble; + + if (ensemble->reconfig_counter < 0) { + // FIG 0/7 is disabled + fs.complete_fig_transmitted = true; + fs.num_bytes_written = 0; + return fs; + } + FIGtype0_7 *fig0_7; fig0_7 = (FIGtype0_7 *)buf; @@ -59,8 +68,6 @@ FillStatus FIG0_7::fill(uint8_t *buf, size_t max_size) fig0_7->PD = 0; fig0_7->Extension = 7; - auto ensemble = m_rti->ensemble; - fig0_7->ServiceCount = ensemble->services.size(); fig0_7->ReconfigCounter_high = (ensemble->reconfig_counter % 1024) / 256; fig0_7->ReconfigCounter_low = (ensemble->reconfig_counter % 1024) % 256; |