diff --git a/src/fsfw/events/EventManager.cpp b/src/fsfw/events/EventManager.cpp index 366a42652..3cb807767 100644 --- a/src/fsfw/events/EventManager.cpp +++ b/src/fsfw/events/EventManager.cpp @@ -51,7 +51,7 @@ void EventManager::notifyListeners(EventMessage* message) { if (listener.second.match(message)) { ReturnValue_t result = MessageQueueSenderIF::sendMessage(listener.first, message, message->getSender()); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << std::hex << "EventManager::notifyListeners: MSG to 0x" << std::setfill('0') << std::setw(8) << listener.first << " failed with result 0x" << std::setw(4) diff --git a/src/fsfw/globalfunctions/DleParser.cpp b/src/fsfw/globalfunctions/DleParser.cpp index f326f8374..44c75bab0 100644 --- a/src/fsfw/globalfunctions/DleParser.cpp +++ b/src/fsfw/globalfunctions/DleParser.cpp @@ -23,12 +23,12 @@ DleParser::DleParser(SimpleRingBuffer& decodeRingBuf, DleEncoder& decoder, BufPa ReturnValue_t DleParser::passData(uint8_t* data, size_t len) { if (data == nullptr or len == 0 or handler == nullptr) { - return RETURN_FAILED; + return returnvalue::FAILED; } size_t copyIntoRingBufFromHere = 0; size_t copyAmount = len; size_t startIdx = 0; - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; bool startFoundInThisPacket = false; for (size_t idx = 0; idx < len; idx++) { if (data[idx] == DleEncoder::STX_CHAR) { @@ -54,7 +54,7 @@ ReturnValue_t DleParser::passData(uint8_t* data, size_t len) { size_t decodedLen = 0; result = decoder.decode(data + startIdx, idx + 1 - startIdx, &readLen, decodedBuf.first, decodedBuf.second, &decodedLen); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { ctx.setType(ContextType::PACKET_FOUND); ctx.decodedPacket.first = decodedBuf.first; ctx.decodedPacket.second = decodedLen; @@ -81,7 +81,7 @@ ReturnValue_t DleParser::passData(uint8_t* data, size_t len) { // ETX found but STX was found in another mini packet. Reconstruct the full packet // to decode it result = decodeRingBuf.writeData(data, idx + 1); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ErrorInfo info; info.res = result; prepareErrorContext(ErrorTypes::RING_BUF_ERROR, info); @@ -100,7 +100,7 @@ ReturnValue_t DleParser::passData(uint8_t* data, size_t len) { decodeRingBuf.readData(encodedBuf.first, fullEncodedLen, true); result = decoder.decode(encodedBuf.first, fullEncodedLen, &readLen, decodedBuf.first, decodedBuf.second, &decodedLen); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { if (this->handler != nullptr) { ctx.setType(ContextType::PACKET_FOUND); ctx.decodedPacket.first = decodedBuf.first; @@ -148,14 +148,14 @@ ReturnValue_t DleParser::passData(uint8_t* data, size_t len) { } if (copyAmount > 0) { result = decodeRingBuf.writeData(data + copyIntoRingBufFromHere, copyAmount); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ErrorInfo info; info.res = result; prepareErrorContext(ErrorTypes::RING_BUF_ERROR, info); handler(ctx); } } - return RETURN_OK; + return returnvalue::OK; } void DleParser::defaultFoundPacketHandler(uint8_t* packet, size_t len, void* args) { diff --git a/src/fsfw/globalfunctions/DleParser.h b/src/fsfw/globalfunctions/DleParser.h index e8ee61d93..f1a4f193b 100644 --- a/src/fsfw/globalfunctions/DleParser.h +++ b/src/fsfw/globalfunctions/DleParser.h @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -16,7 +16,7 @@ * overriding two provided virtual methods. This also allows detecting multiple DLE packets * inside one passed packet. */ -class DleParser : public HasReturnvaluesIF { +class DleParser { public: using BufPair = std::pair; diff --git a/src/fsfw/health/HasHealthIF.h b/src/fsfw/health/HasHealthIF.h index 3fd948405..bf696e157 100644 --- a/src/fsfw/health/HasHealthIF.h +++ b/src/fsfw/health/HasHealthIF.h @@ -17,11 +17,11 @@ class HasHealthIF { static const uint8_t INTERFACE_ID = CLASS_ID::HAS_HEALTH_IF; static constexpr ReturnValue_t OBJECT_NOT_HEALTHY = - HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 1); + returnvalue::makeCode(INTERFACE_ID, 1); static constexpr ReturnValue_t INVALID_HEALTH_STATE = - HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 2); + returnvalue::makeCode(INTERFACE_ID, 2); static constexpr ReturnValue_t IS_EXTERNALLY_CONTROLLED = - HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 3); + returnvalue::makeCode(INTERFACE_ID, 3); static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SYSTEM_MANAGER_1; //! P1: New Health, P2: Old Health diff --git a/src/fsfw/parameters/HasParametersIF.h b/src/fsfw/parameters/HasParametersIF.h index 5125d2486..5d70c3285 100644 --- a/src/fsfw/parameters/HasParametersIF.h +++ b/src/fsfw/parameters/HasParametersIF.h @@ -66,7 +66,7 @@ class HasParametersIF { * @param newValues * @param startAtIndex Linear index, runs left to right, top to bottom for * matrix indexes. - * @return RETURN_OK if parameter is valid and a set function of the parameter wrapper was called. + * @return returnvalue::OK if parameter is valid and a set function of the parameter wrapper was called. */ virtual ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueIdentifier, ParameterWrapper *parameterWrapper, diff --git a/src/fsfw/pus/Service3Housekeeping.cpp b/src/fsfw/pus/Service3Housekeeping.cpp index 82b4e848c..5c8875723 100644 --- a/src/fsfw/pus/Service3Housekeeping.cpp +++ b/src/fsfw/pus/Service3Housekeeping.cpp @@ -208,7 +208,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply, ReturnValue_t error = returnvalue::FAILED; HousekeepingMessage::getHkRequestFailureReply(reply, &error); failureParameter2 = error; - return RETURN_FAILED; + return returnvalue::FAILED; } default: diff --git a/src/fsfw/tmtcservices/CommandingServiceBase.cpp b/src/fsfw/tmtcservices/CommandingServiceBase.cpp index c6f8085b1..d3314fa6f 100644 --- a/src/fsfw/tmtcservices/CommandingServiceBase.cpp +++ b/src/fsfw/tmtcservices/CommandingServiceBase.cpp @@ -223,7 +223,7 @@ void CommandingServiceBase::handleReplyHandlerResult(ReturnValue_t result, Comma // In case a new command is to be sent immediately, this is performed here. // If no new command is sent, only analyse reply result by initializing - // sendResult as RETURN_OK + // sendResult as returnvalue::OK ReturnValue_t sendResult = returnvalue::OK; if (nextCommand->getCommand() != CommandMessage::CMD_NONE) { sendResult = commandQueue->sendMessage(reply->getSender(), nextCommand); diff --git a/src/fsfw_hal/linux/spi/ManualCsLockGuard.h b/src/fsfw_hal/linux/spi/ManualCsLockGuard.h index b282bcc06..feb6dd83e 100644 --- a/src/fsfw_hal/linux/spi/ManualCsLockGuard.h +++ b/src/fsfw_hal/linux/spi/ManualCsLockGuard.h @@ -1,10 +1,10 @@ #pragma once #include "fsfw/ipc/MutexIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw_hal/common/gpio/GpioIF.h" -class ManualCsLockWrapper : public HasReturnvaluesIF { +class ManualCsLockWrapper { public: ManualCsLockWrapper(MutexIF* lock, GpioIF* gpioIF, SpiCookie* cookie, MutexIF::TimeoutType type = MutexIF::TimeoutType::BLOCKING, @@ -16,18 +16,18 @@ class ManualCsLockWrapper : public HasReturnvaluesIF { } cookie->setCsLockManual(true); lockResult = lock->lockMutex(type, timeoutMs); - if (lockResult != RETURN_OK) { + if (lockResult != returnvalue::OK) { return; } gpioResult = gpioIF->pullLow(cookie->getChipSelectPin()); } ~ManualCsLockWrapper() { - if (gpioResult == RETURN_OK) { + if (gpioResult == returnvalue::OK) { gpioIF->pullHigh(cookie->getChipSelectPin()); } cookie->setCsLockManual(false); - if (lockResult == RETURN_OK) { + if (lockResult == returnvalue::OK) { lock->unlockMutex(); } } diff --git a/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp b/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp index 01f0494b8..fdf02a707 100644 --- a/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp +++ b/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp @@ -646,7 +646,7 @@ ReturnValue_t TestDevice::initializeLocalDataPool(localpool::DataPool& localData /* Subscribe for periodic HK packets but do not enable reporting for now. Non-diangostic with a period of one second */ poolManager.subscribeForRegularPeriodicPacket({sid, false, 1.0}); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, diff --git a/unittests/datapoollocal/testDataSet.cpp b/unittests/datapoollocal/testDataSet.cpp index def92ac34..8bc0abb7f 100644 --- a/unittests/datapoollocal/testDataSet.cpp +++ b/unittests/datapoollocal/testDataSet.cpp @@ -269,7 +269,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { { // PoolReadGuard rg(&sharedSet); - // CHECK(rg.getReadResult() == result::OK); + // CHECK(rg.getReadResult() == returnvalue::OK); localSet.localPoolVarUint8.value = 5; localSet.localPoolUint16Vec.value[0] = 1; localSet.localPoolUint16Vec.value[1] = 2; diff --git a/unittests/osal/TestSemaphore.cpp b/unittests/osal/TestSemaphore.cpp index 376b08dbe..550c60b7b 100644 --- a/unittests/osal/TestSemaphore.cpp +++ b/unittests/osal/TestSemaphore.cpp @@ -19,7 +19,7 @@ TEST_CASE("Binary Semaphore Test" , "[BinSemaphore]") { REQUIRE(binSemaph->release() == static_cast(SemaphoreIF::SEMAPHORE_NOT_OWNED)); REQUIRE(binSemaph->acquire(SemaphoreIF::POLLING) == - result::OK); + returnvalue::OK); { // not precise enough on linux.. should use clock instead.. //Stopwatch stopwatch(false); @@ -29,7 +29,7 @@ TEST_CASE("Binary Semaphore Test" , "[BinSemaphore]") { //CHECK(time == 5); } REQUIRE(binSemaph->getSemaphoreCounter() == 0); - REQUIRE(binSemaph->release() == result::OK); + REQUIRE(binSemaph->release() == returnvalue::OK); } SemaphoreFactory::instance()->deleteSemaphore(binSemaph); // perform tear-down here