From 37f5c2d4654580aa9d1195490d4a911b9b079acb Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 26 Dec 2016 22:20:35 +0100 Subject: EDI: Handle RFU bits and add some sanity checks --- lib/edi/ETIWriter.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/edi/ETIWriter.cpp') 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); -- cgit v1.2.3