diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-12-26 22:20:35 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-12-26 22:20:35 +0100 |
commit | 37f5c2d4654580aa9d1195490d4a911b9b079acb (patch) | |
tree | 8cd76a87fe430eb0959f759ff7894c6667aa4016 /lib/edi/ETIWriter.cpp | |
parent | fd6d695275f88e83ebba6fa39afc044e329a690f (diff) | |
download | dabmod-37f5c2d4654580aa9d1195490d4a911b9b079acb.tar.gz dabmod-37f5c2d4654580aa9d1195490d4a911b9b079acb.tar.bz2 dabmod-37f5c2d4654580aa9d1195490d4a911b9b079acb.zip |
EDI: Handle RFU bits and add some sanity checks
Diffstat (limited to 'lib/edi/ETIWriter.cpp')
-rw-r--r-- | lib/edi/ETIWriter.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/edi/ETIWriter.cpp b/lib/edi/ETIWriter.cpp index 0eb3feb..bd051dd 100644 --- a/lib/edi/ETIWriter.cpp +++ b/lib/edi/ETIWriter.cpp @@ -117,6 +117,15 @@ void ETIWriter::update_mnsc(uint16_t mnsc) m_mnsc = mnsc; } +void ETIWriter::update_rfu(uint16_t rfu) +{ + if (not m_proto_valid) { + throw std::logic_error("Cannot update RFU before protocol"); + } + + m_rfu = rfu; +} + void ETIWriter::add_subchannel(const eti_stc_data& stc) { if (not m_proto_valid) { @@ -242,8 +251,8 @@ void ETIWriter::assemble() eti.push_back(mst_crc & 0xFF); // RFU - eti.push_back(0xff); - eti.push_back(0xff); + eti.push_back(m_rfu >> 8); + eti.push_back(m_rfu); // TIST eti.push_back(m_fc.tsta >> 24); |