From d2325e60b69650b5dde10f28dc88a929decf6527 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sun, 12 Jan 2020 15:51:59 +0100 Subject: [PATCH] Import bugfix in MessageQueue.cpp lastPartner is only assigned if receiveMessage is successful --- osal/FreeRTOS/MessageQueue.cpp | 4 +++- tcdistribution/PUSDistributor.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/osal/FreeRTOS/MessageQueue.cpp b/osal/FreeRTOS/MessageQueue.cpp index 1f514cf3..887df392 100644 --- a/osal/FreeRTOS/MessageQueue.cpp +++ b/osal/FreeRTOS/MessageQueue.cpp @@ -38,7 +38,9 @@ ReturnValue_t MessageQueue::reply(MessageQueueMessage* message) { ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessage* message, MessageQueueId_t* receivedFrom) { ReturnValue_t status = this->receiveMessage(message); - *receivedFrom = this->lastPartner; + if(status == HasReturnvaluesIF::RETURN_OK) { + *receivedFrom = this->lastPartner; + } return status; } diff --git a/tcdistribution/PUSDistributor.cpp b/tcdistribution/PUSDistributor.cpp index 0f1aa7f0..7b413eab 100644 --- a/tcdistribution/PUSDistributor.cpp +++ b/tcdistribution/PUSDistributor.cpp @@ -48,6 +48,7 @@ ReturnValue_t PUSDistributor::registerService(AcceptsTelecommandsIF* service) { ReturnValue_t returnValue = RETURN_OK; bool errorCode = true; uint16_t serviceId = service->getIdentifier(); + //info << "Service ID: " << (int)serviceId << std::endl; MessageQueueId_t queue = service->getRequestQueue(); errorCode = this->queueMap.insert( std::pair(serviceId, queue)).second;