diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-05-11 21:04:18 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-05-11 21:29:43 +0200 |
commit | b4d788a065fb3338df26c44a94d804c194af4955 (patch) | |
tree | d711b52d9f8f24dd91db1152ba362b3dc513232d /lib/edi/ETIDecoder.hpp | |
parent | b07511ef22303f969b6aae2bcb026891b355d0b0 (diff) | |
download | dabmod-b4d788a065fb3338df26c44a94d804c194af4955.tar.gz dabmod-b4d788a065fb3338df26c44a94d804c194af4955.tar.bz2 dabmod-b4d788a065fb3338df26c44a94d804c194af4955.zip |
Update common EDI input and adapt to API changes
Diffstat (limited to 'lib/edi/ETIDecoder.hpp')
-rw-r--r-- | lib/edi/ETIDecoder.hpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/edi/ETIDecoder.hpp b/lib/edi/ETIDecoder.hpp index f5d0b81..ffa9037 100644 --- a/lib/edi/ETIDecoder.hpp +++ b/lib/edi/ETIDecoder.hpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2019 + Copyright (C) 2020 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -57,6 +57,12 @@ struct eti_stc_data { uint16_t stl(void) const { return mst.size() / 8; } }; +struct ReceivedTagPacket { + std::vector<uint8_t> tagpacket; + frame_timestamp_t timestamp; +}; + + /* A class that receives multiplex data must implement the interface described * in the ETIDataCollector. This can be e.g. a converter to ETI, or something that * prepares data structures for a modulator. @@ -87,8 +93,9 @@ class ETIDataCollector { virtual void add_subchannel(eti_stc_data&& stc) = 0; - // Tell the ETIWriter that the AFPacket is complete - virtual void assemble(void) = 0; + // Tell the consumer that the AFPacket is complete, and include + // the raw received TAGs + virtual void assemble(ReceivedTagPacket&& tagpacket) = 0; }; /* The ETIDecoder takes care of decoding the EDI TAGs related to the transport @@ -99,7 +106,9 @@ class ETIDataCollector { */ class ETIDecoder { public: - ETIDecoder(ETIDataCollector& data_collector, bool verbose); + ETIDecoder(ETIDataCollector& data_collector); + + void set_verbose(bool verbose); /* Push bytes into the decoder. The buf can contain more * than a single packet. This is useful when reading from streams @@ -118,16 +127,19 @@ class ETIDecoder { void setMaxDelay(int num_af_packets); private: - bool decode_starptr(const std::vector<uint8_t> &value, uint16_t); - bool decode_deti(const std::vector<uint8_t> &value, uint16_t); - bool decode_estn(const std::vector<uint8_t> &value, uint16_t n); - bool decode_stardmy(const std::vector<uint8_t> &value, uint16_t); + bool decode_starptr(const std::vector<uint8_t>& value, const tag_name_t& n); + bool decode_deti(const std::vector<uint8_t>& value, const tag_name_t& n); + bool decode_estn(const std::vector<uint8_t>& value, const tag_name_t& n); + bool decode_stardmy(const std::vector<uint8_t>& value, const tag_name_t& n); + + bool decode_tagpacket(const std::vector<uint8_t>& value); void packet_completed(); ETIDataCollector& m_data_collector; TagDispatcher m_dispatcher; + ReceivedTagPacket m_received_tagpacket; }; } |