From 1f96622e74de37b5a0ea027844cda5549070902a Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 3 Oct 2022 15:03:35 +0200 Subject: [PATCH] count tx-queue overflows as tx-errors --- src/telegram.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/telegram.cpp b/src/telegram.cpp index f96cdf43e..c15aa4945 100644 --- a/src/telegram.cpp +++ b/src/telegram.cpp @@ -434,6 +434,11 @@ void TxService::add(const uint8_t operation, // if the queue is full, make room but removing the last one if (tx_telegrams_.size() >= MAX_TX_TELEGRAMS) { + if (tx_telegrams_.front().telegram_->operation == Telegram::Operation::TX_WRITE) { + telegram_write_fail_count_++; + } else { + telegram_read_fail_count_++; + } tx_telegrams_.pop_front(); } @@ -507,6 +512,11 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt // if the queue is full, make room but removing the last one if (tx_telegrams_.size() >= MAX_TX_TELEGRAMS) { + if (tx_telegrams_.front().telegram_->operation == Telegram::Operation::TX_WRITE) { + telegram_write_fail_count_++; + } else { + telegram_read_fail_count_++; + } tx_telegrams_.pop_front(); }