From 28a3daabac3083b1c221c1f5d907a42e917e47ee Mon Sep 17 00:00:00 2001 From: petriVM18 Date: Wed, 17 Jun 2020 08:35:58 +0200 Subject: [PATCH] Added some debug messages in HandlerBase and Distributor (CCSDS/PUS/TC) --- devicehandlers/DeviceHandlerBase.cpp | 9 ++++++--- tcdistribution/CCSDSDistributor.cpp | 2 +- tcdistribution/PUSDistributor.cpp | 2 +- tcdistribution/TcDistributor.cpp | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/devicehandlers/DeviceHandlerBase.cpp b/devicehandlers/DeviceHandlerBase.cpp index 90875838..c1ae2475 100644 --- a/devicehandlers/DeviceHandlerBase.cpp +++ b/devicehandlers/DeviceHandlerBase.cpp @@ -428,7 +428,7 @@ void DeviceHandlerBase::replyToReply(DeviceReplyMap::iterator iter, void DeviceHandlerBase::doSendWrite() { if (cookieInfo.state == COOKIE_WRITE_READY) { - + sif::debug<<" DeviceHandlerBase::doSendWrite: Calling sendMessage"<sendMessage(cookie, rawPacket, rawPacketLen); @@ -450,6 +450,7 @@ void DeviceHandlerBase::doGetWrite() { return; } cookieInfo.state = COOKIE_UNUSED; + sif::debug<<" DeviceHandlerBase::doGetWrite: Calling getSendSuccess"<getSendSuccess(cookie); if (result == RETURN_OK) { if (wiretappingMode == RAW) { @@ -470,7 +471,7 @@ void DeviceHandlerBase::doGetWrite() { void DeviceHandlerBase::doSendRead() { ReturnValue_t result; - +// sif::debug<<" DeviceHandlerBase::doSendRead: Calling requestReceiveMessage"<requestReceiveMessage(cookie); if (result == RETURN_OK) { cookieInfo.state = COOKIE_READ_SENT; @@ -497,7 +498,7 @@ void DeviceHandlerBase::doGetRead() { } cookieInfo.state = COOKIE_UNUSED; - +// sif::debug<<" DeviceHandlerBase::doGetRead: Calling readReceivedMessage"<readReceivedMessage(cookie, &receivedData, &receivedDataLen); @@ -522,10 +523,12 @@ void DeviceHandlerBase::doGetRead() { //This approach avoids infinite loops due to buggy scanForReply routines (seen in bug 1077). uint32_t remainingLength = receivedDataLen; for (uint32_t count = 0; count < receivedDataLen; count++) { + sif::debug<<" DeviceHandlerBase::doGetRead: Calling scanForReply"<currentMessage.getStorageId().pool_index << ", " << this->currentMessage.getStorageId().packet_index << std::endl; + sif::debug << "CCSDSDistributor::selectDestination received: " << this->currentMessage.getStorageId().pool_index << ", " << this->currentMessage.getStorageId().packet_index << std::endl; const uint8_t* p_packet = NULL; size_t size = 0; //TODO check returncode? diff --git a/tcdistribution/PUSDistributor.cpp b/tcdistribution/PUSDistributor.cpp index c214f674..bf965aae 100644 --- a/tcdistribution/PUSDistributor.cpp +++ b/tcdistribution/PUSDistributor.cpp @@ -15,7 +15,7 @@ PUSDistributor::~PUSDistributor() { } iterator_t PUSDistributor::selectDestination() { -// debug << "PUSDistributor::handlePacket received: " << this->current_packet_id.store_index << ", " << this->current_packet_id.packet_index << std::endl; + sif::debug << "PUSDistributor::handlePacket received "<currentPacket.store_index << ", " << this->current_packet_id.packet_index << std::endl; iterator_t queueMapIt = this->queueMap.end(); this->currentPacket.setStoreAddress(this->currentMessage.getStorageId()); if (currentPacket.getWholeData() != NULL) { diff --git a/tcdistribution/TcDistributor.cpp b/tcdistribution/TcDistributor.cpp index 57921459..65aa3b26 100644 --- a/tcdistribution/TcDistributor.cpp +++ b/tcdistribution/TcDistributor.cpp @@ -15,7 +15,7 @@ TcDistributor::~TcDistributor() { ReturnValue_t TcDistributor::performOperation(uint8_t opCode) { ReturnValue_t status = RETURN_OK; -// debug << "TcDistributor: performing Operation." << std::endl; + //sif::debug << "TcDistributor: performing Operation." << std::endl; for (status = tcQueue->receiveMessage(¤tMessage); status == RETURN_OK; status = tcQueue->receiveMessage(¤tMessage)) { status = handlePacket(); @@ -31,6 +31,7 @@ ReturnValue_t TcDistributor::handlePacket() { iterator_t queueMapIt = this->selectDestination(); ReturnValue_t returnValue = RETURN_FAILED; + sif::debug << "TcDistributor::handlePacket" << std::endl; if (queueMapIt != this->queueMap.end()) { returnValue = this->tcQueue->sendMessage(queueMapIt->second, &this->currentMessage);