summaryrefslogtreecommitdiffstats
path: root/lib/edi/common.hpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-05-19 14:48:13 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-05-19 14:48:13 +0200
commit26b20a9aa0167b64e75b813aaf9b41557b4de3df (patch)
tree8ea23fc867cde052a70795159e8c122dccd763a7 /lib/edi/common.hpp
parent9067a63a4dd433c6109ba0157db516c9cac398e4 (diff)
downloaddabmux-26b20a9aa0167b64e75b813aaf9b41557b4de3df.tar.gz
dabmux-26b20a9aa0167b64e75b813aaf9b41557b4de3df.tar.bz2
dabmux-26b20a9aa0167b64e75b813aaf9b41557b4de3df.zip
Common 44ae39c: Make SEQ and PSEQ available on EDI receive and improve error handling
Diffstat (limited to 'lib/edi/common.hpp')
-rw-r--r--lib/edi/common.hpp14
1 files changed, 12 insertions, 2 deletions
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(const std::vector<uint8_t>&)>;
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<uint8_t> &input_data);
bool decode_tagpacket(const std::vector<uint8_t> &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<uint8_t> m_input_data;
std::map<std::string, tag_handler> m_handlers;
std::function<void()> m_af_packet_completed;