service 3 and local HK man improvements #92

Merged
meierj merged 1 commits from mueller/hk-improvements into develop 2022-05-25 16:10:33 +02:00
3 changed files with 16 additions and 6 deletions

View File

@ -577,6 +577,9 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me
CommandMessage reply;
if (result != HasReturnvaluesIF::RETURN_OK) {
if(result == WRONG_HK_PACKET_TYPE) {
printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleHousekeepingMessage", WRONG_HK_PACKET_TYPE);
}
HousekeepingMessage::setHkRequestFailureReply(&reply, sid, result);
} else {
HousekeepingMessage::setHkRequestSuccessReply(&reply, sid);
@ -834,6 +837,8 @@ void LocalDataPoolManager::printWarningOrError(sif::OutputTypes outputType,
errorPrint = "Dataset not found";
} else if (error == POOLOBJECT_NOT_FOUND) {
errorPrint = "Pool Object not found";
} else if (error == WRONG_HK_PACKET_TYPE) {
errorPrint = "Wrong Packet Type";
} else if (error == HasReturnvaluesIF::RETURN_FAILED) {
if (outputType == sif::OutputTypes::OUT_WARNING) {
errorPrint = "Generic Warning";

View File

@ -34,7 +34,7 @@ class CommandMessageIF {
static const Command_t CMD_NONE = MAKE_COMMAND_ID(0);
static const Command_t REPLY_COMMAND_OK = MAKE_COMMAND_ID(1);
//! Reply indicating that the current command was rejected,
//! par1 should contain the error code
//! Parameter 1 should contain the error code
static const Command_t REPLY_REJECTED = MAKE_COMMAND_ID(2);
virtual ~CommandMessageIF(){};

View File

@ -208,7 +208,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply,
ReturnValue_t error = HasReturnvaluesIF::RETURN_FAILED;
HousekeepingMessage::getHkRequestFailureReply(reply, &error);
failureParameter2 = error;
return CommandingServiceBase::EXECUTION_COMPLETE;
return RETURN_FAILED;
}
default:
@ -248,19 +248,23 @@ void Service3Housekeeping::handleUnrequestedReply(CommandMessage* reply) {
case (HousekeepingMessage::HK_REQUEST_FAILURE): {
break;
}
case(CommandMessage::REPLY_REJECTED): {
sif::warning << "Service3Housekeeping::handleUnrequestedReply: Unexpected reply "
"rejected with error code" << reply->getParameter() << std::endl;
break;
}
default: {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "Service3Housekeeping::handleUnrequestedReply: Invalid reply with reply "
"command "
<< command << "!" << std::endl;
"command " << command << "" << std::endl;
#else
sif::printWarning(
"Service3Housekeeping::handleUnrequestedReply: Invalid reply with "
"reply command %hu!\n",
"reply command %hu\n",
command);
#endif
return;
break;
}
}
@ -275,6 +279,7 @@ void Service3Housekeeping::handleUnrequestedReply(CommandMessage* reply) {
"Could not generate reply!\n");
#endif
}
CommandingServiceBase::handleUnrequestedReply(reply);
}
MessageQueueId_t Service3Housekeeping::getHkQueue() const { return commandQueue->getId(); }