Update FSFW #24
@ -1294,19 +1294,24 @@ ReturnValue_t DeviceHandlerBase::executeAction(ActionId_t actionId,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
DeviceCommandMap::iterator iter = deviceCommandMap.find(actionId);
|
DeviceCommandMap::iterator iter = deviceCommandMap.find(actionId);
|
||||||
|
MessageQueueId_t previousReplyRecipient = iter->second.sendReplyTo;
|
||||||
if (iter == deviceCommandMap.end()) {
|
if (iter == deviceCommandMap.end()) {
|
||||||
result = COMMAND_NOT_SUPPORTED;
|
result = COMMAND_NOT_SUPPORTED;
|
||||||
} else if (iter->second.isExecuting) {
|
} else if (iter->second.isExecuting) {
|
||||||
result = COMMAND_ALREADY_SENT;
|
result = COMMAND_ALREADY_SENT;
|
||||||
} else {
|
} else {
|
||||||
|
// Set this so it can be used to finish a command immediately
|
||||||
|
iter->second.sendReplyTo = commandedBy;
|
||||||
result = buildCommandFromCommand(actionId, data, size);
|
result = buildCommandFromCommand(actionId, data, size);
|
||||||
}
|
}
|
||||||
if (result == RETURN_OK) {
|
if (result == RETURN_OK) {
|
||||||
iter->second.sendReplyTo = commandedBy;
|
|
||||||
iter->second.isExecuting = true;
|
iter->second.isExecuting = true;
|
||||||
cookieInfo.pendingCommand = iter;
|
cookieInfo.pendingCommand = iter;
|
||||||
cookieInfo.state = COOKIE_WRITE_READY;
|
cookieInfo.state = COOKIE_WRITE_READY;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
iter->second.sendReplyTo = previousReplyRecipient;
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,10 +285,10 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
|
|||||||
|
|
||||||
utility::printUnixErrorGeneric(CLASS_NAME, "sendMessageFromMessageQueue", "EBADF");
|
utility::printUnixErrorGeneric(CLASS_NAME, "sendMessageFromMessageQueue", "EBADF");
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "mq_send to: " << sendTo << " sent from "
|
sif::warning << "mq_send to " << sendTo << " sent from "
|
||||||
<< sentFrom << "failed" << std::endl;
|
<< sentFrom << " failed" << std::endl;
|
||||||
#else
|
#else
|
||||||
sif::printWarning("mq_send to: %d sent from %d failed\n", sendTo, sentFrom);
|
sif::printWarning("mq_send to %d sent from %d failed\n", sendTo, sentFrom);
|
||||||
#endif
|
#endif
|
||||||
return DESTINATION_INVALID;
|
return DESTINATION_INVALID;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user