aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edi
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-11-02 07:11:38 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-11-02 07:11:38 +0100
commit8b08667176e6fb8404aa6f722d9f2424d3d33225 (patch)
treec8dfe751a99210f1f2f6428bcf9144c62046b3d2 /lib/edi
parentcdeb33e3152caf5d73f6d75a16a26ecd2aec8260 (diff)
downloaddabmux-8b08667176e6fb8404aa6f722d9f2424d3d33225.tar.gz
dabmux-8b08667176e6fb8404aa6f722d9f2424d3d33225.tar.bz2
dabmux-8b08667176e6fb8404aa6f722d9f2424d3d33225.zip
Common ea3156f: EDI input: Do not print sequence error on first packet
Diffstat (limited to 'lib/edi')
-rw-r--r--lib/edi/common.cpp12
-rw-r--r--lib/edi/common.hpp1
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/edi/common.cpp b/lib/edi/common.cpp
index 3005802..306261a 100644
--- a/lib/edi/common.cpp
+++ b/lib/edi/common.cpp
@@ -264,9 +264,15 @@ decode_state_t TagDispatcher::decode_afpacket(
}
// SEQ wraps at 0xFFFF, unsigned integer overflow is intentional
- const uint16_t expected_seq = m_last_seq + 1;
- if (expected_seq != seq) {
- etiLog.level(warn) << "EDI AF Packet sequence error, " << seq;
+ if (m_last_seq_valid) {
+ const uint16_t expected_seq = m_last_seq + 1;
+ if (expected_seq != seq) {
+ etiLog.level(warn) << "EDI AF Packet sequence error, " << seq;
+ }
+ }
+ else {
+ etiLog.level(info) << "EDI AF Packet initial sequence number: " << seq;
+ m_last_seq_valid = true;
}
m_last_seq = seq;
diff --git a/lib/edi/common.hpp b/lib/edi/common.hpp
index ff5bab1..c8c4bb3 100644
--- a/lib/edi/common.hpp
+++ b/lib/edi/common.hpp
@@ -107,6 +107,7 @@ class TagDispatcher {
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;
std::vector<uint8_t> m_input_data;
std::map<std::string, tag_handler> m_handlers;