summaryrefslogtreecommitdiffstats
path: root/lib/edi/STIDecoder.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-01-15 07:09:03 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-01-18 13:22:09 +0100
commit12670a017ddb14fbf4a932799051dcfe21dd6c78 (patch)
tree43675f68329676a1ff84f8a26bab8733be224c0b /lib/edi/STIDecoder.cpp
parentc1d33594ca424b56a34200a6e525cdb1317bad69 (diff)
downloaddabmux-12670a017ddb14fbf4a932799051dcfe21dd6c78.tar.gz
dabmux-12670a017ddb14fbf4a932799051dcfe21dd6c78.tar.bz2
dabmux-12670a017ddb14fbf4a932799051dcfe21dd6c78.zip
Common 6b5db53: Update zmq.hpp, TCPReceiveServer, EDI decoder and output
Diffstat (limited to 'lib/edi/STIDecoder.cpp')
-rw-r--r--lib/edi/STIDecoder.cpp18
1 files changed, 11 insertions, 7 deletions
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<uint8_t> &buf)
m_dispatcher.push_bytes(buf);
}
-void STIDecoder::push_packet(const vector<uint8_t> &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<uint8_t>& 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<uint8_t>& 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) {