Added some debug messages in HandlerBase and Distributor (CCSDS/PUS/TC)

This commit is contained in:
petriVM18 2020-06-17 08:35:58 +02:00
parent a468d96f14
commit 28a3daabac
4 changed files with 10 additions and 6 deletions

View File

@ -428,7 +428,7 @@ void DeviceHandlerBase::replyToReply(DeviceReplyMap::iterator iter,
void DeviceHandlerBase::doSendWrite() { void DeviceHandlerBase::doSendWrite() {
if (cookieInfo.state == COOKIE_WRITE_READY) { if (cookieInfo.state == COOKIE_WRITE_READY) {
sif::debug<<" DeviceHandlerBase::doSendWrite: Calling sendMessage"<<std::endl;
ReturnValue_t result = communicationInterface->sendMessage(cookie, ReturnValue_t result = communicationInterface->sendMessage(cookie,
rawPacket, rawPacketLen); rawPacket, rawPacketLen);
@ -450,6 +450,7 @@ void DeviceHandlerBase::doGetWrite() {
return; return;
} }
cookieInfo.state = COOKIE_UNUSED; cookieInfo.state = COOKIE_UNUSED;
sif::debug<<" DeviceHandlerBase::doGetWrite: Calling getSendSuccess"<<std::endl;
ReturnValue_t result = communicationInterface->getSendSuccess(cookie); ReturnValue_t result = communicationInterface->getSendSuccess(cookie);
if (result == RETURN_OK) { if (result == RETURN_OK) {
if (wiretappingMode == RAW) { if (wiretappingMode == RAW) {
@ -470,7 +471,7 @@ void DeviceHandlerBase::doGetWrite() {
void DeviceHandlerBase::doSendRead() { void DeviceHandlerBase::doSendRead() {
ReturnValue_t result; ReturnValue_t result;
// sif::debug<<" DeviceHandlerBase::doSendRead: Calling requestReceiveMessage"<<std::endl;
result = communicationInterface->requestReceiveMessage(cookie); result = communicationInterface->requestReceiveMessage(cookie);
if (result == RETURN_OK) { if (result == RETURN_OK) {
cookieInfo.state = COOKIE_READ_SENT; cookieInfo.state = COOKIE_READ_SENT;
@ -497,7 +498,7 @@ void DeviceHandlerBase::doGetRead() {
} }
cookieInfo.state = COOKIE_UNUSED; cookieInfo.state = COOKIE_UNUSED;
// sif::debug<<" DeviceHandlerBase::doGetRead: Calling readReceivedMessage"<<std::endl;
result = communicationInterface->readReceivedMessage(cookie, &receivedData, result = communicationInterface->readReceivedMessage(cookie, &receivedData,
&receivedDataLen); &receivedDataLen);
@ -522,10 +523,12 @@ void DeviceHandlerBase::doGetRead() {
//This approach avoids infinite loops due to buggy scanForReply routines (seen in bug 1077). //This approach avoids infinite loops due to buggy scanForReply routines (seen in bug 1077).
uint32_t remainingLength = receivedDataLen; uint32_t remainingLength = receivedDataLen;
for (uint32_t count = 0; count < receivedDataLen; count++) { for (uint32_t count = 0; count < receivedDataLen; count++) {
sif::debug<<" DeviceHandlerBase::doGetRead: Calling scanForReply"<<std::endl;
result = scanForReply(receivedData, remainingLength, &foundId, result = scanForReply(receivedData, remainingLength, &foundId,
&foundLen); &foundLen);
switch (result) { switch (result) {
case RETURN_OK: case RETURN_OK:
sif::debug<<" DeviceHandlerBase::doGetRead: Calling handle reply"<<std::endl;
handleReply(receivedData, foundId, foundLen); handleReply(receivedData, foundId, foundLen);
break; break;
case APERIODIC_REPLY: { case APERIODIC_REPLY: {

View File

@ -11,7 +11,7 @@ CCSDSDistributor::~CCSDSDistributor() {
} }
iterator_t CCSDSDistributor::selectDestination() { iterator_t CCSDSDistributor::selectDestination() {
// debug << "CCSDSDistributor::selectDestination received: " << this->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; const uint8_t* p_packet = NULL;
size_t size = 0; size_t size = 0;
//TODO check returncode? //TODO check returncode?

View File

@ -15,7 +15,7 @@ PUSDistributor::~PUSDistributor() {
} }
iterator_t PUSDistributor::selectDestination() { 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 "<<std::endl;// << this->currentPacket.store_index << ", " << this->current_packet_id.packet_index << std::endl;
iterator_t queueMapIt = this->queueMap.end(); iterator_t queueMapIt = this->queueMap.end();
this->currentPacket.setStoreAddress(this->currentMessage.getStorageId()); this->currentPacket.setStoreAddress(this->currentMessage.getStorageId());
if (currentPacket.getWholeData() != NULL) { if (currentPacket.getWholeData() != NULL) {

View File

@ -15,7 +15,7 @@ TcDistributor::~TcDistributor() {
ReturnValue_t TcDistributor::performOperation(uint8_t opCode) { ReturnValue_t TcDistributor::performOperation(uint8_t opCode) {
ReturnValue_t status = RETURN_OK; ReturnValue_t status = RETURN_OK;
// debug << "TcDistributor: performing Operation." << std::endl; //sif::debug << "TcDistributor: performing Operation." << std::endl;
for (status = tcQueue->receiveMessage(&currentMessage); status == RETURN_OK; for (status = tcQueue->receiveMessage(&currentMessage); status == RETURN_OK;
status = tcQueue->receiveMessage(&currentMessage)) { status = tcQueue->receiveMessage(&currentMessage)) {
status = handlePacket(); status = handlePacket();
@ -31,6 +31,7 @@ ReturnValue_t TcDistributor::handlePacket() {
iterator_t queueMapIt = this->selectDestination(); iterator_t queueMapIt = this->selectDestination();
ReturnValue_t returnValue = RETURN_FAILED; ReturnValue_t returnValue = RETURN_FAILED;
sif::debug << "TcDistributor::handlePacket" << std::endl;
if (queueMapIt != this->queueMap.end()) { if (queueMapIt != this->queueMap.end()) {
returnValue = this->tcQueue->sendMessage(queueMapIt->second, returnValue = this->tcQueue->sendMessage(queueMapIt->second,
&this->currentMessage); &this->currentMessage);