From 12670a017ddb14fbf4a932799051dcfe21dd6c78 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 15 Jan 2021 07:09:03 +0100 Subject: Common 6b5db53: Update zmq.hpp, TCPReceiveServer, EDI decoder and output --- lib/edi/STIDecoder.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'lib/edi/STIDecoder.cpp') diff --git a/lib/edi/STIDecoder.cpp b/lib/edi/STIDecoder.cpp index b6b9878..99f7c11 100644 --- a/lib/edi/STIDecoder.cpp +++ b/lib/edi/STIDecoder.cpp @@ -60,9 +60,9 @@ void STIDecoder::push_bytes(const vector &buf) m_dispatcher.push_bytes(buf); } -void STIDecoder::push_packet(const vector &buf) +void STIDecoder::push_packet(Packet &pack) { - m_dispatcher.push_packet(buf); + m_dispatcher.push_packet(pack); } void STIDecoder::setMaxDelay(int num_af_packets) @@ -107,7 +107,7 @@ bool STIDecoder::decode_dsti(const std::vector& value, const tag_name_t uint8_t dfcth = (dstiHeader >> 8) & 0x1F; uint8_t dfctl = dstiHeader & 0xFF; - md.dflc = dfcth * 250 + dfctl; // modulo 5000 counter + md.dlfc = dfcth * 250 + dfctl; // modulo 5000 counter const size_t expected_length = 2 + (md.stihf ? 3 : 0) + @@ -115,10 +115,14 @@ bool STIDecoder::decode_dsti(const std::vector& value, const tag_name_t (md.rfadf ? 9 : 0); if (value.size() != expected_length) { - throw std::runtime_error("EDI dsti: decoding error:" - "value.size() != expected_length: " + - to_string(value.size()) + " " + - to_string(expected_length)); + etiLog.level(warn) << "EDI dsti: decoding error: " << + "value.size() != expected_length: " << + value.size() << " " << + expected_length << " " << + (md.stihf ? "STIHF " : " ") << + (md.atstf ? "ATSTF " : " ") << + (md.rfadf ? "RFADF " : " "); + return false; } if (md.stihf) { -- cgit v1.2.3