From 26b20a9aa0167b64e75b813aaf9b41557b4de3df Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 19 May 2021 14:48:13 +0200 Subject: Common 44ae39c: Make SEQ and PSEQ available on EDI receive and improve error handling --- lib/edi/common.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/edi/common.hpp') diff --git a/lib/edi/common.hpp b/lib/edi/common.hpp index 14b91ba..e8c57c1 100644 --- a/lib/edi/common.hpp +++ b/lib/edi/common.hpp @@ -68,6 +68,13 @@ struct Packet { Packet() {} }; +struct seq_info_t { + bool seq_valid = false; + uint16_t seq = 0; + bool pseq_valid = false; + uint16_t pseq = 0; +}; + /* The TagDispatcher takes care of decoding EDI, with or without PFT, and * will call functions when TAGs are encountered. * @@ -110,13 +117,16 @@ class TagDispatcher { using tagpacket_handler = std::function&)>; void register_tagpacket_handler(tagpacket_handler&& h); + seq_info_t get_seq_info() const { + return m_last_sequences; + } + private: decode_state_t decode_afpacket(const std::vector &input_data); bool decode_tagpacket(const std::vector &payload); PFT::PFT m_pft; - bool m_last_seq_valid = false; - uint16_t m_last_seq = 0; + seq_info_t m_last_sequences; std::vector m_input_data; std::map m_handlers; std::function m_af_packet_completed; -- cgit v1.2.3