aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edi/common.hpp
diff options
context:
space:
mode:
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;