all retval replacements
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2022-08-24 17:27:47 +02:00
parent 084ff3c5ca
commit 447c4d5c88
150 changed files with 2109 additions and 2112 deletions

View File

@ -52,17 +52,17 @@ ReturnValue_t HeaterHandler::performOperation(uint8_t operationCode) {
"Out of range error | "
<< e.what() << std::endl;
}
return RETURN_OK;
return returnvalue::OK;
}
ReturnValue_t HeaterHandler::initialize() {
ReturnValue_t result = SystemObject::initialize();
if (result != RETURN_OK) {
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = initializeHeaterMap();
if (result != RETURN_OK) {
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
@ -73,35 +73,35 @@ ReturnValue_t HeaterHandler::initialize() {
}
result = actionHelper.initialize(commandQueue);
if (result != RETURN_OK) {
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
return RETURN_OK;
return returnvalue::OK;
}
ReturnValue_t HeaterHandler::initializeHeaterMap() {
for (power::Switch_t switchNr = 0; switchNr < heater::NUMBER_OF_SWITCHES; switchNr++) {
heaterVec.push_back(HeaterWrapper(helper.heaters[switchNr], SwitchState::OFF));
}
return RETURN_OK;
return returnvalue::OK;
}
void HeaterHandler::readCommandQueue() {
ReturnValue_t result = RETURN_OK;
ReturnValue_t result = returnvalue::OK;
CommandMessage command;
do {
result = commandQueue->receiveMessage(&command);
if (result == MessageQueueIF::EMPTY) {
break;
} else if (result != RETURN_OK) {
} else if (result != returnvalue::OK) {
sif::warning << "HeaterHandler::readCommandQueue: Message reception error" << std::endl;
}
result = actionHelper.handleActionMessage(&command);
if (result == RETURN_OK) {
if (result == returnvalue::OK) {
continue;
}
} while (result == RETURN_OK);
} while (result == returnvalue::OK);
}
ReturnValue_t HeaterHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
@ -147,7 +147,7 @@ ReturnValue_t HeaterHandler::executeAction(ActionId_t actionId, MessageQueueId_t
heater.action = action;
heater.cmdActive = true;
heater.replyQueue = commandedBy;
return RETURN_OK;
return returnvalue::OK;
}
ReturnValue_t HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) {
@ -172,12 +172,12 @@ ReturnValue_t HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t o
}
result = ipcStore->addData(&storeAddress, commandData, sizeof(commandData));
if (result == RETURN_OK) {
if (result == returnvalue::OK) {
CommandMessage message;
ActionMessage::setCommand(&message, SWITCH_HEATER, storeAddress);
/* Send heater command to own command queue */
result = commandQueue->sendMessage(commandQueue->getId(), &message, 0);
if (result != RETURN_OK) {
if (result != returnvalue::OK) {
sif::debug << "HeaterHandler::sendSwitchCommand: Failed to send switch"
<< "message" << std::endl;
}
@ -217,7 +217,7 @@ void HeaterHandler::handleSwitchHandling() {
}
void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) {
ReturnValue_t result = RETURN_OK;
ReturnValue_t result = returnvalue::OK;
auto& heater = heaterVec.at(heaterIdx);
/* Check if command waits for main switch being set on and whether the timeout has expired */
if (heater.waitMainSwitchOn && heater.mainSwitchCountdown.hasTimedOut()) {
@ -239,7 +239,7 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) {
if (checkSwitchState(heaterIdx) == SwitchState::OFF) {
gpioId_t gpioId = heater.gpioId;
result = gpioInterface->pullHigh(gpioId);
if (result != RETURN_OK) {
if (result != returnvalue::OK) {
sif::error << "HeaterHandler::handleSwitchOnCommand: Failed to pull gpio with id " << gpioId
<< " high" << std::endl;
triggerEvent(GPIO_PULL_HIGH_FAILED, result);
@ -253,7 +253,7 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) {
// There is no need to send action finish replies if the sender was the
// HeaterHandler itself
if (heater.replyQueue != commandQueue->getId()) {
if (result == RETURN_OK) {
if (result == returnvalue::OK) {
actionHelper.finish(true, heater.replyQueue, heater.action, result);
} else {
actionHelper.finish(false, heater.replyQueue, heater.action, result);
@ -279,20 +279,20 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) {
}
void HeaterHandler::handleSwitchOffCommand(heater::Switchers heaterIdx) {
ReturnValue_t result = RETURN_OK;
ReturnValue_t result = returnvalue::OK;
auto& heater = heaterVec.at(heaterIdx);
// Check whether switch is already off
if (checkSwitchState(heaterIdx)) {
gpioId_t gpioId = heater.gpioId;
result = gpioInterface->pullLow(gpioId);
if (result != RETURN_OK) {
if (result != returnvalue::OK) {
sif::error << "HeaterHandler::handleSwitchOffCommand: Failed to pull gpio with id" << gpioId
<< " low" << std::endl;
triggerEvent(GPIO_PULL_LOW_FAILED, result);
} else {
auto result = heaterMutex->lockMutex();
heater.switchState = OFF;
if (result == HasReturnvaluesIF::RETURN_OK) {
if (result == returnvalue::OK) {
heaterMutex->unlockMutex();
}
triggerEvent(HEATER_WENT_OFF, heaterIdx, 0);
@ -307,7 +307,7 @@ void HeaterHandler::handleSwitchOffCommand(heater::Switchers heaterIdx) {
}
if (heater.replyQueue != NO_COMMANDER) {
// Report back switch command reply if necessary
if (result == HasReturnvaluesIF::RETURN_OK) {
if (result == returnvalue::OK) {
actionHelper.finish(true, heater.replyQueue, heater.action, result);
} else {
actionHelper.finish(false, heater.replyQueue, heater.action, result);
@ -333,7 +333,7 @@ bool HeaterHandler::allSwitchesOff() {
MessageQueueId_t HeaterHandler::getCommandQueue() const { return commandQueue->getId(); }
ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; }
ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { return returnvalue::OK; }
ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const {
ReturnValue_t mainSwitchState = mainLineSwitcher->getSwitchState(mainLineSwitch);
@ -341,7 +341,7 @@ ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const {
return PowerSwitchIF::SWITCH_OFF;
}
if (switchNr > 7) {
return PowerSwitchIF::RETURN_FAILED;
return returnvalue::FAILED;
}
if (checkSwitchState(static_cast<heater::Switchers>(switchNr)) == SwitchState::ON) {
return PowerSwitchIF::SWITCH_ON;