From 0f9930524b4b7ff8e3e4d5b13ea926ce4b3676f3 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Wed, 26 Aug 2020 15:54:13 +0200 Subject: [PATCH] some minor improvements --- tmtcservices/TmTcBridge.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tmtcservices/TmTcBridge.cpp b/tmtcservices/TmTcBridge.cpp index 29153dd5..706bbbf2 100644 --- a/tmtcservices/TmTcBridge.cpp +++ b/tmtcservices/TmTcBridge.cpp @@ -122,6 +122,7 @@ ReturnValue_t TmTcBridge::handleTmQueue() { result == HasReturnvaluesIF::RETURN_OK; result = tmTcReceptionQueue->receiveMessage(&message)) { + //sif::info << (int) packetSentCounter << std::endl; if(communicationLinkUp == false or packetSentCounter >= sentPacketsPerCycle) { storeDownlinkData(&message); @@ -138,8 +139,10 @@ ReturnValue_t TmTcBridge::handleTmQueue() { if (result != HasReturnvaluesIF::RETURN_OK) { status = result; } - tmStore->deleteData(message.getStorageId()); - packetSentCounter++; + else { + tmStore->deleteData(message.getStorageId()); + packetSentCounter++; + } } return status; } @@ -152,7 +155,7 @@ ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage *message) { << "of stored packet IDs reached! " << std::endl; if(overwriteOld) { tmFifo->retrieve(&storeId); - tmStore->deleteData(storeId); + tmStore->deleteData(storeId); } else { return HasReturnvaluesIF::RETURN_FAILED; @@ -168,8 +171,9 @@ ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage *message) { ReturnValue_t TmTcBridge::handleStoredTm() { ReturnValue_t status = RETURN_OK; while(not tmFifo->empty() and packetSentCounter < sentPacketsPerCycle) { - //info << "TMTC Bridge: Sending stored TM data. There are " - // << (int) fifo.size() << " left to send\r\n" << std::flush; + //sif::info << "TMTC Bridge: Sending stored TM data. There are " + // << (int) tmFifo->size() << " left to send\r\n" << std::flush; + store_address_t storeId; const uint8_t* data = nullptr; size_t size = 0;