Import bugfix in MessageQueue.cpp

lastPartner is only assigned if receiveMessage is successful
This commit is contained in:
Robin Müller 2020-01-12 15:51:59 +01:00
parent a8247eb2f0
commit d2325e60b6
2 changed files with 4 additions and 1 deletions

View File

@ -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;
}

View File

@ -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<uint32_t, MessageQueueId_t>(serviceId, queue)).second;