From b827bd8370ad22f6910e1979bfd2f150fc239321 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 26 Jul 2022 10:22:05 +0200 Subject: [PATCH 01/10] update HasReturnvaluesIF 1. Add new retval namespace which contains OK and FAIL returnvalue 2. Also contains makeCode constexpr function 3. Mark HasReturnvaluesIF::makeReturnCode deprecated This prevents from having to implement an interface just to use a shorter version of the general returnvalues. A namespace is better suited for this I think --- src/fsfw/returnvalues/HasReturnvaluesIF.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/fsfw/returnvalues/HasReturnvaluesIF.h b/src/fsfw/returnvalues/HasReturnvaluesIF.h index eec80228..4d59c26b 100644 --- a/src/fsfw/returnvalues/HasReturnvaluesIF.h +++ b/src/fsfw/returnvalues/HasReturnvaluesIF.h @@ -10,11 +10,21 @@ #define MAKE_RETURN_CODE(number) ((INTERFACE_ID << 8) + (number)) typedef uint16_t ReturnValue_t; +namespace retval { +static constexpr ReturnValue_t OK = 0; +static constexpr ReturnValue_t FAILED = 1; + +static constexpr ReturnValue_t makeCode(uint8_t classId, uint8_t number) { + return (static_cast(classId) << 8) + number; +} +} // namespace retval + class HasReturnvaluesIF { public: - static const ReturnValue_t RETURN_OK = 0; - static const ReturnValue_t RETURN_FAILED = 1; - virtual ~HasReturnvaluesIF() {} + static const ReturnValue_t RETURN_OK = retval::OK; + static const ReturnValue_t RETURN_FAILED = retval::FAILED; + + virtual ~HasReturnvaluesIF() = default; /** * It is discouraged to use the input parameters 0,0 and 0,1 as this @@ -23,8 +33,9 @@ class HasReturnvaluesIF { * @param number * @return */ - static constexpr ReturnValue_t makeReturnCode(uint8_t classId, uint8_t number) { - return (static_cast(classId) << 8) + number; + [[deprecated("Use retval::makeCode instead")]] static constexpr ReturnValue_t makeReturnCode( + uint8_t classId, uint8_t number) { + return retval::makeCode(classId, number); } }; From 88ebb67c8db9c9cc14958216f2443ce989a3a0dc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 26 Jul 2022 10:27:44 +0200 Subject: [PATCH 02/10] fix deprecation warnings --- src/fsfw/cfdp/definitions.h | 18 +++++++++--------- src/fsfw/osal/common/TcpTmTcServer.h | 2 +- src/fsfw/tasks/FixedTimeslotTaskIF.h | 2 +- src/fsfw_tests/internal/osal/testMq.cpp | 10 ++++------ .../serialize/IntTestSerialization.cpp | 15 +++++++-------- 5 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/fsfw/cfdp/definitions.h b/src/fsfw/cfdp/definitions.h index eb21f5bf..93d15bcb 100644 --- a/src/fsfw/cfdp/definitions.h +++ b/src/fsfw/cfdp/definitions.h @@ -16,27 +16,27 @@ static constexpr uint8_t VERSION_BITS = 0b00100000; static constexpr uint8_t CFDP_CLASS_ID = CLASS_ID::CFDP; static constexpr ReturnValue_t INVALID_TLV_TYPE = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 1); + retval::makeCode(CFDP_CLASS_ID, 1); static constexpr ReturnValue_t INVALID_DIRECTIVE_FIELDS = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 2); + retval::makeCode(CFDP_CLASS_ID, 2); static constexpr ReturnValue_t INVALID_PDU_DATAFIELD_LEN = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 3); + retval::makeCode(CFDP_CLASS_ID, 3); static constexpr ReturnValue_t INVALID_ACK_DIRECTIVE_FIELDS = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 4); + retval::makeCode(CFDP_CLASS_ID, 4); //! Can not parse options. This can also occur because there are options //! available but the user did not pass a valid options array static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 5); + retval::makeCode(CFDP_CLASS_ID, 5); static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 6); + retval::makeCode(CFDP_CLASS_ID, 6); static constexpr ReturnValue_t FINISHED_CANT_PARSE_FS_RESPONSES = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 6); + retval::makeCode(CFDP_CLASS_ID, 6); static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 8); + retval::makeCode(CFDP_CLASS_ID, 8); //! Can not parse filestore response because user did not pass a valid instance //! or remaining size is invalid static constexpr ReturnValue_t FILESTORE_RESPONSE_CANT_PARSE_FS_MESSAGE = - HasReturnvaluesIF::makeReturnCode(CFDP_CLASS_ID, 9); + retval::makeCode(CFDP_CLASS_ID, 9); //! Checksum types according to the SANA Checksum Types registry //! https://sanaregistry.org/r/checksum_identifiers/ diff --git a/src/fsfw/osal/common/TcpTmTcServer.h b/src/fsfw/osal/common/TcpTmTcServer.h index faf6e0a1..ae3fce39 100644 --- a/src/fsfw/osal/common/TcpTmTcServer.h +++ b/src/fsfw/osal/common/TcpTmTcServer.h @@ -108,7 +108,7 @@ class TcpTmTcServer : public SystemObject, public TcpIpBase, public ExecutableOb StorageManagerIF* tmStore = nullptr; private: - static constexpr ReturnValue_t CONN_BROKEN = HasReturnvaluesIF::makeReturnCode(1, 0); + static constexpr ReturnValue_t CONN_BROKEN = retval::makeCode(1, 0); //! TMTC bridge is cached. object_id_t tmtcBridgeId = objects::NO_OBJECT; TcpTmTcBridge* tmtcBridge = nullptr; diff --git a/src/fsfw/tasks/FixedTimeslotTaskIF.h b/src/fsfw/tasks/FixedTimeslotTaskIF.h index 3f5e30d8..6a552d81 100644 --- a/src/fsfw/tasks/FixedTimeslotTaskIF.h +++ b/src/fsfw/tasks/FixedTimeslotTaskIF.h @@ -15,7 +15,7 @@ class FixedTimeslotTaskIF : public PeriodicTaskIF { ~FixedTimeslotTaskIF() override = default; static constexpr ReturnValue_t SLOT_LIST_EMPTY = - HasReturnvaluesIF::makeReturnCode(CLASS_ID::FIXED_SLOT_TASK_IF, 0); + retval::makeCode(CLASS_ID::FIXED_SLOT_TASK_IF, 0); /** * Add an object with a slot time and the execution step to the task. diff --git a/src/fsfw_tests/internal/osal/testMq.cpp b/src/fsfw_tests/internal/osal/testMq.cpp index 0f78dbb9..30b46d63 100644 --- a/src/fsfw_tests/internal/osal/testMq.cpp +++ b/src/fsfw_tests/internal/osal/testMq.cpp @@ -7,8 +7,6 @@ #include "fsfw_tests/internal/UnittDefinitions.h" -using retval = HasReturnvaluesIF; - void testmq::testMq() { std::string id = "[testMq]"; MessageQueueIF* testSenderMq = QueueFactory::instance()->createMessageQueue(1); @@ -22,22 +20,22 @@ void testmq::testMq() { testSenderMq->setDefaultDestination(testReceiverMqId); auto result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - if (result != retval::RETURN_OK) { + if (result != retval::OK) { unitt::put_error(id); } MessageQueueMessage recvMessage; result = testReceiverMq->receiveMessage(&recvMessage); - if (result != retval::RETURN_OK or recvMessage.getData()[0] != 42) { + if (result != retval::OK or recvMessage.getData()[0] != 42) { unitt::put_error(id); } result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - if (result != retval::RETURN_OK) { + if (result != retval::OK) { unitt::put_error(id); } MessageQueueId_t senderId = 0; result = testReceiverMq->receiveMessage(&recvMessage, &senderId); - if (result != retval::RETURN_OK or recvMessage.getData()[0] != 42) { + if (result != retval::OK or recvMessage.getData()[0] != 42) { unitt::put_error(id); } if (senderId != testSenderMqId) { diff --git a/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp b/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp index 8e1f2bdd..1e2a385c 100644 --- a/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp +++ b/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp @@ -8,24 +8,23 @@ #include "fsfw_tests/internal/UnittDefinitions.h" -using retval = HasReturnvaluesIF; std::array testserialize::test_array = {0}; ReturnValue_t testserialize::test_serialization() { // Here, we test all serialization tools. First test basic cases. ReturnValue_t result = test_endianness_tools(); - if (result != retval::RETURN_OK) { + if (result != retval::OK) { return result; } result = test_autoserialization(); - if (result != retval::RETURN_OK) { + if (result != retval::OK) { return result; } result = test_serial_buffer_adapter(); - if (result != retval::RETURN_OK) { + if (result != retval::OK) { return result; } - return retval::RETURN_OK; + return retval::OK; } ReturnValue_t testserialize::test_endianness_tools() { @@ -49,7 +48,7 @@ ReturnValue_t testserialize::test_endianness_tools() { if (test_array[0] != 0 and test_array[1] != 1) { return unitt::put_error(id); } - return retval::RETURN_OK; + return retval::OK; } ReturnValue_t testserialize::test_autoserialization() { @@ -153,7 +152,7 @@ ReturnValue_t testserialize::test_autoserialization() { } // Check overflow - return retval::RETURN_OK; + return retval::OK; } // TODO: Also test for constant buffers. @@ -206,5 +205,5 @@ ReturnValue_t testserialize::test_serial_buffer_adapter() { if (testUint16 != 16) { return unitt::put_error(id); } - return retval::RETURN_OK; + return retval::OK; } From 5355e637114f5160439aadf64b2d455adf1d06f6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 27 Jul 2022 21:43:32 +0200 Subject: [PATCH 03/10] use result instead of retval --- src/fsfw/cfdp/definitions.h | 18 +-- src/fsfw/osal/common/TcpTmTcServer.h | 2 +- src/fsfw/returnvalues/HasReturnvaluesIF.h | 12 +- src/fsfw/tasks/FixedTimeslotTaskIF.h | 2 +- src/fsfw_tests/internal/osal/testMq.cpp | 8 +- .../serialize/IntTestSerialization.cpp | 14 +- unittests/CatchDefinitions.h | 5 - unittests/action/TestActionHelper.cpp | 10 +- unittests/cfdp/testCfdp.cpp | 28 ++-- unittests/container/RingBufferTest.cpp | 148 +++++++++--------- unittests/datapoollocal/DataSetTest.cpp | 46 +++--- .../datapoollocal/LocalPoolManagerTest.cpp | 140 ++++++++--------- .../datapoollocal/LocalPoolVariableTest.cpp | 20 +-- .../datapoollocal/LocalPoolVectorTest.cpp | 16 +- unittests/globalfunctions/testDleEncoder.cpp | 4 +- .../TestInternalErrorReporter.cpp | 2 +- unittests/osal/TestMessageQueue.cpp | 16 +- unittests/osal/TestSemaphore.cpp | 4 +- .../serialize/TestSerialBufferAdapter.cpp | 2 +- .../serialize/TestSerialLinkedPacket.cpp | 4 +- unittests/storagemanager/TestNewAccessor.cpp | 42 ++--- unittests/storagemanager/TestPool.cpp | 58 +++---- 22 files changed, 298 insertions(+), 303 deletions(-) diff --git a/src/fsfw/cfdp/definitions.h b/src/fsfw/cfdp/definitions.h index 93d15bcb..7e023881 100644 --- a/src/fsfw/cfdp/definitions.h +++ b/src/fsfw/cfdp/definitions.h @@ -16,27 +16,27 @@ static constexpr uint8_t VERSION_BITS = 0b00100000; static constexpr uint8_t CFDP_CLASS_ID = CLASS_ID::CFDP; static constexpr ReturnValue_t INVALID_TLV_TYPE = - retval::makeCode(CFDP_CLASS_ID, 1); + result::makeCode(CFDP_CLASS_ID, 1); static constexpr ReturnValue_t INVALID_DIRECTIVE_FIELDS = - retval::makeCode(CFDP_CLASS_ID, 2); + result::makeCode(CFDP_CLASS_ID, 2); static constexpr ReturnValue_t INVALID_PDU_DATAFIELD_LEN = - retval::makeCode(CFDP_CLASS_ID, 3); + result::makeCode(CFDP_CLASS_ID, 3); static constexpr ReturnValue_t INVALID_ACK_DIRECTIVE_FIELDS = - retval::makeCode(CFDP_CLASS_ID, 4); + result::makeCode(CFDP_CLASS_ID, 4); //! Can not parse options. This can also occur because there are options //! available but the user did not pass a valid options array static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS = - retval::makeCode(CFDP_CLASS_ID, 5); + result::makeCode(CFDP_CLASS_ID, 5); static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS = - retval::makeCode(CFDP_CLASS_ID, 6); + result::makeCode(CFDP_CLASS_ID, 6); static constexpr ReturnValue_t FINISHED_CANT_PARSE_FS_RESPONSES = - retval::makeCode(CFDP_CLASS_ID, 6); + result::makeCode(CFDP_CLASS_ID, 6); static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE = - retval::makeCode(CFDP_CLASS_ID, 8); + result::makeCode(CFDP_CLASS_ID, 8); //! Can not parse filestore response because user did not pass a valid instance //! or remaining size is invalid static constexpr ReturnValue_t FILESTORE_RESPONSE_CANT_PARSE_FS_MESSAGE = - retval::makeCode(CFDP_CLASS_ID, 9); + result::makeCode(CFDP_CLASS_ID, 9); //! Checksum types according to the SANA Checksum Types registry //! https://sanaregistry.org/r/checksum_identifiers/ diff --git a/src/fsfw/osal/common/TcpTmTcServer.h b/src/fsfw/osal/common/TcpTmTcServer.h index ae3fce39..1181ff10 100644 --- a/src/fsfw/osal/common/TcpTmTcServer.h +++ b/src/fsfw/osal/common/TcpTmTcServer.h @@ -108,7 +108,7 @@ class TcpTmTcServer : public SystemObject, public TcpIpBase, public ExecutableOb StorageManagerIF* tmStore = nullptr; private: - static constexpr ReturnValue_t CONN_BROKEN = retval::makeCode(1, 0); + static constexpr ReturnValue_t CONN_BROKEN = result::makeCode(1, 0); //! TMTC bridge is cached. object_id_t tmtcBridgeId = objects::NO_OBJECT; TcpTmTcBridge* tmtcBridge = nullptr; diff --git a/src/fsfw/returnvalues/HasReturnvaluesIF.h b/src/fsfw/returnvalues/HasReturnvaluesIF.h index 4d59c26b..20c10e0b 100644 --- a/src/fsfw/returnvalues/HasReturnvaluesIF.h +++ b/src/fsfw/returnvalues/HasReturnvaluesIF.h @@ -10,19 +10,19 @@ #define MAKE_RETURN_CODE(number) ((INTERFACE_ID << 8) + (number)) typedef uint16_t ReturnValue_t; -namespace retval { +namespace result { static constexpr ReturnValue_t OK = 0; static constexpr ReturnValue_t FAILED = 1; static constexpr ReturnValue_t makeCode(uint8_t classId, uint8_t number) { return (static_cast(classId) << 8) + number; } -} // namespace retval +} // namespace result class HasReturnvaluesIF { public: - static const ReturnValue_t RETURN_OK = retval::OK; - static const ReturnValue_t RETURN_FAILED = retval::FAILED; + static const ReturnValue_t RETURN_OK = result::OK; + static const ReturnValue_t RETURN_FAILED = result::FAILED; virtual ~HasReturnvaluesIF() = default; @@ -33,9 +33,9 @@ class HasReturnvaluesIF { * @param number * @return */ - [[deprecated("Use retval::makeCode instead")]] static constexpr ReturnValue_t makeReturnCode( + [[deprecated("Use result::makeCode instead")]] static constexpr ReturnValue_t makeReturnCode( uint8_t classId, uint8_t number) { - return retval::makeCode(classId, number); + return result::makeCode(classId, number); } }; diff --git a/src/fsfw/tasks/FixedTimeslotTaskIF.h b/src/fsfw/tasks/FixedTimeslotTaskIF.h index 6a552d81..c7b90ec3 100644 --- a/src/fsfw/tasks/FixedTimeslotTaskIF.h +++ b/src/fsfw/tasks/FixedTimeslotTaskIF.h @@ -15,7 +15,7 @@ class FixedTimeslotTaskIF : public PeriodicTaskIF { ~FixedTimeslotTaskIF() override = default; static constexpr ReturnValue_t SLOT_LIST_EMPTY = - retval::makeCode(CLASS_ID::FIXED_SLOT_TASK_IF, 0); + result::makeCode(CLASS_ID::FIXED_SLOT_TASK_IF, 0); /** * Add an object with a slot time and the execution step to the task. diff --git a/src/fsfw_tests/internal/osal/testMq.cpp b/src/fsfw_tests/internal/osal/testMq.cpp index 30b46d63..3d8e1034 100644 --- a/src/fsfw_tests/internal/osal/testMq.cpp +++ b/src/fsfw_tests/internal/osal/testMq.cpp @@ -20,22 +20,22 @@ void testmq::testMq() { testSenderMq->setDefaultDestination(testReceiverMqId); auto result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - if (result != retval::OK) { + if (result != result::OK) { unitt::put_error(id); } MessageQueueMessage recvMessage; result = testReceiverMq->receiveMessage(&recvMessage); - if (result != retval::OK or recvMessage.getData()[0] != 42) { + if (result != result::OK or recvMessage.getData()[0] != 42) { unitt::put_error(id); } result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - if (result != retval::OK) { + if (result != result::OK) { unitt::put_error(id); } MessageQueueId_t senderId = 0; result = testReceiverMq->receiveMessage(&recvMessage, &senderId); - if (result != retval::OK or recvMessage.getData()[0] != 42) { + if (result != result::OK or recvMessage.getData()[0] != 42) { unitt::put_error(id); } if (senderId != testSenderMqId) { diff --git a/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp b/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp index 1e2a385c..5865f8fc 100644 --- a/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp +++ b/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp @@ -13,18 +13,18 @@ std::array testserialize::test_array = {0}; ReturnValue_t testserialize::test_serialization() { // Here, we test all serialization tools. First test basic cases. ReturnValue_t result = test_endianness_tools(); - if (result != retval::OK) { + if (result != result::OK) { return result; } result = test_autoserialization(); - if (result != retval::OK) { + if (result != result::OK) { return result; } result = test_serial_buffer_adapter(); - if (result != retval::OK) { + if (result != result::OK) { return result; } - return retval::OK; + return result::OK; } ReturnValue_t testserialize::test_endianness_tools() { @@ -48,7 +48,7 @@ ReturnValue_t testserialize::test_endianness_tools() { if (test_array[0] != 0 and test_array[1] != 1) { return unitt::put_error(id); } - return retval::OK; + return result::OK; } ReturnValue_t testserialize::test_autoserialization() { @@ -152,7 +152,7 @@ ReturnValue_t testserialize::test_autoserialization() { } // Check overflow - return retval::OK; + return result::OK; } // TODO: Also test for constant buffers. @@ -205,5 +205,5 @@ ReturnValue_t testserialize::test_serial_buffer_adapter() { if (testUint16 != 16) { return unitt::put_error(id); } - return retval::OK; + return result::OK; } diff --git a/unittests/CatchDefinitions.h b/unittests/CatchDefinitions.h index f0189602..dbe3848b 100644 --- a/unittests/CatchDefinitions.h +++ b/unittests/CatchDefinitions.h @@ -5,11 +5,6 @@ #include #include -namespace retval { -static constexpr int CATCH_OK = static_cast(HasReturnvaluesIF::RETURN_OK); -static constexpr int CATCH_FAILED = static_cast(HasReturnvaluesIF::RETURN_FAILED); -} // namespace retval - namespace tconst { static constexpr MessageQueueId_t testQueueId = 42; } diff --git a/unittests/action/TestActionHelper.cpp b/unittests/action/TestActionHelper.cpp index 6461a195..0d160c6f 100644 --- a/unittests/action/TestActionHelper.cpp +++ b/unittests/action/TestActionHelper.cpp @@ -19,12 +19,12 @@ TEST_CASE("Action Helper", "[ActionHelper]") { StorageManagerIF* ipcStore = tglob::getIpcStoreHandle(); REQUIRE(ipcStore != nullptr); ipcStore->addData(¶mAddress, testParams.data(), 3); - REQUIRE(actionHelper.initialize() == retval::CATCH_OK); + REQUIRE(actionHelper.initialize() == result::OK); SECTION("Simple tests") { ActionMessage::setCommand(&actionMessage, testActionId, paramAddress); CHECK(not testDhMock.executeActionCalled); - REQUIRE(actionHelper.handleActionMessage(&actionMessage) == retval::CATCH_OK); + REQUIRE(actionHelper.handleActionMessage(&actionMessage) == result::OK); CHECK(testDhMock.executeActionCalled); // No message is sent if everything is alright. CHECK(not testMqMock.wasMessageSent()); @@ -82,10 +82,10 @@ TEST_CASE("Action Helper", "[ActionHelper]") { SECTION("Handle failed") { store_address_t toLongParamAddress = StorageManagerIF::INVALID_ADDRESS; std::array toLongData = {5, 4, 3, 2, 1}; - REQUIRE(ipcStore->addData(&toLongParamAddress, toLongData.data(), 5) == retval::CATCH_OK); + REQUIRE(ipcStore->addData(&toLongParamAddress, toLongData.data(), 5) == result::OK); ActionMessage::setCommand(&actionMessage, testActionId, toLongParamAddress); CHECK(not testDhMock.executeActionCalled); - REQUIRE(actionHelper.handleActionMessage(&actionMessage) == retval::CATCH_OK); + REQUIRE(actionHelper.handleActionMessage(&actionMessage) == result::OK); REQUIRE(ipcStore->getData(toLongParamAddress).first == static_cast(StorageManagerIF::DATA_DOES_NOT_EXIST)); CommandMessage testMessage; @@ -100,7 +100,7 @@ TEST_CASE("Action Helper", "[ActionHelper]") { SECTION("Missing IPC Data") { ActionMessage::setCommand(&actionMessage, testActionId, StorageManagerIF::INVALID_ADDRESS); CHECK(not testDhMock.executeActionCalled); - REQUIRE(actionHelper.handleActionMessage(&actionMessage) == retval::CATCH_OK); + REQUIRE(actionHelper.handleActionMessage(&actionMessage) == result::OK); CommandMessage testMessage; REQUIRE(testMqMock.receiveMessage(&testMessage) == static_cast(HasReturnvaluesIF::RETURN_OK)); diff --git a/unittests/cfdp/testCfdp.cpp b/unittests/cfdp/testCfdp.cpp index 78ef618b..e7acab01 100644 --- a/unittests/cfdp/testCfdp.cpp +++ b/unittests/cfdp/testCfdp.cpp @@ -29,10 +29,10 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { const uint8_t** dummyPtr = nullptr; ReturnValue_t deserResult = headerSerializer.deSerialize(dummyPtr, &serSize, SerializeIF::Endianness::NETWORK); - REQUIRE(deserResult == retval::CATCH_FAILED); + REQUIRE(deserResult == result::FAILED); deserResult = headerSerializer.serialize(nullptr, &serSize, serBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(deserResult == retval::CATCH_FAILED); + REQUIRE(deserResult == result::FAILED); REQUIRE(seqNum.getSerializedSize() == 1); REQUIRE(headerSerializer.getPduDataFieldLen() == 0); @@ -62,7 +62,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { result = headerSerializer.serialize(&serTarget, &serSize, serBuf.size(), SerializeIF::Endianness::BIG); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); REQUIRE(serSize == 7); // Only version bits are set REQUIRE(serBuf[0] == 0b00100000); @@ -155,11 +155,11 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { REQUIRE(entityId == 0x00ff00ff); result = pduConf.sourceId.setValue(cfdp::WidthInBytes::ONE_BYTE, 0xfff); - REQUIRE(result == retval::CATCH_FAILED); + REQUIRE(result == result::FAILED); result = pduConf.sourceId.setValue(cfdp::WidthInBytes::TWO_BYTES, 0xfffff); - REQUIRE(result == retval::CATCH_FAILED); + REQUIRE(result == result::FAILED); result = pduConf.sourceId.setValue(cfdp::WidthInBytes::FOUR_BYTES, 0xfffffffff); - REQUIRE(result == retval::CATCH_FAILED); + REQUIRE(result == result::FAILED); uint8_t oneByteSourceId = 32; serTarget = &oneByteSourceId; size_t deserLen = 1; @@ -197,7 +197,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { auto headerSerializer = HeaderSerializer(pduConf, cfdp::PduType::FILE_DIRECTIVE, 0); ReturnValue_t result = headerSerializer.serialize(&serTarget, &serSize, serBuf.size(), SerializeIF::Endianness::BIG); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); REQUIRE(serBuf[1] == 0); REQUIRE(serBuf[2] == 0); // Entity and Transaction Sequence number are 1 byte large @@ -207,7 +207,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { auto headerDeser = HeaderDeserializer(serBuf.data(), serBuf.size()); ReturnValue_t serResult = headerDeser.parseData(); - REQUIRE(serResult == retval::CATCH_OK); + REQUIRE(serResult == result::OK); REQUIRE(headerDeser.getPduDataFieldLen() == 0); REQUIRE(headerDeser.getHeaderSize() == 7); REQUIRE(headerDeser.getWholePduSize() == 7); @@ -230,11 +230,11 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { headerSerializer.setPduType(cfdp::PduType::FILE_DATA); headerSerializer.setSegmentMetadataFlag(cfdp::SegmentMetadataFlag::PRESENT); result = pduConf.seqNum.setValue(cfdp::WidthInBytes::TWO_BYTES, 0x0fff); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = pduConf.sourceId.setValue(cfdp::WidthInBytes::FOUR_BYTES, 0xff00ff00); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = pduConf.destId.setValue(cfdp::WidthInBytes::FOUR_BYTES, 0x00ff00ff); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); serTarget = serBuf.data(); serSize = 0; result = headerSerializer.serialize(&serTarget, &serSize, serBuf.size(), @@ -242,7 +242,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { headerDeser = HeaderDeserializer(serBuf.data(), serBuf.size()); result = headerDeser.parseData(); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); // Everything except version bit flipped to one now REQUIRE(serBuf[0] == 0x3f); REQUIRE(serBuf[3] == 0b11001010); @@ -274,7 +274,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { serTarget = serBuf.data(); const uint8_t** serTargetConst = const_cast(&serTarget); result = headerDeser.parseData(); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); headerDeser.setData(nullptr, -1); REQUIRE(headerDeser.getHeaderSize() == 0); @@ -286,7 +286,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { pduConf.destId.setValue(cfdp::WidthInBytes::ONE_BYTE, 48); result = headerSerializer.serialize(&serTarget, &serSize, serBuf.size(), SerializeIF::Endianness::BIG); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); REQUIRE(headerDeser.getWholePduSize() == 8); headerDeser.setData(serBuf.data(), serBuf.size()); diff --git a/unittests/container/RingBufferTest.cpp b/unittests/container/RingBufferTest.cpp index f4f111a6..edabfd55 100644 --- a/unittests/container/RingBufferTest.cpp +++ b/unittests/container/RingBufferTest.cpp @@ -12,42 +12,42 @@ TEST_CASE("Ring Buffer Test", "[RingBufferTest]") { SECTION("Simple Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 9) == retval::CATCH_OK); - REQUIRE(ringBuffer.writeData(testData, 3) == retval::CATCH_FAILED); - REQUIRE(ringBuffer.readData(readBuffer, 5, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 3) == result::FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, true) == result::OK); for (uint8_t i = 0; i < 5; i++) { CHECK(readBuffer[i] == i); } REQUIRE(ringBuffer.availableWriteSpace() == 5); ringBuffer.clear(); REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 4) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 4, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 4) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 4, true) == result::OK); for (uint8_t i = 0; i < 4; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 9) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 9, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 9, true) == result::OK); for (uint8_t i = 0; i < 9; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 1024) == retval::CATCH_FAILED); - REQUIRE(ringBuffer.writeData(nullptr, 5) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.writeData(testData, 1024) == result::FAILED); + REQUIRE(ringBuffer.writeData(nullptr, 5) == result::FAILED); } SECTION("Get Free Element Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 8) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 8) == result::OK); REQUIRE(ringBuffer.availableWriteSpace() == 1); - REQUIRE(ringBuffer.readData(readBuffer, 8, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 8, true) == result::OK); REQUIRE(ringBuffer.availableWriteSpace() == 9); uint8_t *testPtr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == result::FAILED); REQUIRE(ringBuffer.writeTillWrap() == 2); // too many excess bytes. - REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == retval::CATCH_FAILED); - REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == retval::CATCH_OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == result::FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == result::OK); REQUIRE(ringBuffer.getExcessBytes() == 3); std::memcpy(testPtr, testData, 5); ringBuffer.confirmBytesWritten(5); @@ -59,19 +59,19 @@ TEST_CASE("Ring Buffer Test", "[RingBufferTest]") { } SECTION("Read Remaining Test") { - REQUIRE(ringBuffer.writeData(testData, 3) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 3) == result::OK); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == result::FAILED); size_t trueSize = 0; - REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == result::OK); REQUIRE(trueSize == 3); for (uint8_t i = 0; i < 3; i++) { CHECK(readBuffer[i] == i); } trueSize = 0; - REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == result::FAILED); REQUIRE(trueSize == 0); - REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == retval::CATCH_OK); + REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == result::OK); REQUIRE(trueSize == 3); } } @@ -84,21 +84,21 @@ TEST_CASE("Ring Buffer Test2", "[RingBufferTest2]") { SECTION("Simple Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 9) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 5, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, true) == result::OK); for (uint8_t i = 0; i < 5; i++) { CHECK(readBuffer[i] == i); } REQUIRE(ringBuffer.availableWriteSpace() == 5); ringBuffer.clear(); REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 4) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 4, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 4) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 4, true) == result::OK); for (uint8_t i = 0; i < 4; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 9) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 9, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 9, true) == result::OK); for (uint8_t i = 0; i < 9; i++) { CHECK(readBuffer[i] == i); } @@ -106,17 +106,17 @@ TEST_CASE("Ring Buffer Test2", "[RingBufferTest2]") { SECTION("Get Free Element Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 8) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 8) == result::OK); REQUIRE(ringBuffer.availableWriteSpace() == 1); - REQUIRE(ringBuffer.readData(readBuffer, 8, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 8, true) == result::OK); REQUIRE(ringBuffer.availableWriteSpace() == 9); uint8_t *testPtr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == result::FAILED); REQUIRE(ringBuffer.writeTillWrap() == 2); // too many excess bytes. - REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == retval::CATCH_FAILED); - REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == retval::CATCH_OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == result::FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == result::OK); REQUIRE(ringBuffer.getExcessBytes() == 3); std::memcpy(testPtr, testData, 5); ringBuffer.confirmBytesWritten(5); @@ -128,19 +128,19 @@ TEST_CASE("Ring Buffer Test2", "[RingBufferTest2]") { } SECTION("Read Remaining Test") { - REQUIRE(ringBuffer.writeData(testData, 3) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 3) == result::OK); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == result::FAILED); size_t trueSize = 0; - REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == result::OK); REQUIRE(trueSize == 3); for (uint8_t i = 0; i < 3; i++) { CHECK(readBuffer[i] == i); } trueSize = 0; - REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == result::FAILED); REQUIRE(trueSize == 0); - REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == retval::CATCH_OK); + REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == result::OK); REQUIRE(trueSize == 3); } @@ -148,17 +148,17 @@ TEST_CASE("Ring Buffer Test2", "[RingBufferTest2]") { REQUIRE(ringBuffer.availableWriteSpace() == 9); // We don't allow writing of Data that is larger than the ring buffer in total REQUIRE(ringBuffer.getMaxSize() == 9); - REQUIRE(ringBuffer.writeData(testData, 13) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.writeData(testData, 13) == result::FAILED); REQUIRE(ringBuffer.getAvailableReadData() == 0); ringBuffer.clear(); uint8_t *ptr = nullptr; // With excess Bytes 13 Bytes can be written to this Buffer - REQUIRE(ringBuffer.getFreeElement(&ptr, 13) == retval::CATCH_OK); + REQUIRE(ringBuffer.getFreeElement(&ptr, 13) == result::OK); REQUIRE(ptr != nullptr); memcpy(ptr, testData, 13); ringBuffer.confirmBytesWritten(13); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 3, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 3, true) == result::OK); for (auto i = 0; i < 3; i++) { REQUIRE(readBuffer[i] == testData[i + 10]); } @@ -173,21 +173,21 @@ TEST_CASE("Ring Buffer Test3", "[RingBufferTest3]") { SECTION("Simple Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 9) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 5, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, true) == result::OK); for (uint8_t i = 0; i < 5; i++) { CHECK(readBuffer[i] == i); } REQUIRE(ringBuffer.availableWriteSpace() == 5); ringBuffer.clear(); REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 4) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 4, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 4) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 4, true) == result::OK); for (uint8_t i = 0; i < 4; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 9) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 9, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 9, true) == result::OK); for (uint8_t i = 0; i < 9; i++) { CHECK(readBuffer[i] == i); } @@ -195,19 +195,19 @@ TEST_CASE("Ring Buffer Test3", "[RingBufferTest3]") { SECTION("Get Free Element Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 8) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 8) == result::OK); REQUIRE(ringBuffer.availableWriteSpace() == 1); - REQUIRE(ringBuffer.readData(readBuffer, 8, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 8, true) == result::OK); REQUIRE(ringBuffer.availableWriteSpace() == 9); uint8_t *testPtr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == retval::CATCH_OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == result::OK); REQUIRE(ringBuffer.getExcessBytes() == 8); REQUIRE(ringBuffer.writeTillWrap() == 2); // too many excess bytes. - REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == result::FAILED); // Less Execss bytes overwrites before - REQUIRE(ringBuffer.getFreeElement(&testPtr, 3) == retval::CATCH_OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 3) == result::OK); REQUIRE(ringBuffer.getExcessBytes() == 1); std::memcpy(testPtr, testData, 3); ringBuffer.confirmBytesWritten(3); @@ -219,19 +219,19 @@ TEST_CASE("Ring Buffer Test3", "[RingBufferTest3]") { } SECTION("Read Remaining Test") { - REQUIRE(ringBuffer.writeData(testData, 3) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 3) == result::OK); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == result::FAILED); size_t trueSize = 0; - REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == result::OK); REQUIRE(trueSize == 3); for (uint8_t i = 0; i < 3; i++) { CHECK(readBuffer[i] == i); } trueSize = 0; - REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == result::FAILED); REQUIRE(trueSize == 0); - REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == retval::CATCH_OK); + REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == result::OK); REQUIRE(trueSize == 3); } @@ -239,18 +239,18 @@ TEST_CASE("Ring Buffer Test3", "[RingBufferTest3]") { REQUIRE(ringBuffer.availableWriteSpace() == 9); // Writing more than the buffer is large. // This write will be rejected and is seen as a configuration mistake - REQUIRE(ringBuffer.writeData(testData, 13) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.writeData(testData, 13) == result::FAILED); REQUIRE(ringBuffer.getAvailableReadData() == 0); ringBuffer.clear(); // Using FreeElement allows the usage of excessBytes but // should be used with caution uint8_t *ptr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&ptr, 13) == retval::CATCH_OK); + REQUIRE(ringBuffer.getFreeElement(&ptr, 13) == result::OK); REQUIRE(ptr != nullptr); memcpy(ptr, testData, 13); ringBuffer.confirmBytesWritten(13); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 3, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 3, true) == result::OK); for (auto i = 0; i < 3; i++) { REQUIRE(readBuffer[i] == testData[i + 10]); } @@ -264,22 +264,22 @@ TEST_CASE("Ring Buffer Test4", "[RingBufferTest4]") { SECTION("Simple Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 9) == retval::CATCH_OK); - REQUIRE(ringBuffer.writeData(testData, 3) == retval::CATCH_FAILED); - REQUIRE(ringBuffer.readData(readBuffer, 5, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 3) == result::FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, true) == result::OK); for (uint8_t i = 0; i < 5; i++) { CHECK(readBuffer[i] == i); } REQUIRE(ringBuffer.availableWriteSpace() == 5); ringBuffer.clear(); REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 4) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 4, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 4) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 4, true) == result::OK); for (uint8_t i = 0; i < 4; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 9) == retval::CATCH_OK); - REQUIRE(ringBuffer.readData(readBuffer, 9, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 9, true) == result::OK); for (uint8_t i = 0; i < 9; i++) { CHECK(readBuffer[i] == i); } @@ -287,16 +287,16 @@ TEST_CASE("Ring Buffer Test4", "[RingBufferTest4]") { SECTION("Get Free Element Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 8) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 8) == result::OK); REQUIRE(ringBuffer.availableWriteSpace() == 1); - REQUIRE(ringBuffer.readData(readBuffer, 8, true) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 8, true) == result::OK); REQUIRE(ringBuffer.availableWriteSpace() == 9); uint8_t *testPtr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == result::FAILED); REQUIRE(ringBuffer.writeTillWrap() == 2); - REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == retval::CATCH_OK); - REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == retval::CATCH_OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == result::OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == result::OK); REQUIRE(ringBuffer.getExcessBytes() == 3); std::memcpy(testPtr, testData, 5); ringBuffer.confirmBytesWritten(5); @@ -308,19 +308,19 @@ TEST_CASE("Ring Buffer Test4", "[RingBufferTest4]") { } SECTION("Read Remaining Test") { - REQUIRE(ringBuffer.writeData(testData, 3) == retval::CATCH_OK); + REQUIRE(ringBuffer.writeData(testData, 3) == result::OK); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == result::FAILED); size_t trueSize = 0; - REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == retval::CATCH_OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == result::OK); REQUIRE(trueSize == 3); for (uint8_t i = 0; i < 3; i++) { CHECK(readBuffer[i] == i); } trueSize = 0; - REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == retval::CATCH_FAILED); + REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == result::FAILED); REQUIRE(trueSize == 0); - REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == retval::CATCH_OK); + REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == result::OK); REQUIRE(trueSize == 3); } } diff --git a/unittests/datapoollocal/DataSetTest.cpp b/unittests/datapoollocal/DataSetTest.cpp index c9f023ef..45085eaf 100644 --- a/unittests/datapoollocal/DataSetTest.cpp +++ b/unittests/datapoollocal/DataSetTest.cpp @@ -16,8 +16,8 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { LocalPoolOwnerBase* poolOwner = ObjectManager::instance()->get(objects::TEST_LOCAL_POOL_OWNER_BASE); REQUIRE(poolOwner != nullptr); - REQUIRE(poolOwner->initializeHkManager() == retval::CATCH_OK); - REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == retval::CATCH_OK); + REQUIRE(poolOwner->initializeHkManager() == result::OK); + REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == result::OK); LocalPoolStaticTestDataSet localSet; SECTION("BasicTest") { @@ -36,7 +36,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { /* Test local pool ID serialization */ CHECK(localSet.serializeLocalPoolIds(&localPoolIdBuffPtr, &serSize, maxSize, - SerializeIF::Endianness::MACHINE) == retval::CATCH_OK); + SerializeIF::Endianness::MACHINE) == result::OK); CHECK(serSize == maxSize); CHECK(localPoolIdBuff[0] == 3); CHECK(lpIds[0] == localSet.localPoolVarUint8.getDataPoolId()); @@ -48,7 +48,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { serSize = 0; CHECK(localSet.serializeLocalPoolIds(&localPoolIdBuffPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE, - false) == retval::CATCH_OK); + false) == result::OK); CHECK(serSize == maxSize - sizeof(uint8_t)); CHECK(lpIds[0] == localSet.localPoolVarUint8.getDataPoolId()); CHECK(lpIds[1] == localSet.localPoolVarFloat.getDataPoolId()); @@ -57,7 +57,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { { /* Test read operation. Values should be all zeros */ PoolReadGuard readHelper(&localSet); - REQUIRE(readHelper.getReadResult() == retval::CATCH_OK); + REQUIRE(readHelper.getReadResult() == result::OK); CHECK(not localSet.isValid()); CHECK(localSet.localPoolVarUint8.value == 0); CHECK(not localSet.localPoolVarUint8.isValid()); @@ -90,7 +90,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { /* Now we read again and check whether our zeroed values were overwritten with the values in the pool */ PoolReadGuard readHelper(&localSet); - REQUIRE(readHelper.getReadResult() == retval::CATCH_OK); + REQUIRE(readHelper.getReadResult() == result::OK); CHECK(localSet.isValid()); CHECK(localSet.localPoolVarUint8.value == 232); CHECK(localSet.localPoolVarUint8.isValid()); @@ -110,7 +110,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { uint8_t buffer[maxSize + 1]; uint8_t* buffPtr = buffer; CHECK(localSet.serialize(&buffPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - retval::CATCH_OK); + result::OK); uint8_t rawUint8 = buffer[0]; CHECK(rawUint8 == 232); float rawFloat = 0.0; @@ -128,7 +128,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { std::memset(buffer, 0, sizeof(buffer)); const uint8_t* constBuffPtr = buffer; CHECK(localSet.deSerialize(&constBuffPtr, &sizeToDeserialize, - SerializeIF::Endianness::MACHINE) == retval::CATCH_OK); + SerializeIF::Endianness::MACHINE) == result::OK); /* Check whether deserialization was successfull */ CHECK(localSet.localPoolVarUint8.value == 0); CHECK(localSet.localPoolVarFloat.value == Catch::Approx(0.0)); @@ -156,7 +156,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { serSize = 0; buffPtr = buffer; CHECK(localSet.serialize(&buffPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - retval::CATCH_OK); + result::OK); CHECK(rawUint8 == 232); std::memcpy(&rawFloat, buffer + sizeof(uint8_t), sizeof(float)); CHECK(rawFloat == Catch::Approx(-2324.322)); @@ -186,7 +186,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { sizeToDeserialize = maxSize; constBuffPtr = buffer; CHECK(localSet.deSerialize(&constBuffPtr, &sizeToDeserialize, - SerializeIF::Endianness::MACHINE) == retval::CATCH_OK); + SerializeIF::Endianness::MACHINE) == result::OK); /* Check whether deserialization was successfull */ CHECK(localSet.localPoolVarUint8.value == 0); CHECK(localSet.localPoolVarFloat.value == Catch::Approx(0.0)); @@ -213,10 +213,10 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { /* Register same variables again to get more than 8 registered variables */ for (uint8_t idx = 0; idx < 8; idx++) { - REQUIRE(set.registerVariable(&localSet.localPoolVarUint8) == retval::CATCH_OK); + REQUIRE(set.registerVariable(&localSet.localPoolVarUint8) == result::OK); } - REQUIRE(set.registerVariable(&localSet.localPoolVarUint8) == retval::CATCH_OK); - REQUIRE(set.registerVariable(&localSet.localPoolUint16Vec) == retval::CATCH_OK); + REQUIRE(set.registerVariable(&localSet.localPoolVarUint8) == result::OK); + REQUIRE(set.registerVariable(&localSet.localPoolUint16Vec) == result::OK); set.setValidityBufferGeneration(true); { @@ -233,7 +233,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { uint8_t buffer[maxSize + 1]; uint8_t* buffPtr = buffer; CHECK(set.serialize(&buffPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - retval::CATCH_OK); + result::OK); std::array validityBuffer; std::memcpy(validityBuffer.data(), buffer + 9 + sizeof(uint16_t) * 3, 2); /* The first 9 variables should be valid */ @@ -251,7 +251,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { const uint8_t* constBuffPtr = buffer; size_t sizeToDeSerialize = serSize; CHECK(set.deSerialize(&constBuffPtr, &sizeToDeSerialize, SerializeIF::Endianness::MACHINE) == - retval::CATCH_OK); + result::OK); CHECK(localSet.localPoolVarUint8.isValid() == false); CHECK(localSet.localPoolUint16Vec.isValid() == true); } @@ -261,20 +261,20 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { SharedLocalDataSet sharedSet(sharedSetId, poolOwner, lpool::testSetId, 5); localSet.localPoolVarUint8.setReadWriteMode(pool_rwm_t::VAR_WRITE); localSet.localPoolUint16Vec.setReadWriteMode(pool_rwm_t::VAR_WRITE); - CHECK(sharedSet.registerVariable(&localSet.localPoolVarUint8) == retval::CATCH_OK); - CHECK(sharedSet.registerVariable(&localSet.localPoolUint16Vec) == retval::CATCH_OK); - CHECK(sharedSet.initialize() == retval::CATCH_OK); - CHECK(sharedSet.lockDataset() == retval::CATCH_OK); - CHECK(sharedSet.unlockDataset() == retval::CATCH_OK); + CHECK(sharedSet.registerVariable(&localSet.localPoolVarUint8) == result::OK); + CHECK(sharedSet.registerVariable(&localSet.localPoolUint16Vec) == result::OK); + CHECK(sharedSet.initialize() == result::OK); + CHECK(sharedSet.lockDataset() == result::OK); + CHECK(sharedSet.unlockDataset() == result::OK); { // PoolReadGuard rg(&sharedSet); - // CHECK(rg.getReadResult() == retval::CATCH_OK); + // CHECK(rg.getReadResult() == result::OK); localSet.localPoolVarUint8.value = 5; localSet.localPoolUint16Vec.value[0] = 1; localSet.localPoolUint16Vec.value[1] = 2; localSet.localPoolUint16Vec.value[2] = 3; - CHECK(sharedSet.commit() == retval::CATCH_OK); + CHECK(sharedSet.commit() == result::OK); } sharedSet.setReadCommitProtectionBehaviour(true); @@ -282,5 +282,5 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { /* we need to reset the subscription list because the pool owner is a global object. */ - CHECK(poolOwner->reset() == retval::CATCH_OK); + CHECK(poolOwner->reset() == result::OK); } diff --git a/unittests/datapoollocal/LocalPoolManagerTest.cpp b/unittests/datapoollocal/LocalPoolManagerTest.cpp index 58a6065e..4fc67c97 100644 --- a/unittests/datapoollocal/LocalPoolManagerTest.cpp +++ b/unittests/datapoollocal/LocalPoolManagerTest.cpp @@ -18,8 +18,8 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { LocalPoolOwnerBase* poolOwner = ObjectManager::instance()->get(objects::TEST_LOCAL_POOL_OWNER_BASE); REQUIRE(poolOwner != nullptr); - REQUIRE(poolOwner->initializeHkManager() == retval::CATCH_OK); - REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == retval::CATCH_OK); + REQUIRE(poolOwner->initializeHkManager() == result::OK); + REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == result::OK); MessageQueueMockBase* poolOwnerMock = poolOwner->getMockQueueHandle(); REQUIRE(poolOwnerMock != nullptr); @@ -38,14 +38,14 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { CHECK(owner->getObjectId() == objects::TEST_LOCAL_POOL_OWNER_BASE); /* Subscribe for message generation on update. */ - REQUIRE(poolOwner->subscribeWrapperSetUpdate() == retval::CATCH_OK); + REQUIRE(poolOwner->subscribeWrapperSetUpdate() == result::OK); /* Subscribe for an update message. */ poolOwner->dataset.setChanged(true); /* Now the update message should be generated. */ - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); REQUIRE(poolOwnerMock->wasMessageSent() == true); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_SET)); @@ -53,27 +53,27 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { CHECK(poolOwner->dataset.hasChanged() == false); /* Set changed again, result should be the same. */ poolOwner->dataset.setChanged(true); - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_SET)); /* Now subscribe for set update HK as well. */ - REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == retval::CATCH_OK); + REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == result::OK); poolOwner->dataset.setChanged(true); - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 2); /* first message sent should be the update notification, considering the internal list is a vector checked in insertion order. */ - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_SET)); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::HK_REPORT)); /* Clear message to avoid memory leak, our mock won't do it for us (yet) */ CommandMessageCleaner::clearCommandMessage(&messageSent); @@ -83,7 +83,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* Set the variables in the set to certain values. These are checked later. */ { PoolReadGuard readHelper(&poolOwner->dataset); - REQUIRE(readHelper.getReadResult() == retval::CATCH_OK); + REQUIRE(readHelper.getReadResult() == result::OK); poolOwner->dataset.localPoolVarUint8.value = 5; poolOwner->dataset.localPoolVarFloat.value = -12.242; poolOwner->dataset.localPoolUint16Vec.value[0] = 2; @@ -92,7 +92,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { } /* Subscribe for snapshot generation on update. */ - REQUIRE(poolOwner->subscribeWrapperSetUpdateSnapshot() == retval::CATCH_OK); + REQUIRE(poolOwner->subscribeWrapperSetUpdateSnapshot() == result::OK); poolOwner->dataset.setChanged(true); /* Store current time, we are going to check the (approximate) time equality later */ @@ -100,10 +100,10 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { Clock::getClock_timeval(&now); /* Trigger generation of snapshot */ - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); /* Check that snapshot was generated */ CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_SNAPSHOT_SET)); /* Now we deserialize the snapshot into a new dataset instance */ @@ -113,7 +113,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { store_address_t storeId; HousekeepingMessage::getUpdateSnapshotSetCommand(&messageSent, &storeId); ConstAccessorPair accessorPair = tglob::getIpcStoreHandle()->getData(storeId); - REQUIRE(accessorPair.first == retval::CATCH_OK); + REQUIRE(accessorPair.first == result::OK); const uint8_t* readOnlyPtr = accessorPair.second.data(); size_t sizeToDeserialize = accessorPair.second.size(); CHECK(newSet.localPoolVarFloat.value == 0); @@ -123,7 +123,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { CHECK(newSet.localPoolUint16Vec.value[2] == 0); /* Fill the dataset and timestamp */ REQUIRE(snapshot.deSerialize(&readOnlyPtr, &sizeToDeserialize, - SerializeIF::Endianness::MACHINE) == retval::CATCH_OK); + SerializeIF::Endianness::MACHINE) == result::OK); /* Now we check that the snapshot is actually correct */ CHECK(newSet.localPoolVarFloat.value == Catch::Approx(-12.242)); CHECK(newSet.localPoolVarUint8 == 5); @@ -145,14 +145,14 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { REQUIRE(subscriptionIF != nullptr); /* Subscribe for variable snapshot */ - REQUIRE(poolOwner->subscribeWrapperVariableSnapshot(lpool::uint8VarId) == retval::CATCH_OK); + REQUIRE(poolOwner->subscribeWrapperVariableSnapshot(lpool::uint8VarId) == result::OK); auto poolVar = dynamic_cast*>(poolOwner->getPoolObjectHandle(lpool::uint8VarId)); REQUIRE(poolVar != nullptr); { PoolReadGuard rg(poolVar); - CHECK(rg.getReadResult() == retval::CATCH_OK); + CHECK(rg.getReadResult() == result::OK); poolVar->value = 25; } @@ -161,7 +161,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { CCSDSTime::CDS_short timeCdsNow; timeval now; Clock::getClock_timeval(&now); - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); /* Check update snapshot was sent. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); @@ -169,7 +169,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* Should have been reset. */ CHECK(poolVar->hasChanged() == false); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_SNAPSHOT_VARIABLE)); /* Now we deserialize the snapshot into a new dataset instance */ @@ -179,13 +179,13 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { store_address_t storeId; HousekeepingMessage::getUpdateSnapshotVariableCommand(&messageSent, &storeId); ConstAccessorPair accessorPair = tglob::getIpcStoreHandle()->getData(storeId); - REQUIRE(accessorPair.first == retval::CATCH_OK); + REQUIRE(accessorPair.first == result::OK); const uint8_t* readOnlyPtr = accessorPair.second.data(); size_t sizeToDeserialize = accessorPair.second.size(); CHECK(varCopy.value == 0); /* Fill the dataset and timestamp */ REQUIRE(snapshot.deSerialize(&readOnlyPtr, &sizeToDeserialize, - SerializeIF::Endianness::MACHINE) == retval::CATCH_OK); + SerializeIF::Endianness::MACHINE) == result::OK); CHECK(varCopy.value == 25); /* Now we check that both times are equal */ @@ -202,30 +202,30 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { REQUIRE(subscriptionIF != nullptr); /* Subscribe for variable update */ - REQUIRE(poolOwner->subscribeWrapperVariableUpdate(lpool::uint8VarId) == retval::CATCH_OK); + REQUIRE(poolOwner->subscribeWrapperVariableUpdate(lpool::uint8VarId) == result::OK); lp_var_t* poolVar = dynamic_cast*>(poolOwner->getPoolObjectHandle(lpool::uint8VarId)); REQUIRE(poolVar != nullptr); poolVar->setChanged(true); REQUIRE(poolVar->hasChanged() == true); - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); /* Check update notification was sent. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); /* Should have been reset. */ CHECK(poolVar->hasChanged() == false); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_VARIABLE)); /* Now subscribe for the dataset update (HK and update) again with subscription interface */ REQUIRE(subscriptionIF->subscribeForSetUpdateMessage(lpool::testSetId, objects::NO_OBJECT, objects::HK_RECEIVER_MOCK, - false) == retval::CATCH_OK); - REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == retval::CATCH_OK); + false) == result::OK); + REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == result::OK); poolOwner->dataset.setChanged(true); - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); /* Now two messages should be sent. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 2); @@ -233,17 +233,17 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { poolOwner->dataset.setChanged(true); poolVar->setChanged(true); - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); /* Now three messages should be sent. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 3); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_VARIABLE)); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_SET)); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == retval::CATCH_OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::HK_REPORT)); CommandMessageCleaner::clearCommandMessage(&messageSent); REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == static_cast(MessageQueueIF::EMPTY)); @@ -254,70 +254,70 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { the temporal behaviour correctly the HK manager should generate a HK packet immediately and the periodic helper depends on HK op function calls anyway instead of using the clock, so we could also just call performHkOperation multiple times */ - REQUIRE(poolOwner->subscribePeriodicHk(true) == retval::CATCH_OK); - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(poolOwner->subscribePeriodicHk(true) == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); /* Now HK packet should be sent as message immediately. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); LocalPoolDataSetBase* setHandle = poolOwner->getDataSetHandle(lpool::testSid); REQUIRE(setHandle != nullptr); CHECK(poolOwner->poolManager.generateHousekeepingPacket(lpool::testSid, setHandle, false) == - retval::CATCH_OK); + result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); CHECK(setHandle->getReportingEnabled() == true); CommandMessage hkCmd; HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, false, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); CHECK(setHandle->getReportingEnabled() == false); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, true, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); CHECK(setHandle->getReportingEnabled() == true); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, false, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); CHECK(setHandle->getReportingEnabled() == false); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setCollectionIntervalModificationCommand(&hkCmd, lpool::testSid, 0.4, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); /* For non-diagnostics and a specified minimum frequency of 0.2 seconds, the resulting collection interval should be 1.0 second */ CHECK(poolOwner->dataset.getCollectionInterval() == 1.0); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setStructureReportingCommand(&hkCmd, lpool::testSid, false); - REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); /* Now HK packet should be sent as message. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setOneShotReportCommand(&hkCmd, lpool::testSid, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setUpdateNotificationSetCommand(&hkCmd, lpool::testSid); sid_t sidToCheck; store_address_t storeId; - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); CHECK(poolOwner->changedDataSetCallbackWasCalled(sidToCheck, storeId) == true); CHECK(sidToCheck == lpool::testSid); @@ -330,7 +330,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* We still expect a failure message being sent */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setCollectionIntervalModificationCommand(&hkCmd, lpool::testSid, 0.4, false); @@ -338,68 +338,68 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { static_cast(LocalDataPoolManager::WRONG_HK_PACKET_TYPE)); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setStructureReportingCommand(&hkCmd, lpool::testSid, false); CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == static_cast(LocalDataPoolManager::WRONG_HK_PACKET_TYPE)); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setStructureReportingCommand(&hkCmd, lpool::testSid, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setCollectionIntervalModificationCommand(&hkCmd, lpool::testSid, 0.4, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, true, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, false, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setOneShotReportCommand(&hkCmd, lpool::testSid, false); CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == static_cast(LocalDataPoolManager::WRONG_HK_PACKET_TYPE)); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setOneShotReportCommand(&hkCmd, lpool::testSid, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == retval::CATCH_OK); + CHECK(poolOwnerMock->popMessage() == result::OK); HousekeepingMessage::setUpdateNotificationVariableCommand(&hkCmd, lpool::uint8VarGpid); gp_id_t gpidToCheck; - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); CHECK(poolOwner->changedVariableCallbackWasCalled(gpidToCheck, storeId) == true); CHECK(gpidToCheck == lpool::uint8VarGpid); HousekeepingMessage::setUpdateSnapshotSetCommand(&hkCmd, lpool::testSid, storeId::INVALID_STORE_ADDRESS); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); CHECK(poolOwner->changedDataSetCallbackWasCalled(sidToCheck, storeId) == true); CHECK(sidToCheck == lpool::testSid); HousekeepingMessage::setUpdateSnapshotVariableCommand(&hkCmd, lpool::uint8VarGpid, storeId::INVALID_STORE_ADDRESS); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); CHECK(poolOwner->changedVariableCallbackWasCalled(gpidToCheck, storeId) == true); CHECK(gpidToCheck == lpool::uint8VarGpid); @@ -408,6 +408,6 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* we need to reset the subscription list because the pool owner is a global object. */ - CHECK(poolOwner->reset() == retval::CATCH_OK); + CHECK(poolOwner->reset() == result::OK); poolOwnerMock->clearMessages(true); } diff --git a/unittests/datapoollocal/LocalPoolVariableTest.cpp b/unittests/datapoollocal/LocalPoolVariableTest.cpp index 3479cdbe..e9bed9ed 100644 --- a/unittests/datapoollocal/LocalPoolVariableTest.cpp +++ b/unittests/datapoollocal/LocalPoolVariableTest.cpp @@ -11,23 +11,23 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { auto* poolOwner = ObjectManager::instance()->get(objects::TEST_LOCAL_POOL_OWNER_BASE); REQUIRE(poolOwner != nullptr); - REQUIRE(poolOwner->initializeHkManager() == retval::CATCH_OK); - REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == retval::CATCH_OK); + REQUIRE(poolOwner->initializeHkManager() == result::OK); + REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == result::OK); SECTION("Basic Tests") { /* very basic test. */ lp_var_t testVariable = lp_var_t(objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint8VarId); - REQUIRE(testVariable.read() == retval::CATCH_OK); + REQUIRE(testVariable.read() == result::OK); CHECK(testVariable.value == 0); testVariable.value = 5; - REQUIRE(testVariable.commit() == retval::CATCH_OK); - REQUIRE(testVariable.read() == retval::CATCH_OK); + REQUIRE(testVariable.commit() == result::OK); + REQUIRE(testVariable.read() == result::OK); REQUIRE(testVariable.value == 5); CHECK(not testVariable.isValid()); testVariable.setValid(true); CHECK(testVariable.isValid()); - CHECK(testVariable.commit(true) == retval::CATCH_OK); + CHECK(testVariable.commit(true) == result::OK); testVariable.setReadWriteMode(pool_rwm_t::VAR_READ); CHECK(testVariable.getReadWriteMode() == pool_rwm_t::VAR_READ); @@ -43,7 +43,7 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { gp_id_t globPoolId(objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint8VarId); lp_var_t testVariable2 = lp_var_t(globPoolId); - REQUIRE(testVariable2.read() == retval::CATCH_OK); + REQUIRE(testVariable2.read() == result::OK); CHECK(testVariable2 == 5); CHECK(testVariable == testVariable2); testVariable = 10; @@ -55,12 +55,12 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { CHECK(maxSize == 1); size_t serSize = 0; CHECK(testVariable.serialize(&varPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - retval::CATCH_OK); + result::OK); CHECK(variableRaw == 10); const uint8_t* varConstPtr = &variableRaw; testVariable = 5; CHECK(testVariable.deSerialize(&varConstPtr, &serSize, SerializeIF::Endianness::MACHINE) == - retval::CATCH_OK); + result::OK); CHECK(testVariable == 10); CHECK(testVariable != testVariable2); CHECK(testVariable2 < testVariable); @@ -107,5 +107,5 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { lp_var_t invalidObjectVar3 = lp_var_t(nullptr, lpool::uint8VarId); } - CHECK(poolOwner->reset() == retval::CATCH_OK); + CHECK(poolOwner->reset() == result::OK); } diff --git a/unittests/datapoollocal/LocalPoolVectorTest.cpp b/unittests/datapoollocal/LocalPoolVectorTest.cpp index 2235ad39..ddf6da9b 100644 --- a/unittests/datapoollocal/LocalPoolVectorTest.cpp +++ b/unittests/datapoollocal/LocalPoolVectorTest.cpp @@ -11,26 +11,26 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { LocalPoolOwnerBase* poolOwner = ObjectManager::instance()->get(objects::TEST_LOCAL_POOL_OWNER_BASE); REQUIRE(poolOwner != nullptr); - REQUIRE(poolOwner->initializeHkManager() == retval::CATCH_OK); - REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == retval::CATCH_OK); + REQUIRE(poolOwner->initializeHkManager() == result::OK); + REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == result::OK); SECTION("BasicTest") { // very basic test. lp_vec_t testVector = lp_vec_t(objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint16Vec3Id); - REQUIRE(testVector.read() == retval::CATCH_OK); + REQUIRE(testVector.read() == result::OK); testVector.value[0] = 5; testVector.value[1] = 232; testVector.value[2] = 32023; - REQUIRE(testVector.commit(true) == retval::CATCH_OK); + REQUIRE(testVector.commit(true) == result::OK); CHECK(testVector.isValid()); testVector.value[0] = 0; testVector.value[1] = 0; testVector.value[2] = 0; - CHECK(testVector.read() == retval::CATCH_OK); + CHECK(testVector.read() == result::OK); CHECK(testVector.value[0] == 5); CHECK(testVector.value[1] == 232); CHECK(testVector.value[2] == 32023); @@ -41,7 +41,7 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { (we can't throw exceptions) */ testVector[4] = 12; CHECK(testVector[2] == 12); - CHECK(testVector.commit() == retval::CATCH_OK); + CHECK(testVector.commit() == result::OK); /* Use read-only reference. */ const lp_vec_t& roTestVec = testVector; @@ -58,7 +58,7 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { uint8_t* vecPtr = reinterpret_cast(serializedVector); size_t serSize = 0; REQUIRE(testVector.serialize(&vecPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - retval::CATCH_OK); + result::OK); CHECK(serSize == 6); CHECK(serializedVector[0] == 5); @@ -75,7 +75,7 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { const uint8_t* constVecPtr = reinterpret_cast(serializedVector); REQUIRE(testVector.deSerialize(&constVecPtr, &serSize, SerializeIF::Endianness::MACHINE) == - retval::CATCH_OK); + result::OK); CHECK(testVector[0] == 16); CHECK(testVector[1] == 7832); CHECK(testVector[2] == 39232); diff --git a/unittests/globalfunctions/testDleEncoder.cpp b/unittests/globalfunctions/testDleEncoder.cpp index 0c707f4c..fc4d79bf 100644 --- a/unittests/globalfunctions/testDleEncoder.cpp +++ b/unittests/globalfunctions/testDleEncoder.cpp @@ -60,7 +60,7 @@ TEST_CASE("DleEncoder", "[DleEncoder]") { const std::vector& expectedVec) { result = encoder.encode(vecToEncode.data(), vecToEncode.size(), buffer.data(), buffer.size(), &encodedLen); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); for (size_t idx = 0; idx < expectedVec.size(); idx++) { REQUIRE(buffer[idx] == expectedVec[idx]); } @@ -71,7 +71,7 @@ TEST_CASE("DleEncoder", "[DleEncoder]") { const std::vector& expectedVec) { result = encoder.decode(testVecEncoded.data(), testVecEncoded.size(), &readLen, buffer.data(), buffer.size(), &decodedLen); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); REQUIRE(readLen == testVecEncoded.size()); REQUIRE(decodedLen == expectedVec.size()); for (size_t idx = 0; idx < decodedLen; idx++) { diff --git a/unittests/internalerror/TestInternalErrorReporter.cpp b/unittests/internalerror/TestInternalErrorReporter.cpp index 2b999fae..b61a6203 100644 --- a/unittests/internalerror/TestInternalErrorReporter.cpp +++ b/unittests/internalerror/TestInternalErrorReporter.cpp @@ -38,7 +38,7 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") { CommandMessage message; ActionMessage::setCompletionReply(&message, 10, true); auto result = hkQueue->sendMessage(testQueue->getId(), &message); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); uint32_t queueHits = 0; uint32_t lostTm = 0; uint32_t storeHits = 0; diff --git a/unittests/osal/TestMessageQueue.cpp b/unittests/osal/TestMessageQueue.cpp index df15b33d..b1792a9c 100644 --- a/unittests/osal/TestMessageQueue.cpp +++ b/unittests/osal/TestMessageQueue.cpp @@ -19,17 +19,17 @@ TEST_CASE("MessageQueue Basic Test", "[TestMq]") { SECTION("Simple Tests") { auto result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); MessageQueueMessage recvMessage; result = testReceiverMq->receiveMessage(&recvMessage); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(recvMessage.getData()[0] == 42); result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); MessageQueueId_t senderId = 0; result = testReceiverMq->receiveMessage(&recvMessage, &senderId); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(recvMessage.getData()[0] == 42); CHECK(senderId == testSenderMqId); senderId = testReceiverMq->getLastPartner(); @@ -37,7 +37,7 @@ TEST_CASE("MessageQueue Basic Test", "[TestMq]") { } SECTION("Test Full") { auto result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); REQUIRE(result == MessageQueueIF::FULL); // We try another message @@ -45,12 +45,12 @@ TEST_CASE("MessageQueue Basic Test", "[TestMq]") { REQUIRE(result == MessageQueueIF::FULL); MessageQueueMessage recvMessage; result = testReceiverMq->receiveMessage(&recvMessage); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(recvMessage.getData()[0] == 42); result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = testReceiverMq->receiveMessage(&recvMessage); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(recvMessage.getData()[0] == 42); } // We have to clear MQs ourself ATM diff --git a/unittests/osal/TestSemaphore.cpp b/unittests/osal/TestSemaphore.cpp index 6988af5b..376b08db 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) == - retval::CATCH_OK); + result::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() == retval::CATCH_OK); + REQUIRE(binSemaph->release() == result::OK); } SemaphoreFactory::instance()->deleteSemaphore(binSemaph); // perform tear-down here diff --git a/unittests/serialize/TestSerialBufferAdapter.cpp b/unittests/serialize/TestSerialBufferAdapter.cpp index 2aa76ec8..2a8fe68c 100644 --- a/unittests/serialize/TestSerialBufferAdapter.cpp +++ b/unittests/serialize/TestSerialBufferAdapter.cpp @@ -102,7 +102,7 @@ TEST_CASE("Serial Buffer Adapter", "[single-file]") { size_t size = 6; auto result = tv_serial_buffer_adapter3.deSerialize(const_cast(&arrayPtr), &size, SerializeIF::Endianness::MACHINE); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(test_recv_array[0] == 1); CHECK(test_recv_array[1] == 1); CHECK(test_recv_array[2] == 1); diff --git a/unittests/serialize/TestSerialLinkedPacket.cpp b/unittests/serialize/TestSerialLinkedPacket.cpp index 2d6e476f..863c77a9 100644 --- a/unittests/serialize/TestSerialLinkedPacket.cpp +++ b/unittests/serialize/TestSerialLinkedPacket.cpp @@ -41,7 +41,7 @@ TEST_CASE("Serial Linked Packet", "[SerLinkPacket]") { // Deserialize big endian packet by setting bigEndian to true. ReturnValue_t result = testClass.deSerialize(&readOnlyPointer, &packetLen, SerializeIF::Endianness::BIG); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(testClass.getHeader() == 42); // Equivalent check. // CHECK(testClass.getBuffer()[0] == 1); @@ -60,7 +60,7 @@ TEST_CASE("Serial Linked Packet", "[SerLinkPacket]") { // serialize for ground: bigEndian = true. ReturnValue_t result = testClass.serialize(&packetPointer, &serializedSize, packetMaxSize, SerializeIF::Endianness::BIG); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); // Result should be big endian now. CHECK(packet[3] == 42); CHECK(packet[4] == 1); diff --git a/unittests/storagemanager/TestNewAccessor.cpp b/unittests/storagemanager/TestNewAccessor.cpp index 2cc2e469..311ba44d 100644 --- a/unittests/storagemanager/TestNewAccessor.cpp +++ b/unittests/storagemanager/TestNewAccessor.cpp @@ -12,7 +12,7 @@ TEST_CASE("New Accessor", "[NewAccessor]") { std::array testDataArray; std::array receptionArray; store_address_t testStoreId; - ReturnValue_t result = retval::CATCH_FAILED; + ReturnValue_t result = result::FAILED; for (size_t i = 0; i < testDataArray.size(); i++) { testDataArray[i] = i; @@ -21,9 +21,9 @@ TEST_CASE("New Accessor", "[NewAccessor]") { SECTION("Simple tests getter functions") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); auto resultPair = SimplePool.getData(testStoreId); - REQUIRE(resultPair.first == retval::CATCH_OK); + REQUIRE(resultPair.first == result::OK); resultPair.second.getDataCopy(receptionArray.data(), 20); CHECK(resultPair.second.getId() == testStoreId); CHECK(resultPair.second.size() == 10); @@ -39,18 +39,18 @@ TEST_CASE("New Accessor", "[NewAccessor]") { { auto resultPairLoc = SimplePool.getData(testStoreId); - REQUIRE(resultPairLoc.first == retval::CATCH_OK); + REQUIRE(resultPairLoc.first == result::OK); // data should be deleted when accessor goes out of scope. } resultPair = SimplePool.getData(testStoreId); REQUIRE(resultPair.first == (int)StorageManagerIF::DATA_DOES_NOT_EXIST); result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); { ConstStorageAccessor constAccessor(testStoreId); result = SimplePool.getData(testStoreId, constAccessor); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); constAccessor.getDataCopy(receptionArray.data(), 20); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -63,12 +63,12 @@ TEST_CASE("New Accessor", "[NewAccessor]") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); { resultPair = SimplePool.getData(testStoreId); - REQUIRE(resultPair.first == retval::CATCH_OK); + REQUIRE(resultPair.first == result::OK); resultPair.second.release(); // now data should not be deleted anymore } resultPair = SimplePool.getData(testStoreId); - REQUIRE(resultPair.first == retval::CATCH_OK); + REQUIRE(resultPair.first == result::OK); resultPair.second.getDataCopy(receptionArray.data(), 20); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -77,11 +77,11 @@ TEST_CASE("New Accessor", "[NewAccessor]") { SECTION("Simple tests modify functions") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); { StorageAccessor accessor(testStoreId); result = SimplePool.modifyData(testStoreId, accessor); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(accessor.getId() == testStoreId); CHECK(accessor.size() == 10); accessor.getDataCopy(receptionArray.data(), 20); @@ -98,10 +98,10 @@ TEST_CASE("New Accessor", "[NewAccessor]") { REQUIRE(resultPair.first == (int)StorageManagerIF::DATA_DOES_NOT_EXIST); result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); { auto resultPairLoc = SimplePool.modifyData(testStoreId); - REQUIRE(resultPairLoc.first == retval::CATCH_OK); + REQUIRE(resultPairLoc.first == result::OK); CHECK(resultPairLoc.second.getId() == testStoreId); CHECK(resultPairLoc.second.size() == 10); resultPairLoc.second.getDataCopy(receptionArray.data(), 20); @@ -117,22 +117,22 @@ TEST_CASE("New Accessor", "[NewAccessor]") { // data should not be deleted when accessor goes out of scope } resultPair = SimplePool.getData(testStoreId); - REQUIRE(resultPair.first == retval::CATCH_OK); + REQUIRE(resultPair.first == result::OK); } SECTION("Write tests") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); { auto resultPair = SimplePool.modifyData(testStoreId); - REQUIRE(resultPair.first == retval::CATCH_OK); + REQUIRE(resultPair.first == result::OK); testDataArray[9] = 42; resultPair.second.write(testDataArray.data(), 10, 0); // now data should not be deleted resultPair.second.release(); } auto resultConstPair = SimplePool.getData(testStoreId); - REQUIRE(resultConstPair.first == retval::CATCH_OK); + REQUIRE(resultConstPair.first == result::OK); resultConstPair.second.getDataCopy(receptionArray.data(), 10); for (size_t i = 0; i < size - 1; i++) { @@ -141,15 +141,15 @@ TEST_CASE("New Accessor", "[NewAccessor]") { CHECK(receptionArray[9] == 42); auto resultPair = SimplePool.modifyData(testStoreId); - REQUIRE(resultPair.first == retval::CATCH_OK); + REQUIRE(resultPair.first == result::OK); result = resultPair.second.write(testDataArray.data(), 20, 0); - REQUIRE(result == retval::CATCH_FAILED); + REQUIRE(result == result::FAILED); result = resultPair.second.write(testDataArray.data(), 10, 5); - REQUIRE(result == retval::CATCH_FAILED); + REQUIRE(result == result::FAILED); std::memset(testDataArray.data(), 42, 5); result = resultPair.second.write(testDataArray.data(), 5, 5); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); resultConstPair = SimplePool.getData(testStoreId); resultPair.second.getDataCopy(receptionArray.data(), 20); for (size_t i = 5; i < 10; i++) { @@ -159,7 +159,7 @@ TEST_CASE("New Accessor", "[NewAccessor]") { SECTION("Operators") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); { StorageAccessor accessor(testStoreId); StorageAccessor accessor2(0); diff --git a/unittests/storagemanager/TestPool.cpp b/unittests/storagemanager/TestPool.cpp index e37c6934..f3c4f330 100644 --- a/unittests/storagemanager/TestPool.cpp +++ b/unittests/storagemanager/TestPool.cpp @@ -13,7 +13,7 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { std::array testDataArray; std::array receptionArray; store_address_t testStoreId; - ReturnValue_t result = retval::CATCH_FAILED; + ReturnValue_t result = result::FAILED; uint8_t* pointer = nullptr; const uint8_t* constPointer = nullptr; @@ -24,9 +24,9 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { SECTION("Basic tests") { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = simplePool.getData(testStoreId, &constPointer, &size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); memcpy(receptionArray.data(), constPointer, size); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -34,12 +34,12 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { memset(receptionArray.data(), 0, size); result = simplePool.modifyData(testStoreId, &pointer, &size); memcpy(receptionArray.data(), pointer, size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); } result = simplePool.deleteData(testStoreId); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = simplePool.addData(&testStoreId, testDataArray.data(), 15); CHECK(result == (int)StorageManagerIF::DATA_TOO_LARGE); } @@ -47,12 +47,12 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { SECTION("Reservation Tests ") { pointer = nullptr; result = simplePool.getFreeElement(&testStoreId, size, &pointer); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); memcpy(pointer, testDataArray.data(), size); constPointer = nullptr; result = simplePool.getData(testStoreId, &constPointer, &size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); memcpy(receptionArray.data(), constPointer, size); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -61,21 +61,21 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { SECTION("Add, delete, add, add when full") { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = simplePool.getData(testStoreId, &constPointer, &size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); memcpy(receptionArray.data(), constPointer, size); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); } result = simplePool.deleteData(testStoreId); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = simplePool.getData(testStoreId, &constPointer, &size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); memcpy(receptionArray.data(), constPointer, size); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -102,20 +102,20 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { SECTION("Initialize and clear store, delete with pointer") { result = simplePool.initialize(); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); simplePool.clearStore(); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); result = simplePool.modifyData(testStoreId, &pointer, &size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); store_address_t newId; result = simplePool.deleteData(pointer, size, &testStoreId); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); REQUIRE(testStoreId.raw != (uint32_t)StorageManagerIF::INVALID_ADDRESS); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); } } @@ -141,7 +141,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { std::array testDataArray; std::array receptionArray; store_address_t testStoreId; - ReturnValue_t result = retval::CATCH_FAILED; + ReturnValue_t result = result::FAILED; for (size_t i = 0; i < testDataArray.size(); i++) { testDataArray[i] = i; } @@ -150,20 +150,20 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { SECTION("Basic tests") { size = 8; result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); // Should be on second page of the pool now for 8 bytes CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == 0); size = 15; result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); // Should be on third page of the pool now for 15 bytes CHECK(testStoreId.poolIndex == 2); CHECK(testStoreId.packetIndex == 0); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); // Should be on third page of the pool now for 15 bytes CHECK(testStoreId.poolIndex == 2); CHECK(testStoreId.packetIndex == 1); @@ -174,7 +174,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { size = 8; result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); // Should still work CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == 1); @@ -182,7 +182,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { // fill the rest of the pool for (uint8_t idx = 2; idx < 5; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == idx); } @@ -203,21 +203,21 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { size = 5; for (uint8_t idx = 0; idx < 10; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(testStoreId.poolIndex == 0); CHECK(testStoreId.packetIndex == idx); } size = 10; for (uint8_t idx = 0; idx < 5; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == idx); } size = 20; for (uint8_t idx = 0; idx < 2; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(testStoreId.poolIndex == 2); CHECK(testStoreId.packetIndex == idx); } @@ -244,7 +244,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { size = 5; for (uint8_t idx = 0; idx < 10; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(testStoreId.poolIndex == 0); CHECK(testStoreId.packetIndex == idx); } @@ -261,7 +261,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { size = 10; for (uint8_t idx = 0; idx < 5; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == retval::CATCH_OK); + REQUIRE(result == result::OK); CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == idx); } From 62fe75ee40b52e708dce907153226f9f014e2c4d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 15 Aug 2022 20:28:16 +0200 Subject: [PATCH 04/10] perform renaming --- .../PollingSequenceFactory.cpp | 2 +- src/fsfw/action/ActionHelper.cpp | 24 +-- src/fsfw/action/ActionHelper.h | 6 +- src/fsfw/action/ActionMessage.cpp | 2 +- src/fsfw/action/ActionMessage.h | 4 +- src/fsfw/action/CommandActionHelper.cpp | 30 ++-- src/fsfw/action/SimpleActionHelper.cpp | 8 +- src/fsfw/action/SimpleActionHelper.h | 4 +- src/fsfw/cfdp/CFDPHandler.cpp | 12 +- src/fsfw/cfdp/CFDPHandler.h | 3 +- src/fsfw/cfdp/FileSize.h | 6 +- src/fsfw/cfdp/definitions.h | 18 +- src/fsfw/cfdp/pdu/AckPduDeserializer.cpp | 4 +- src/fsfw/cfdp/pdu/AckPduSerializer.cpp | 6 +- src/fsfw/cfdp/pdu/EofPduDeserializer.cpp | 8 +- src/fsfw/cfdp/pdu/EofPduSerializer.cpp | 4 +- src/fsfw/cfdp/pdu/FileDataDeserializer.cpp | 6 +- src/fsfw/cfdp/pdu/FileDataInfo.cpp | 4 +- src/fsfw/cfdp/pdu/FileDataSerializer.cpp | 6 +- .../cfdp/pdu/FileDirectiveDeserializer.cpp | 4 +- src/fsfw/cfdp/pdu/FileDirectiveSerializer.cpp | 6 +- src/fsfw/cfdp/pdu/FinishedInfo.cpp | 10 +- src/fsfw/cfdp/pdu/FinishedPduDeserializer.cpp | 10 +- src/fsfw/cfdp/pdu/FinishedPduSerializer.cpp | 6 +- src/fsfw/cfdp/pdu/HeaderDeserializer.cpp | 4 +- src/fsfw/cfdp/pdu/HeaderDeserializer.h | 4 +- src/fsfw/cfdp/pdu/HeaderSerializer.cpp | 12 +- .../cfdp/pdu/KeepAlivePduDeserializer.cpp | 2 +- src/fsfw/cfdp/pdu/KeepAlivePduSerializer.cpp | 2 +- src/fsfw/cfdp/pdu/MetadataInfo.cpp | 4 +- src/fsfw/cfdp/pdu/MetadataPduDeserializer.cpp | 10 +- src/fsfw/cfdp/pdu/MetadataPduSerializer.cpp | 10 +- src/fsfw/cfdp/pdu/NakPduDeserializer.cpp | 10 +- src/fsfw/cfdp/pdu/NakPduSerializer.cpp | 10 +- src/fsfw/cfdp/pdu/PromptPduDeserializer.cpp | 4 +- src/fsfw/cfdp/pdu/PromptPduSerializer.cpp | 2 +- src/fsfw/cfdp/pdu/VarLenField.cpp | 18 +- src/fsfw/cfdp/tlv/FaultHandlerOverrideTlv.cpp | 6 +- src/fsfw/cfdp/tlv/FilestoreRequestTlv.cpp | 12 +- src/fsfw/cfdp/tlv/FilestoreResponseTlv.cpp | 12 +- src/fsfw/cfdp/tlv/FilestoreTlvBase.h | 10 +- src/fsfw/cfdp/tlv/Lv.cpp | 10 +- src/fsfw/cfdp/tlv/Tlv.cpp | 12 +- src/fsfw/container/ArrayList.h | 2 +- src/fsfw/container/FIFOBase.tpp | 10 +- src/fsfw/container/FixedMap.h | 20 +-- src/fsfw/container/FixedOrderedMultimap.h | 2 +- src/fsfw/container/FixedOrderedMultimap.tpp | 12 +- src/fsfw/container/IndexedRingMemoryArray.h | 44 ++--- src/fsfw/container/PlacementFactory.h | 4 +- src/fsfw/container/RingBufferBase.h | 8 +- src/fsfw/container/SimpleRingBuffer.cpp | 22 +-- src/fsfw/container/SimpleRingBuffer.h | 4 +- src/fsfw/controller/ControllerBase.cpp | 24 +-- src/fsfw/controller/ControllerBase.h | 3 +- .../controller/ExtendedControllerBase.cpp | 22 +-- src/fsfw/coordinates/Sgp4Propagator.cpp | 4 +- src/fsfw/datalinklayer/DataLinkLayer.cpp | 22 +-- src/fsfw/datalinklayer/DataLinkLayer.h | 2 +- src/fsfw/datalinklayer/Farm1StateOpen.cpp | 2 +- .../datalinklayer/MapPacketExtraction.cpp | 12 +- src/fsfw/datalinklayer/MapPacketExtraction.h | 2 +- .../datalinklayer/VirtualChannelReception.cpp | 18 +- .../datalinklayer/VirtualChannelReception.h | 4 +- src/fsfw/datapool/PoolDataSetBase.cpp | 32 ++-- src/fsfw/datapool/PoolDataSetBase.h | 6 +- src/fsfw/datapool/PoolReadGuard.h | 4 +- src/fsfw/datapool/ReadCommitIFAttorney.h | 4 +- src/fsfw/datapoollocal/HasLocalDataPoolIF.h | 6 +- .../datapoollocal/LocalDataPoolManager.cpp | 96 +++++------ src/fsfw/datapoollocal/LocalDataPoolManager.h | 6 +- .../datapoollocal/LocalPoolDataSetBase.cpp | 16 +- src/fsfw/datapoollocal/LocalPoolObjectBase.h | 2 +- src/fsfw/datapoollocal/LocalPoolVariable.tpp | 12 +- src/fsfw/datapoollocal/LocalPoolVector.tpp | 16 +- src/fsfw/datapoollocal/SharedLocalDataSet.cpp | 4 +- src/fsfw/devicehandlers/AssemblyBase.cpp | 24 +-- src/fsfw/devicehandlers/AssemblyBase.h | 2 +- src/fsfw/devicehandlers/ChildHandlerBase.cpp | 6 +- .../devicehandlers/DeviceCommunicationIF.h | 2 +- src/fsfw/devicehandlers/DeviceHandlerBase.cpp | 158 +++++++++--------- src/fsfw/devicehandlers/DeviceHandlerBase.h | 23 ++- .../DeviceHandlerFailureIsolation.cpp | 16 +- .../DeviceTmReportingWrapper.cpp | 8 +- src/fsfw/devicehandlers/HealthDevice.cpp | 6 +- src/fsfw/events/EventManager.cpp | 12 +- .../events/eventmatching/EventMatchTree.cpp | 10 +- .../events/eventmatching/EventMatchTree.h | 2 +- src/fsfw/fdir/FailureIsolationBase.cpp | 14 +- src/fsfw/fdir/FailureIsolationBase.h | 3 +- src/fsfw/fdir/FaultCounter.cpp | 2 +- src/fsfw/globalfunctions/AsciiConverter.cpp | 10 +- src/fsfw/globalfunctions/AsciiConverter.h | 2 +- src/fsfw/globalfunctions/DleEncoder.cpp | 8 +- src/fsfw/globalfunctions/DleEncoder.h | 2 +- src/fsfw/globalfunctions/Type.cpp | 14 +- src/fsfw/globalfunctions/matching/MatchTree.h | 28 ++-- .../globalfunctions/matching/RangeMatcher.h | 8 +- src/fsfw/health/HealthHelper.cpp | 16 +- src/fsfw/health/HealthHelper.h | 4 +- src/fsfw/health/HealthTable.cpp | 18 +- src/fsfw/housekeeping/HousekeepingSetPacket.h | 4 +- src/fsfw/housekeeping/HousekeepingSnapshot.h | 4 +- .../internalerror/InternalErrorReporter.cpp | 8 +- src/fsfw/ipc/MutexGuard.h | 4 +- src/fsfw/memory/GenericFileSystemMessage.cpp | 4 +- src/fsfw/memory/HasMemoryIF.h | 4 +- src/fsfw/memory/MemoryHelper.cpp | 22 +-- src/fsfw/memory/MemoryHelper.h | 2 +- src/fsfw/modes/HasModesIF.h | 2 +- src/fsfw/modes/ModeHelper.cpp | 8 +- src/fsfw/monitoring/AbsLimitMonitor.h | 4 +- src/fsfw/monitoring/LimitMonitor.h | 4 +- .../monitoring/LimitViolationReporter.cpp | 10 +- src/fsfw/monitoring/MonitorBase.h | 6 +- src/fsfw/monitoring/MonitorReporter.h | 6 +- src/fsfw/monitoring/TriplexMonitor.h | 14 +- src/fsfw/monitoring/TwoValueLimitMonitor.h | 2 +- src/fsfw/objectmanager/ObjectManager.cpp | 10 +- src/fsfw/objectmanager/ObjectManagerIF.h | 2 +- src/fsfw/objectmanager/SystemObject.cpp | 4 +- src/fsfw/objectmanager/SystemObjectIF.h | 2 +- src/fsfw/osal/common/TcpIpBase.cpp | 4 +- src/fsfw/osal/common/TcpTmTcBridge.cpp | 14 +- src/fsfw/osal/common/TcpTmTcServer.cpp | 34 ++-- src/fsfw/osal/common/TcpTmTcServer.h | 2 +- src/fsfw/osal/common/UdpTcPollingTask.cpp | 14 +- src/fsfw/osal/common/UdpTmTcBridge.cpp | 14 +- src/fsfw/osal/freertos/BinSemaphUsingTask.cpp | 8 +- src/fsfw/osal/freertos/BinSemaphUsingTask.h | 6 +- src/fsfw/osal/freertos/BinarySemaphore.cpp | 6 +- src/fsfw/osal/freertos/Clock.cpp | 22 +-- .../osal/freertos/CountingSemaphUsingTask.cpp | 8 +- src/fsfw/osal/freertos/FixedTimeslotTask.cpp | 4 +- src/fsfw/osal/freertos/MessageQueue.cpp | 6 +- src/fsfw/osal/freertos/Mutex.cpp | 4 +- src/fsfw/osal/freertos/PeriodicTask.cpp | 4 +- src/fsfw/osal/freertos/QueueMapManager.cpp | 4 +- src/fsfw/osal/freertos/TaskFactory.cpp | 6 +- src/fsfw/osal/host/Clock.cpp | 28 ++-- src/fsfw/osal/host/FixedTimeslotTask.cpp | 4 +- src/fsfw/osal/host/MessageQueue.cpp | 12 +- src/fsfw/osal/host/Mutex.cpp | 8 +- src/fsfw/osal/host/PeriodicTask.cpp | 4 +- src/fsfw/osal/host/QueueFactory.cpp | 2 +- src/fsfw/osal/host/QueueMapManager.cpp | 4 +- src/fsfw/osal/host/TaskFactory.cpp | 4 +- src/fsfw/osal/host/taskHelpers.cpp | 4 +- src/fsfw/osal/linux/BinarySemaphore.cpp | 18 +- src/fsfw/osal/linux/Clock.cpp | 36 ++-- src/fsfw/osal/linux/CountingSemaphore.cpp | 6 +- src/fsfw/osal/linux/FixedTimeslotTask.cpp | 2 +- src/fsfw/osal/linux/InternalErrorCodes.cpp | 2 +- src/fsfw/osal/linux/MessageQueue.cpp | 34 ++-- src/fsfw/osal/linux/Mutex.cpp | 8 +- src/fsfw/osal/linux/PeriodicPosixTask.cpp | 4 +- src/fsfw/osal/linux/PosixThread.cpp | 8 +- src/fsfw/osal/linux/TaskFactory.cpp | 2 +- src/fsfw/osal/rtems/BinarySemaphore.cpp | 4 +- src/fsfw/osal/rtems/Clock.cpp | 42 ++--- src/fsfw/osal/rtems/CpuUsage.cpp | 20 +-- src/fsfw/osal/rtems/FixedTimeslotTask.cpp | 4 +- src/fsfw/osal/rtems/InternalErrorCodes.cpp | 2 +- src/fsfw/osal/rtems/MessageQueue.cpp | 18 +- src/fsfw/osal/rtems/Mutex.cpp | 8 +- src/fsfw/osal/rtems/PeriodicTask.cpp | 4 +- src/fsfw/osal/rtems/QueueFactory.cpp | 12 +- src/fsfw/osal/rtems/RTEMSTaskBase.cpp | 18 +- src/fsfw/osal/rtems/TaskFactory.cpp | 4 +- src/fsfw/osal/windows/winTaskHelpers.cpp | 6 +- src/fsfw/parameters/ParameterHelper.cpp | 28 ++-- src/fsfw/parameters/ParameterWrapper.cpp | 28 ++-- src/fsfw/parameters/ParameterWrapper.h | 2 +- src/fsfw/power/DummyPowerSwitcher.cpp | 8 +- src/fsfw/power/Fuse.cpp | 38 ++--- src/fsfw/power/Fuse.h | 1 - src/fsfw/power/PowerComponent.cpp | 6 +- src/fsfw/power/PowerSensor.cpp | 22 +-- src/fsfw/power/PowerSwitchIF.h | 6 +- src/fsfw/power/PowerSwitcher.cpp | 10 +- src/fsfw/power/PowerSwitcher.h | 2 +- src/fsfw/power/PowerSwitcherComponent.cpp | 16 +- src/fsfw/power/PowerSwitcherComponent.h | 1 - src/fsfw/pus/CService200ModeCommanding.cpp | 18 +- src/fsfw/pus/CService201HealthCommanding.cpp | 10 +- .../pus/Service11TelecommandScheduling.tpp | 82 ++++----- src/fsfw/pus/Service17Test.cpp | 6 +- .../pus/Service1TelecommandVerification.cpp | 8 +- .../pus/Service1TelecommandVerification.h | 3 +- src/fsfw/pus/Service20ParameterManagement.cpp | 28 ++-- src/fsfw/pus/Service2DeviceAccess.cpp | 10 +- src/fsfw/pus/Service3Housekeeping.cpp | 36 ++-- src/fsfw/pus/Service5EventReporting.cpp | 18 +- src/fsfw/pus/Service8FunctionManagement.cpp | 14 +- src/fsfw/pus/Service9TimeManagement.cpp | 10 +- src/fsfw/pus/servicepackets/Service1Packets.h | 20 +-- src/fsfw/pus/servicepackets/Service5Packets.h | 10 +- src/fsfw/returnvalues/HasReturnvaluesIF.h | 38 ++--- src/fsfw/rmap/RmapDeviceCommunicationIF.cpp | 4 +- src/fsfw/serialize/SerialArrayListAdapter.h | 6 +- src/fsfw/serialize/SerialBufferAdapter.cpp | 12 +- src/fsfw/serialize/SerialLinkedListAdapter.h | 10 +- src/fsfw/serialize/SerializeAdapter.h | 16 +- src/fsfw/serialize/SerializeIF.h | 4 +- .../storagemanager/ConstStorageAccessor.cpp | 6 +- src/fsfw/storagemanager/LocalPool.cpp | 26 +-- src/fsfw/storagemanager/StorageAccessor.cpp | 12 +- src/fsfw/storagemanager/StorageManagerIF.h | 10 +- src/fsfw/subsystem/Subsystem.cpp | 80 ++++----- src/fsfw/subsystem/SubsystemBase.cpp | 50 +++--- src/fsfw/subsystem/SubsystemBase.h | 1 - src/fsfw/subsystem/modes/ModeDefinitions.h | 12 +- src/fsfw/subsystem/modes/ModeStore.cpp | 12 +- src/fsfw/tasks/ExecutableObjectIF.h | 2 +- src/fsfw/tasks/FixedSlotSequence.cpp | 12 +- src/fsfw/tasks/FixedTimeslotTaskBase.cpp | 4 +- src/fsfw/tasks/FixedTimeslotTaskIF.h | 6 +- src/fsfw/tasks/PeriodicTaskBase.cpp | 8 +- src/fsfw/tasks/PeriodicTaskIF.h | 4 +- src/fsfw/tcdistribution/CCSDSDistributor.cpp | 16 +- src/fsfw/tcdistribution/CCSDSDistributorIF.h | 4 +- src/fsfw/tcdistribution/CFDPDistributor.cpp | 12 +- src/fsfw/tcdistribution/CFDPDistributorIF.h | 2 +- src/fsfw/tcdistribution/PUSDistributor.cpp | 18 +- src/fsfw/tcdistribution/PUSDistributorIF.h | 2 +- src/fsfw/tcdistribution/TcDistributor.cpp | 10 +- src/fsfw/tcdistribution/TcDistributor.h | 6 +- src/fsfw/tcdistribution/TcPacketCheckCFDP.cpp | 2 +- src/fsfw/tcdistribution/TcPacketCheckCFDP.h | 2 +- src/fsfw/tcdistribution/TcPacketCheckPUS.cpp | 4 +- src/fsfw/tcdistribution/TcPacketCheckPUS.h | 2 +- .../thermal/AbstractTemperatureSensor.cpp | 16 +- src/fsfw/thermal/Heater.cpp | 36 ++-- src/fsfw/thermal/RedundantHeater.cpp | 2 +- src/fsfw/thermal/TemperatureSensor.h | 4 +- src/fsfw/thermal/ThermalComponent.cpp | 10 +- src/fsfw/thermal/ThermalComponentCore.cpp | 8 +- src/fsfw/thermal/ThermalModule.cpp | 2 +- src/fsfw/thermal/ThermalMonitorReporter.cpp | 8 +- src/fsfw/timemanager/CCSDSTime.cpp | 74 ++++---- src/fsfw/timemanager/CCSDSTime.h | 2 +- src/fsfw/timemanager/Clock.h | 6 +- src/fsfw/timemanager/ClockCommon.cpp | 28 ++-- src/fsfw/timemanager/TimeStamper.cpp | 4 +- src/fsfw/tmstorage/TmStoreMessage.cpp | 16 +- src/fsfw/tmstorage/TmStorePackets.h | 30 ++-- .../tmtcpacket/RedirectableDataPointerIF.h | 2 +- src/fsfw/tmtcpacket/SpacePacketBase.cpp | 8 +- src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.cpp | 14 +- .../packetmatcher/PacketMatchTree.cpp | 18 +- .../packetmatcher/PacketMatchTree.h | 2 +- src/fsfw/tmtcpacket/pus/tc/TcPacketPus.cpp | 6 +- .../tmtcpacket/pus/tc/TcPacketStoredBase.cpp | 6 +- .../tmtcpacket/pus/tc/TcPacketStoredPus.cpp | 6 +- .../tmtcpacket/pus/tm/TmPacketMinimal.cpp | 4 +- src/fsfw/tmtcpacket/pus/tm/TmPacketPusA.cpp | 4 +- src/fsfw/tmtcpacket/pus/tm/TmPacketPusC.cpp | 10 +- .../tmtcpacket/pus/tm/TmPacketStoredBase.cpp | 8 +- .../tmtcpacket/pus/tm/TmPacketStoredPusA.cpp | 4 +- .../tmtcpacket/pus/tm/TmPacketStoredPusC.cpp | 4 +- .../tmtcservices/CommandingServiceBase.cpp | 48 +++--- src/fsfw/tmtcservices/CommandingServiceBase.h | 11 +- src/fsfw/tmtcservices/PusServiceBase.cpp | 20 +-- src/fsfw/tmtcservices/PusServiceBase.h | 5 +- src/fsfw/tmtcservices/SpacePacketParser.cpp | 4 +- src/fsfw/tmtcservices/TmTcBridge.cpp | 42 ++--- src/fsfw/tmtcservices/TmTcBridge.h | 5 +- .../tmtcservices/VerificationReporter.cpp | 8 +- src/fsfw_hal/common/gpio/GpioCookie.cpp | 8 +- src/fsfw_hal/common/gpio/GpioIF.h | 4 +- .../devicehandlers/GyroL3GD20Handler.cpp | 14 +- .../devicehandlers/MgmLIS3MDLHandler.cpp | 26 +-- .../devicehandlers/MgmRM3100Handler.cpp | 22 +-- src/fsfw_hal/linux/CommandExecutor.cpp | 20 +-- src/fsfw_hal/linux/CommandExecutor.h | 16 +- src/fsfw_hal/linux/UnixFileGuard.h | 2 +- src/fsfw_hal/linux/gpio/LinuxLibgpioIF.cpp | 48 +++--- src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h | 2 +- src/fsfw_hal/linux/i2c/I2cComIF.cpp | 42 ++--- src/fsfw_hal/linux/i2c/I2cComIF.h | 2 +- src/fsfw_hal/linux/rpi/GpioRPi.cpp | 6 +- src/fsfw_hal/linux/spi/SpiComIF.cpp | 46 ++--- src/fsfw_hal/linux/uart/UartComIF.cpp | 52 +++--- src/fsfw_hal/linux/uio/UioMapper.cpp | 18 +- .../stm32h7/devicetest/GyroL3GD20H.cpp | 70 ++++---- src/fsfw_hal/stm32h7/spi/SpiComIF.cpp | 52 +++--- .../integration/assemblies/TestAssembly.cpp | 18 +- .../integration/controller/TestController.cpp | 6 +- .../integration/devices/TestDeviceHandler.cpp | 52 +++--- .../integration/devices/TestEchoComIF.cpp | 14 +- src/fsfw_tests/integration/task/TestTask.cpp | 10 +- .../internal/InternalUnitTester.cpp | 2 +- src/fsfw_tests/internal/InternalUnitTester.h | 2 +- src/fsfw_tests/internal/UnittDefinitions.cpp | 2 +- src/fsfw_tests/internal/osal/testMq.cpp | 8 +- src/fsfw_tests/internal/osal/testMutex.cpp | 4 +- .../internal/osal/testSemaphore.cpp | 10 +- .../serialize/IntTestSerialization.cpp | 14 +- unittests/action/TestActionHelper.cpp | 18 +- unittests/action/TestActionHelper.h | 2 +- unittests/cfdp/testAckPdu.cpp | 14 +- unittests/cfdp/testCfdp.cpp | 42 ++--- unittests/cfdp/testEofPdu.cpp | 18 +- unittests/cfdp/testFileData.cpp | 20 +-- unittests/cfdp/testFinishedPdu.cpp | 24 +-- unittests/cfdp/testKeepAlivePdu.cpp | 18 +- unittests/cfdp/testMetadataPdu.cpp | 20 +-- unittests/cfdp/testNakPdu.cpp | 30 ++-- unittests/cfdp/testPromptPdu.cpp | 14 +- unittests/cfdp/testTlvsLvs.cpp | 66 ++++---- unittests/container/RingBufferTest.cpp | 148 ++++++++-------- unittests/container/TestArrayList.cpp | 8 +- unittests/container/TestDynamicFifo.cpp | 46 ++--- unittests/container/TestFifo.cpp | 40 ++--- unittests/container/TestFixedArrayList.cpp | 4 +- unittests/container/TestFixedMap.cpp | 32 ++-- .../container/TestFixedOrderedMultimap.cpp | 36 ++-- unittests/container/TestPlacementFactory.cpp | 8 +- unittests/datapoollocal/DataSetTest.cpp | 44 ++--- .../datapoollocal/LocalPoolManagerTest.cpp | 144 ++++++++-------- .../datapoollocal/LocalPoolOwnerBase.cpp | 14 +- .../datapoollocal/LocalPoolVariableTest.cpp | 20 +-- .../datapoollocal/LocalPoolVectorTest.cpp | 16 +- unittests/devicehandler/ComIFMock.cpp | 12 +- .../devicehandler/DeviceHandlerCommander.cpp | 16 +- .../devicehandler/DeviceHandlerCommander.h | 5 +- unittests/devicehandler/DeviceHandlerMock.cpp | 10 +- .../devicehandler/TestDeviceHandlerBase.cpp | 10 +- unittests/globalfunctions/testDleEncoder.cpp | 6 +- unittests/hal/testCommandExecutor.cpp | 18 +- .../TestInternalErrorReporter.cpp | 16 +- unittests/mocks/MessageQueueMockBase.h | 6 +- unittests/mocks/PeriodicTaskIFMock.h | 4 +- unittests/mocks/PowerSwitcherMock.cpp | 8 +- unittests/osal/TestClock.cpp | 24 +-- unittests/osal/TestMessageQueue.cpp | 16 +- unittests/power/testPowerSwitcher.cpp | 2 +- .../serialize/testSerialBufferAdapter.cpp | 2 +- .../serialize/testSerialLinkedPacket.cpp | 4 +- unittests/serialize/testSerializeIF.cpp | 32 ++-- unittests/storagemanager/TestNewAccessor.cpp | 52 +++--- unittests/storagemanager/TestPool.cpp | 58 +++---- .../PollingSequenceFactory.cpp | 6 +- unittests/timemanager/TestCCSDSTime.cpp | 24 +-- unittests/timemanager/TestCountdown.cpp | 4 +- 345 files changed, 2451 insertions(+), 2473 deletions(-) diff --git a/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp b/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp index b7f1fb3e..c8baaf34 100644 --- a/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp +++ b/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp @@ -19,7 +19,7 @@ ReturnValue_t pst::pollingSequenceInitDefault( sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return HasReturnvaluesIF::returnvalue::FAILED; } } diff --git a/src/fsfw/action/ActionHelper.cpp b/src/fsfw/action/ActionHelper.cpp index bee68b40..fd6c8afb 100644 --- a/src/fsfw/action/ActionHelper.cpp +++ b/src/fsfw/action/ActionHelper.cpp @@ -12,7 +12,7 @@ ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) { if (command->getCommand() == ActionMessage::EXECUTE_ACTION) { ActionId_t currentAction = ActionMessage::getActionId(command); prepareExecution(command->getSender(), currentAction, ActionMessage::getStoreId(command)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return CommandMessage::UNKNOWN_COMMAND; } @@ -21,7 +21,7 @@ ReturnValue_t ActionHelper::handleActionMessage(CommandMessage* command) { ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) { ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); if (ipcStore == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (queueToUse_ != nullptr) { setQueueToUse(queueToUse_); @@ -35,10 +35,10 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) { sif::printWarning("ActionHelper::initialize: No queue set\n"); #endif #endif /* FSFW_VERBOSE_LEVEL >= 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void ActionHelper::step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId, @@ -62,7 +62,7 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act const uint8_t* dataPtr = nullptr; size_t size = 0; ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { CommandMessage reply; ActionMessage::setStepReply(&reply, actionId, 0, result); queueToUse->sendMessage(commandedBy, &reply); @@ -75,7 +75,7 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act ActionMessage::setCompletionReply(&reply, actionId, true, result); queueToUse->sendMessage(commandedBy, &reply); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { CommandMessage reply; ActionMessage::setStepReply(&reply, actionId, 0, result); queueToUse->sendMessage(commandedBy, &reply); @@ -91,11 +91,11 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep size_t maxSize = data->getSerializedSize(); if (maxSize == 0) { /* No error, there's simply nothing to report. */ - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t size = 0; ReturnValue_t result = ipcStore->getFreeElement(&storeAddress, maxSize, &dataPtr); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "ActionHelper::reportData: Getting free element from IPC store failed!" << std::endl; @@ -107,7 +107,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep return result; } result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ipcStore->deleteData(storeAddress); return result; } @@ -124,7 +124,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep result = queueToUse->sendMessage(reportTo, &reply); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ipcStore->deleteData(storeAddress); } return result; @@ -137,7 +137,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep CommandMessage reply; store_address_t storeAddress; ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "ActionHelper::reportData: Adding data to IPC store failed!" << std::endl; #else @@ -158,7 +158,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep result = queueToUse->sendMessage(reportTo, &reply); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ipcStore->deleteData(storeAddress); } return result; diff --git a/src/fsfw/action/ActionHelper.h b/src/fsfw/action/ActionHelper.h index a9910b05..16abb212 100644 --- a/src/fsfw/action/ActionHelper.h +++ b/src/fsfw/action/ActionHelper.h @@ -36,7 +36,7 @@ class ActionHelper { * send to the sender of the message automatically. * * @param command Pointer to a command message received by the owner - * @return HasReturnvaluesIF::RETURN_OK if the message is a action message, + * @return returnvalue::OK if the message is a action message, * CommandMessage::UNKNOW_COMMAND if this message ID is unkown */ ReturnValue_t handleActionMessage(CommandMessage* command); @@ -58,7 +58,7 @@ class ActionHelper { * @param result Result of the execution */ void step(uint8_t step, MessageQueueId_t reportTo, ActionId_t commandId, - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK); + ReturnValue_t result = returnvalue::OK); /** * Function to be called by the owner to send a action completion message * @param success Specify whether action was completed successfully or not. @@ -67,7 +67,7 @@ class ActionHelper { * @param result Result of the execution */ void finish(bool success, MessageQueueId_t reportTo, ActionId_t commandId, - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK); + ReturnValue_t result = returnvalue::OK); /** * Function to be called by the owner if an action does report data. * Takes a SerializeIF* pointer and serializes it into the IPC store. diff --git a/src/fsfw/action/ActionMessage.cpp b/src/fsfw/action/ActionMessage.cpp index 7fc68558..33088055 100644 --- a/src/fsfw/action/ActionMessage.cpp +++ b/src/fsfw/action/ActionMessage.cpp @@ -25,7 +25,7 @@ store_address_t ActionMessage::getStoreId(const CommandMessage* message) { void ActionMessage::setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step, ReturnValue_t result) { - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { message->setCommand(STEP_SUCCESS); } else { message->setCommand(STEP_FAILED); diff --git a/src/fsfw/action/ActionMessage.h b/src/fsfw/action/ActionMessage.h index bd12cc19..38e3aa99 100644 --- a/src/fsfw/action/ActionMessage.h +++ b/src/fsfw/action/ActionMessage.h @@ -33,12 +33,12 @@ class ActionMessage { static store_address_t getStoreId(const CommandMessage* message); static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step, - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK); + ReturnValue_t result = returnvalue::OK); static uint8_t getStep(const CommandMessage* message); static ReturnValue_t getReturnCode(const CommandMessage* message); static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data); static void setCompletionReply(CommandMessage* message, ActionId_t fid, bool success, - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK); + ReturnValue_t result = returnvalue::OK); static void clear(CommandMessage* message); }; diff --git a/src/fsfw/action/CommandActionHelper.cpp b/src/fsfw/action/CommandActionHelper.cpp index a06bc44c..831cd862 100644 --- a/src/fsfw/action/CommandActionHelper.cpp +++ b/src/fsfw/action/CommandActionHelper.cpp @@ -16,12 +16,12 @@ ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId uint8_t *storePointer; size_t maxSize = data->getSerializedSize(); ReturnValue_t result = ipcStore->getFreeElement(&storeId, maxSize, &storePointer); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t size = 0; result = data->serialize(&storePointer, &size, maxSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return sendCommand(receiver->getCommandQueue(), actionId, storeId); @@ -35,7 +35,7 @@ ReturnValue_t CommandActionHelper::commandAction(object_id_t commandTo, ActionId } store_address_t storeId; ReturnValue_t result = ipcStore->addData(&storeId, data, size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return sendCommand(receiver->getCommandQueue(), actionId, storeId); @@ -46,7 +46,7 @@ ReturnValue_t CommandActionHelper::sendCommand(MessageQueueId_t queueId, ActionI CommandMessage command; ActionMessage::setCommand(&command, actionId, storeId); ReturnValue_t result = queueToUse->sendMessage(queueId, &command); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ipcStore->deleteData(storeId); } lastTarget = queueId; @@ -57,44 +57,44 @@ ReturnValue_t CommandActionHelper::sendCommand(MessageQueueId_t queueId, ActionI ReturnValue_t CommandActionHelper::initialize() { ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); if (ipcStore == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } queueToUse = owner->getCommandQueuePtr(); if (queueToUse == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t CommandActionHelper::handleReply(CommandMessage *reply) { if (reply->getSender() != lastTarget) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } switch (reply->getCommand()) { case ActionMessage::COMPLETION_SUCCESS: commandCount--; owner->completionSuccessfulReceived(ActionMessage::getActionId(reply)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case ActionMessage::COMPLETION_FAILED: commandCount--; owner->completionFailedReceived(ActionMessage::getActionId(reply), ActionMessage::getReturnCode(reply)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case ActionMessage::STEP_SUCCESS: owner->stepSuccessfulReceived(ActionMessage::getActionId(reply), ActionMessage::getStep(reply)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case ActionMessage::STEP_FAILED: commandCount--; owner->stepFailedReceived(ActionMessage::getActionId(reply), ActionMessage::getStep(reply), ActionMessage::getReturnCode(reply)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case ActionMessage::DATA_REPLY: extractDataForOwner(ActionMessage::getActionId(reply), ActionMessage::getStoreId(reply)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -104,7 +104,7 @@ void CommandActionHelper::extractDataForOwner(ActionId_t actionId, store_address const uint8_t *data = nullptr; size_t size = 0; ReturnValue_t result = ipcStore->getData(storeId, &data, &size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } owner->dataReceived(actionId, data, size); diff --git a/src/fsfw/action/SimpleActionHelper.cpp b/src/fsfw/action/SimpleActionHelper.cpp index fc7e064e..b9b9922e 100644 --- a/src/fsfw/action/SimpleActionHelper.cpp +++ b/src/fsfw/action/SimpleActionHelper.cpp @@ -9,7 +9,7 @@ void SimpleActionHelper::step(ReturnValue_t result) { // STEP_OFFESET is subtracted to compensate for adding offset in base // method, which is not necessary here. ActionHelper::step(stepCount - STEP_OFFSET, lastCommander, lastAction, result); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { resetHelper(); } } @@ -41,7 +41,7 @@ void SimpleActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId const uint8_t* dataPtr = nullptr; size_t size = 0; ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ActionMessage::setStepReply(&reply, actionId, 0, result); queueToUse->sendMessage(commandedBy, &reply); return; @@ -51,12 +51,12 @@ void SimpleActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId result = owner->executeAction(actionId, commandedBy, dataPtr, size); ipcStore->deleteData(dataAddress); switch (result) { - case HasReturnvaluesIF::RETURN_OK: + case returnvalue::OK: isExecuting = true; stepCount++; break; case HasActionsIF::EXECUTION_FINISHED: - ActionMessage::setCompletionReply(&reply, actionId, true, HasReturnvaluesIF::RETURN_OK); + ActionMessage::setCompletionReply(&reply, actionId, true, returnvalue::OK); queueToUse->sendMessage(commandedBy, &reply); break; default: diff --git a/src/fsfw/action/SimpleActionHelper.h b/src/fsfw/action/SimpleActionHelper.h index 973c7cf2..cfe05231 100644 --- a/src/fsfw/action/SimpleActionHelper.h +++ b/src/fsfw/action/SimpleActionHelper.h @@ -12,8 +12,8 @@ class SimpleActionHelper : public ActionHelper { public: SimpleActionHelper(HasActionsIF* setOwner, MessageQueueIF* useThisQueue); ~SimpleActionHelper() override; - void step(ReturnValue_t result = HasReturnvaluesIF::RETURN_OK); - void finish(ReturnValue_t result = HasReturnvaluesIF::RETURN_OK); + void step(ReturnValue_t result = returnvalue::OK); + void finish(ReturnValue_t result = returnvalue::OK); ReturnValue_t reportData(SerializeIF* data); protected: diff --git a/src/fsfw/cfdp/CFDPHandler.cpp b/src/fsfw/cfdp/CFDPHandler.cpp index 96baa98c..d5cdbb46 100644 --- a/src/fsfw/cfdp/CFDPHandler.cpp +++ b/src/fsfw/cfdp/CFDPHandler.cpp @@ -20,11 +20,11 @@ CFDPHandler::~CFDPHandler() {} ReturnValue_t CFDPHandler::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } this->distributor->registerHandler(this); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) { @@ -38,18 +38,18 @@ ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) { // TODO read out packet from store using storeId - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CFDPHandler::performOperation(uint8_t opCode) { - ReturnValue_t status = RETURN_OK; + ReturnValue_t status = returnvalue::OK; CommandMessage currentMessage; - for (status = this->requestQueue->receiveMessage(¤tMessage); status == RETURN_OK; + for (status = this->requestQueue->receiveMessage(¤tMessage); status == returnvalue::OK; status = this->requestQueue->receiveMessage(¤tMessage)) { store_address_t storeId = CFDPMessage::getStoreId(¤tMessage); this->handleRequest(storeId); } - return RETURN_OK; + return returnvalue::OK; } uint16_t CFDPHandler::getIdentifier() { return 0; } diff --git a/src/fsfw/cfdp/CFDPHandler.h b/src/fsfw/cfdp/CFDPHandler.h index abbac6b6..6888f9d7 100644 --- a/src/fsfw/cfdp/CFDPHandler.h +++ b/src/fsfw/cfdp/CFDPHandler.h @@ -14,8 +14,7 @@ void setStaticFrameworkObjectIds(); class CFDPHandler : public ExecutableObjectIF, public AcceptsTelecommandsIF, - public SystemObject, - public HasReturnvaluesIF { + public SystemObject { friend void(Factory::setStaticFrameworkObjectIds)(); public: diff --git a/src/fsfw/cfdp/FileSize.h b/src/fsfw/cfdp/FileSize.h index 6dae9683..756b0e0a 100644 --- a/src/fsfw/cfdp/FileSize.h +++ b/src/fsfw/cfdp/FileSize.h @@ -43,7 +43,7 @@ struct FileSize : public SerializeIF { uint32_t sizeTmp = 0; ReturnValue_t result = SerializeAdapter::deSerialize(&sizeTmp, buffer, size, streamEndianness); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { fileSize = sizeTmp; } return result; @@ -53,11 +53,11 @@ struct FileSize : public SerializeIF { ReturnValue_t setFileSize(uint64_t fileSize, bool largeFile) { if (not largeFile and fileSize > UINT32_MAX) { // TODO: emit warning here - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } this->fileSize = fileSize; this->largeFile = largeFile; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } bool isLargeFile() const { return largeFile; } diff --git a/src/fsfw/cfdp/definitions.h b/src/fsfw/cfdp/definitions.h index 7e023881..b8827f63 100644 --- a/src/fsfw/cfdp/definitions.h +++ b/src/fsfw/cfdp/definitions.h @@ -16,27 +16,27 @@ static constexpr uint8_t VERSION_BITS = 0b00100000; static constexpr uint8_t CFDP_CLASS_ID = CLASS_ID::CFDP; static constexpr ReturnValue_t INVALID_TLV_TYPE = - result::makeCode(CFDP_CLASS_ID, 1); + returnvalue::makeCode(CFDP_CLASS_ID, 1); static constexpr ReturnValue_t INVALID_DIRECTIVE_FIELDS = - result::makeCode(CFDP_CLASS_ID, 2); + returnvalue::makeCode(CFDP_CLASS_ID, 2); static constexpr ReturnValue_t INVALID_PDU_DATAFIELD_LEN = - result::makeCode(CFDP_CLASS_ID, 3); + returnvalue::makeCode(CFDP_CLASS_ID, 3); static constexpr ReturnValue_t INVALID_ACK_DIRECTIVE_FIELDS = - result::makeCode(CFDP_CLASS_ID, 4); + returnvalue::makeCode(CFDP_CLASS_ID, 4); //! Can not parse options. This can also occur because there are options //! available but the user did not pass a valid options array static constexpr ReturnValue_t METADATA_CANT_PARSE_OPTIONS = - result::makeCode(CFDP_CLASS_ID, 5); + returnvalue::makeCode(CFDP_CLASS_ID, 5); static constexpr ReturnValue_t NAK_CANT_PARSE_OPTIONS = - result::makeCode(CFDP_CLASS_ID, 6); + returnvalue::makeCode(CFDP_CLASS_ID, 6); static constexpr ReturnValue_t FINISHED_CANT_PARSE_FS_RESPONSES = - result::makeCode(CFDP_CLASS_ID, 6); + returnvalue::makeCode(CFDP_CLASS_ID, 6); static constexpr ReturnValue_t FILESTORE_REQUIRES_SECOND_FILE = - result::makeCode(CFDP_CLASS_ID, 8); + returnvalue::makeCode(CFDP_CLASS_ID, 8); //! Can not parse filestore response because user did not pass a valid instance //! or remaining size is invalid static constexpr ReturnValue_t FILESTORE_RESPONSE_CANT_PARSE_FS_MESSAGE = - result::makeCode(CFDP_CLASS_ID, 9); + returnvalue::makeCode(CFDP_CLASS_ID, 9); //! Checksum types according to the SANA Checksum Types registry //! https://sanaregistry.org/r/checksum_identifiers/ diff --git a/src/fsfw/cfdp/pdu/AckPduDeserializer.cpp b/src/fsfw/cfdp/pdu/AckPduDeserializer.cpp index f5babf4b..24357a38 100644 --- a/src/fsfw/cfdp/pdu/AckPduDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/AckPduDeserializer.cpp @@ -5,7 +5,7 @@ AckPduDeserializer::AckPduDeserializer(const uint8_t* pduBuf, size_t maxSize, Ac ReturnValue_t AckPduDeserializer::parseData() { ReturnValue_t result = FileDirectiveDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t currentIdx = FileDirectiveDeserializer::getHeaderSize(); @@ -15,7 +15,7 @@ ReturnValue_t AckPduDeserializer::parseData() { if (not checkAndSetCodes(rawPtr[currentIdx], rawPtr[currentIdx + 1])) { return cfdp::INVALID_ACK_DIRECTIVE_FIELDS; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } bool AckPduDeserializer::checkAndSetCodes(uint8_t firstByte, uint8_t secondByte) { diff --git a/src/fsfw/cfdp/pdu/AckPduSerializer.cpp b/src/fsfw/cfdp/pdu/AckPduSerializer.cpp index d19418f1..b06f4f00 100644 --- a/src/fsfw/cfdp/pdu/AckPduSerializer.cpp +++ b/src/fsfw/cfdp/pdu/AckPduSerializer.cpp @@ -11,7 +11,7 @@ ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t Endianness streamEndianness) const { ReturnValue_t result = FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } cfdp::FileDirectives ackedDirective = ackInfo.getAckedDirective(); @@ -21,7 +21,7 @@ ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t if (ackedDirective != cfdp::FileDirectives::FINISH and ackedDirective != cfdp::FileDirectives::EOF_DIRECTIVE) { // TODO: better returncode - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (*size + 2 > maxSize) { return SerializeIF::BUFFER_TOO_SHORT; @@ -32,5 +32,5 @@ ReturnValue_t AckPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t **buffer = ackedConditionCode << 4 | transactionStatus; *buffer += 1; *size += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/cfdp/pdu/EofPduDeserializer.cpp b/src/fsfw/cfdp/pdu/EofPduDeserializer.cpp index e1ab8dc9..1a70e225 100644 --- a/src/fsfw/cfdp/pdu/EofPduDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/EofPduDeserializer.cpp @@ -8,7 +8,7 @@ EofPduDeserializer::EofPduDeserializer(const uint8_t* pduBuf, size_t maxSize, Eo ReturnValue_t EofPduDeserializer::parseData() { ReturnValue_t result = FileDirectiveDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -31,7 +31,7 @@ ReturnValue_t EofPduDeserializer::parseData() { uint32_t checksum = 0; auto endianness = getEndianness(); result = SerializeAdapter::deSerialize(&checksum, &bufPtr, &deserLen, endianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } info.setChecksum(checksum); @@ -44,7 +44,7 @@ ReturnValue_t EofPduDeserializer::parseData() { result = SerializeAdapter::deSerialize(&fileSizeValue, &bufPtr, &deserLen, endianness); info.setFileSize(fileSizeValue, false); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (info.getConditionCode() != cfdp::ConditionCode::NO_ERROR) { @@ -61,7 +61,7 @@ ReturnValue_t EofPduDeserializer::parseData() { " given TLV pointer invalid"); #endif #endif /* FSFW_VERBOSE_LEVEL >= 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } result = tlvPtr->deSerialize(&bufPtr, &deserLen, endianness); } diff --git a/src/fsfw/cfdp/pdu/EofPduSerializer.cpp b/src/fsfw/cfdp/pdu/EofPduSerializer.cpp index e9fe0ca0..aafd332e 100644 --- a/src/fsfw/cfdp/pdu/EofPduSerializer.cpp +++ b/src/fsfw/cfdp/pdu/EofPduSerializer.cpp @@ -16,7 +16,7 @@ ReturnValue_t EofPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t Endianness streamEndianness) const { ReturnValue_t result = FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (*size + 1 > maxSize) { @@ -27,7 +27,7 @@ ReturnValue_t EofPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t *size += 1; uint32_t checksum = info.getChecksum(); result = SerializeAdapter::serialize(&checksum, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (info.getFileSize().isLargeFile()) { diff --git a/src/fsfw/cfdp/pdu/FileDataDeserializer.cpp b/src/fsfw/cfdp/pdu/FileDataDeserializer.cpp index 240c4188..274f8b8a 100644 --- a/src/fsfw/cfdp/pdu/FileDataDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/FileDataDeserializer.cpp @@ -6,7 +6,7 @@ FileDataDeserializer::FileDataDeserializer(const uint8_t* pduBuf, size_t maxSize ReturnValue_t FileDataDeserializer::parseData() { ReturnValue_t result = HeaderDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t currentIdx = HeaderDeserializer::getHeaderSize(); @@ -32,13 +32,13 @@ ReturnValue_t FileDataDeserializer::parseData() { } } result = info.getOffset().deSerialize(&buf, &remSize, this->getEndianness()); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (remSize > 0) { info.setFileData(buf, remSize); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } SerializeIF::Endianness FileDataDeserializer::getEndianness() const { return endianness; } diff --git a/src/fsfw/cfdp/pdu/FileDataInfo.cpp b/src/fsfw/cfdp/pdu/FileDataInfo.cpp index c410adce..39b6472d 100644 --- a/src/fsfw/cfdp/pdu/FileDataInfo.cpp +++ b/src/fsfw/cfdp/pdu/FileDataInfo.cpp @@ -50,11 +50,11 @@ ReturnValue_t FileDataInfo::addSegmentMetadataInfo(cfdp::RecordContinuationState this->segmentMetadataFlag = cfdp::SegmentMetadataFlag::PRESENT; this->recContState = recContState; if (segmentMetadataLen > 63) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } this->segmentMetadata = segmentMetadata; this->segmentMetadataLen = segmentMetadataLen; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } const uint8_t *FileDataInfo::getFileData(size_t *fileSize) const { diff --git a/src/fsfw/cfdp/pdu/FileDataSerializer.cpp b/src/fsfw/cfdp/pdu/FileDataSerializer.cpp index 837b418b..bdc2d42f 100644 --- a/src/fsfw/cfdp/pdu/FileDataSerializer.cpp +++ b/src/fsfw/cfdp/pdu/FileDataSerializer.cpp @@ -17,7 +17,7 @@ void FileDataSerializer::update() { ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size_t maxSize, Endianness streamEndianness) const { ReturnValue_t result = HeaderSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (*size + this->getSerializedSize() > maxSize) { @@ -36,7 +36,7 @@ ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size } cfdp::FileSize& offset = info.getOffset(); result = offset.serialize(this->getLargeFileFlag(), buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t fileSize = 0; @@ -47,7 +47,7 @@ ReturnValue_t FileDataSerializer::serialize(uint8_t** buffer, size_t* size, size std::memcpy(*buffer, readOnlyPtr, fileSize); *buffer += fileSize; *size += fileSize; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t FileDataSerializer::getSerializedSize() const { diff --git a/src/fsfw/cfdp/pdu/FileDirectiveDeserializer.cpp b/src/fsfw/cfdp/pdu/FileDirectiveDeserializer.cpp index 3c0552f7..9d2a1e0a 100644 --- a/src/fsfw/cfdp/pdu/FileDirectiveDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/FileDirectiveDeserializer.cpp @@ -7,7 +7,7 @@ cfdp::FileDirectives FileDirectiveDeserializer::getFileDirective() const { retur ReturnValue_t FileDirectiveDeserializer::parseData() { ReturnValue_t result = HeaderDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (this->getPduDataFieldLen() < 1) { @@ -21,7 +21,7 @@ ReturnValue_t FileDirectiveDeserializer::parseData() { return cfdp::INVALID_DIRECTIVE_FIELDS; } setFileDirective(static_cast(rawPtr[currentIdx])); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t FileDirectiveDeserializer::getHeaderSize() const { diff --git a/src/fsfw/cfdp/pdu/FileDirectiveSerializer.cpp b/src/fsfw/cfdp/pdu/FileDirectiveSerializer.cpp index 98b2d0a2..5845ba56 100644 --- a/src/fsfw/cfdp/pdu/FileDirectiveSerializer.cpp +++ b/src/fsfw/cfdp/pdu/FileDirectiveSerializer.cpp @@ -13,13 +13,13 @@ size_t FileDirectiveSerializer::getSerializedSize() const { ReturnValue_t FileDirectiveSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize, Endianness streamEndianness) const { if (buffer == nullptr or size == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (FileDirectiveSerializer::getWholePduSize() > maxSize) { return BUFFER_TOO_SHORT; } ReturnValue_t result = HeaderSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -29,7 +29,7 @@ ReturnValue_t FileDirectiveSerializer::serialize(uint8_t **buffer, size_t *size, **buffer = directiveCode; *buffer += 1; *size += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void FileDirectiveSerializer::setDirectiveDataFieldLen(size_t len) { diff --git a/src/fsfw/cfdp/pdu/FinishedInfo.cpp b/src/fsfw/cfdp/pdu/FinishedInfo.cpp index c32372a1..ea4ffa89 100644 --- a/src/fsfw/cfdp/pdu/FinishedInfo.cpp +++ b/src/fsfw/cfdp/pdu/FinishedInfo.cpp @@ -46,14 +46,14 @@ ReturnValue_t FinishedInfo::setFilestoreResponsesArray(FilestoreResponseTlv** fs if (maxFsResponsesLen != nullptr) { this->fsResponsesMaxLen = *maxFsResponsesLen; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t FinishedInfo::getFilestoreResonses(FilestoreResponseTlv*** fsResponses, size_t* fsResponsesLen, size_t* fsResponsesMaxLen) { if (fsResponses == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *fsResponses = this->fsResponses; if (fsResponsesLen != nullptr) { @@ -62,7 +62,7 @@ ReturnValue_t FinishedInfo::getFilestoreResonses(FilestoreResponseTlv*** fsRespo if (fsResponsesMaxLen != nullptr) { *fsResponsesMaxLen = this->fsResponsesMaxLen; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void FinishedInfo::setFaultLocation(EntityIdTlv* faultLocation) { @@ -71,10 +71,10 @@ void FinishedInfo::setFaultLocation(EntityIdTlv* faultLocation) { ReturnValue_t FinishedInfo::getFaultLocation(EntityIdTlv** faultLocation) { if (this->faultLocation == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *faultLocation = this->faultLocation; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } cfdp::ConditionCode FinishedInfo::getConditionCode() const { return conditionCode; } diff --git a/src/fsfw/cfdp/pdu/FinishedPduDeserializer.cpp b/src/fsfw/cfdp/pdu/FinishedPduDeserializer.cpp index feeca617..7d16394e 100644 --- a/src/fsfw/cfdp/pdu/FinishedPduDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/FinishedPduDeserializer.cpp @@ -6,7 +6,7 @@ FinishPduDeserializer::FinishPduDeserializer(const uint8_t* pduBuf, size_t maxSi ReturnValue_t FinishPduDeserializer::parseData() { ReturnValue_t result = FileDirectiveDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t currentIdx = FileDirectiveDeserializer::getHeaderSize(); @@ -33,7 +33,7 @@ FinishedInfo& FinishPduDeserializer::getInfo() { return finishedInfo; } ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx, const uint8_t* buf, cfdp::ConditionCode conditionCode) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; size_t fsResponsesIdx = 0; auto endianness = getEndianness(); FilestoreResponseTlv** fsResponseArray = nullptr; @@ -60,7 +60,7 @@ ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx, return cfdp::FINISHED_CANT_PARSE_FS_RESPONSES; } result = fsResponseArray[fsResponsesIdx]->deSerialize(&buf, &remLen, endianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } fsResponsesIdx += 1; @@ -72,11 +72,11 @@ ReturnValue_t FinishPduDeserializer::parseTlvs(size_t remLen, size_t currentIdx, return cfdp::INVALID_TLV_TYPE; } result = finishedInfo.getFaultLocation(&faultLocation); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = faultLocation->deSerialize(&buf, &remLen, endianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } else { diff --git a/src/fsfw/cfdp/pdu/FinishedPduSerializer.cpp b/src/fsfw/cfdp/pdu/FinishedPduSerializer.cpp index 115a2c9c..ccc86908 100644 --- a/src/fsfw/cfdp/pdu/FinishedPduSerializer.cpp +++ b/src/fsfw/cfdp/pdu/FinishedPduSerializer.cpp @@ -17,7 +17,7 @@ ReturnValue_t FinishPduSerializer::serialize(uint8_t **buffer, size_t *size, siz Endianness streamEndianness) const { ReturnValue_t result = FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (*size + 1 >= maxSize) { @@ -34,13 +34,13 @@ ReturnValue_t FinishPduSerializer::serialize(uint8_t **buffer, size_t *size, siz finishInfo.getFilestoreResonses(&fsResponsesArray, &fsResponsesArrayLen, nullptr); for (size_t idx = 0; idx < fsResponsesArrayLen; idx++) { result = fsResponsesArray[idx]->serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } } EntityIdTlv *entityId = nullptr; - if (finishInfo.getFaultLocation(&entityId) == HasReturnvaluesIF::RETURN_OK) { + if (finishInfo.getFaultLocation(&entityId) == returnvalue::OK) { result = entityId->serialize(buffer, size, maxSize, streamEndianness); } return result; diff --git a/src/fsfw/cfdp/pdu/HeaderDeserializer.cpp b/src/fsfw/cfdp/pdu/HeaderDeserializer.cpp index 70f397f8..2dbfed27 100644 --- a/src/fsfw/cfdp/pdu/HeaderDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/HeaderDeserializer.cpp @@ -18,7 +18,7 @@ ReturnValue_t HeaderDeserializer::setData(uint8_t *dataPtr, size_t maxSize, void if (dataPtr == nullptr) { // Allowed for now this->fixedHeader = nullptr; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } this->fixedHeader = reinterpret_cast(const_cast(dataPtr)); sourceIdRaw = static_cast(&fixedHeader->variableFieldsStart); @@ -27,7 +27,7 @@ ReturnValue_t HeaderDeserializer::setData(uint8_t *dataPtr, size_t maxSize, void seqNumRaw = static_cast(sourceIdRaw) + static_cast(widthEntityIds); destIdRaw = static_cast(seqNumRaw) + static_cast(widthSeqNum); this->maxSize = maxSize; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t HeaderDeserializer::getHeaderSize() const { diff --git a/src/fsfw/cfdp/pdu/HeaderDeserializer.h b/src/fsfw/cfdp/pdu/HeaderDeserializer.h index ed033697..70a7908c 100644 --- a/src/fsfw/cfdp/pdu/HeaderDeserializer.h +++ b/src/fsfw/cfdp/pdu/HeaderDeserializer.h @@ -37,7 +37,7 @@ class HeaderDeserializer : public RedirectableDataPointerIF, public PduHeaderIF * This needs to be called before accessing the PDU fields to avoid segmentation faults. * @return * - RETURN_OK on parse success - * - RETURN_FAILED Invalid raw data + * - returnvalue::FAILED Invalid raw data * - SerializeIF::BUFFER_TOO_SHORT if buffer is shorter than expected */ virtual ReturnValue_t parseData(); @@ -61,7 +61,7 @@ class HeaderDeserializer : public RedirectableDataPointerIF, public PduHeaderIF void getDestId(cfdp::EntityId& destId) const override; void getTransactionSeqNum(cfdp::TransactionSeqNum& seqNum) const override; - ReturnValue_t deserResult = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t deserResult = returnvalue::OK; /** * Can also be used to reset the pointer to a nullptr, but the getter functions will not diff --git a/src/fsfw/cfdp/pdu/HeaderSerializer.cpp b/src/fsfw/cfdp/pdu/HeaderSerializer.cpp index 041fb714..5721ad69 100644 --- a/src/fsfw/cfdp/pdu/HeaderSerializer.cpp +++ b/src/fsfw/cfdp/pdu/HeaderSerializer.cpp @@ -15,7 +15,7 @@ HeaderSerializer::HeaderSerializer(PduConfig &pduConf, cfdp::PduType pduType, ReturnValue_t HeaderSerializer::serialize(uint8_t **buffer, size_t *size, size_t maxSize, Endianness streamEndianness) const { if (buffer == nullptr or size == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (maxSize < this->getSerializedSize()) { return BUFFER_TOO_SHORT; @@ -32,19 +32,19 @@ ReturnValue_t HeaderSerializer::serialize(uint8_t **buffer, size_t *size, size_t *buffer += 1; *size += 4; ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = pduConf.seqNum.serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = pduConf.destId.serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t HeaderSerializer::getSerializedSize() const { @@ -55,7 +55,7 @@ size_t HeaderSerializer::getSerializedSize() const { ReturnValue_t HeaderSerializer::deSerialize(const uint8_t **buffer, size_t *size, Endianness streamEndianness) { // We could implement this, but I prefer dedicated classes - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } size_t HeaderSerializer::getWholePduSize() const { diff --git a/src/fsfw/cfdp/pdu/KeepAlivePduDeserializer.cpp b/src/fsfw/cfdp/pdu/KeepAlivePduDeserializer.cpp index 15f80549..79c908cf 100644 --- a/src/fsfw/cfdp/pdu/KeepAlivePduDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/KeepAlivePduDeserializer.cpp @@ -6,7 +6,7 @@ KeepAlivePduDeserializer::KeepAlivePduDeserializer(const uint8_t* pduBuf, size_t ReturnValue_t KeepAlivePduDeserializer::parseData() { ReturnValue_t result = FileDirectiveDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t currentIdx = FileDirectiveDeserializer::getHeaderSize(); diff --git a/src/fsfw/cfdp/pdu/KeepAlivePduSerializer.cpp b/src/fsfw/cfdp/pdu/KeepAlivePduSerializer.cpp index e635ce06..5db4664c 100644 --- a/src/fsfw/cfdp/pdu/KeepAlivePduSerializer.cpp +++ b/src/fsfw/cfdp/pdu/KeepAlivePduSerializer.cpp @@ -19,7 +19,7 @@ ReturnValue_t KeepAlivePduSerializer::serialize(uint8_t **buffer, size_t *size, Endianness streamEndianness) const { ReturnValue_t result = FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return progress.serialize(this->getLargeFileFlag(), buffer, size, maxSize, streamEndianness); diff --git a/src/fsfw/cfdp/pdu/MetadataInfo.cpp b/src/fsfw/cfdp/pdu/MetadataInfo.cpp index a2ca6972..572460cd 100644 --- a/src/fsfw/cfdp/pdu/MetadataInfo.cpp +++ b/src/fsfw/cfdp/pdu/MetadataInfo.cpp @@ -39,7 +39,7 @@ cfdp::FileSize& MetadataInfo::getFileSize() { return fileSize; } ReturnValue_t MetadataInfo::getOptions(cfdp::Tlv*** optionsArray, size_t* optionsLen, size_t* maxOptsLen) { if (optionsArray == nullptr or this->optionsArray == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *optionsArray = this->optionsArray; if (optionsLen != nullptr) { @@ -48,7 +48,7 @@ ReturnValue_t MetadataInfo::getOptions(cfdp::Tlv*** optionsArray, size_t* option if (maxOptsLen != nullptr) { *maxOptsLen = this->maxOptionsLen; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } bool MetadataInfo::hasOptions() const { diff --git a/src/fsfw/cfdp/pdu/MetadataPduDeserializer.cpp b/src/fsfw/cfdp/pdu/MetadataPduDeserializer.cpp index 161eb63a..be9f4ed7 100644 --- a/src/fsfw/cfdp/pdu/MetadataPduDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/MetadataPduDeserializer.cpp @@ -6,7 +6,7 @@ MetadataPduDeserializer::MetadataPduDeserializer(const uint8_t* pduBuf, size_t m ReturnValue_t MetadataPduDeserializer::parseData() { ReturnValue_t result = FileDirectiveDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t currentIdx = FileDirectiveDeserializer::getHeaderSize(); @@ -21,15 +21,15 @@ ReturnValue_t MetadataPduDeserializer::parseData() { buf += 1; auto endianness = getEndianness(); result = info.getFileSize().deSerialize(&buf, &remSize, endianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = info.getSourceFileName().deSerialize(&buf, &remSize, endianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = info.getDestFileName().deSerialize(&buf, &remSize, endianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -47,7 +47,7 @@ ReturnValue_t MetadataPduDeserializer::parseData() { return cfdp::METADATA_CANT_PARSE_OPTIONS; } result = optionsArray[optsIdx]->deSerialize(&buf, &remSize, endianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } optsIdx++; diff --git a/src/fsfw/cfdp/pdu/MetadataPduSerializer.cpp b/src/fsfw/cfdp/pdu/MetadataPduSerializer.cpp index f5c4de0a..041b9b84 100644 --- a/src/fsfw/cfdp/pdu/MetadataPduSerializer.cpp +++ b/src/fsfw/cfdp/pdu/MetadataPduSerializer.cpp @@ -17,7 +17,7 @@ ReturnValue_t MetadataPduSerializer::serialize(uint8_t **buffer, size_t *size, s Endianness streamEndianness) const { ReturnValue_t result = FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (*size + 1 >= maxSize) { @@ -27,15 +27,15 @@ ReturnValue_t MetadataPduSerializer::serialize(uint8_t **buffer, size_t *size, s *buffer += 1; *size += 1; result = info.getFileSize().serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = info.getSourceFileName().serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = info.getDestFileName().serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -45,7 +45,7 @@ ReturnValue_t MetadataPduSerializer::serialize(uint8_t **buffer, size_t *size, s info.getOptions(&optsArray, &optsLen, nullptr); for (size_t idx = 0; idx < optsLen; idx++) { result = optsArray[idx]->serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } diff --git a/src/fsfw/cfdp/pdu/NakPduDeserializer.cpp b/src/fsfw/cfdp/pdu/NakPduDeserializer.cpp index 9d5f074c..8acc9fc9 100644 --- a/src/fsfw/cfdp/pdu/NakPduDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/NakPduDeserializer.cpp @@ -5,7 +5,7 @@ NakPduDeserializer::NakPduDeserializer(const uint8_t* pduBuf, size_t maxSize, Na ReturnValue_t NakPduDeserializer::parseData() { ReturnValue_t result = FileDirectiveDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t currentIdx = FileDirectiveDeserializer::getHeaderSize(); @@ -16,11 +16,11 @@ ReturnValue_t NakPduDeserializer::parseData() { } result = nakInfo.getStartOfScope().deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = nakInfo.getEndOfScope().deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } nakInfo.setSegmentRequestLen(0); @@ -39,12 +39,12 @@ ReturnValue_t NakPduDeserializer::parseData() { } result = segReqs[idx].first.deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = segReqs[idx].second.deSerialize(&buffer, &remSize, SerializeIF::Endianness::NETWORK); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } idx++; diff --git a/src/fsfw/cfdp/pdu/NakPduSerializer.cpp b/src/fsfw/cfdp/pdu/NakPduSerializer.cpp index 95f1bc98..e8634df7 100644 --- a/src/fsfw/cfdp/pdu/NakPduSerializer.cpp +++ b/src/fsfw/cfdp/pdu/NakPduSerializer.cpp @@ -17,15 +17,15 @@ ReturnValue_t NakPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t Endianness streamEndianness) const { ReturnValue_t result = FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = nakInfo.getStartOfScope().serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = nakInfo.getEndOfScope().serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (nakInfo.hasSegmentRequests()) { @@ -34,11 +34,11 @@ ReturnValue_t NakPduSerializer::serialize(uint8_t **buffer, size_t *size, size_t nakInfo.getSegmentRequests(&segmentRequests, &segmentRequestLen, nullptr); for (size_t idx = 0; idx < segmentRequestLen; idx++) { result = segmentRequests[idx].first.serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = segmentRequests[idx].second.serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } diff --git a/src/fsfw/cfdp/pdu/PromptPduDeserializer.cpp b/src/fsfw/cfdp/pdu/PromptPduDeserializer.cpp index 6a6f5505..7e9e328d 100644 --- a/src/fsfw/cfdp/pdu/PromptPduDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/PromptPduDeserializer.cpp @@ -9,7 +9,7 @@ cfdp::PromptResponseRequired PromptPduDeserializer::getPromptResponseRequired() ReturnValue_t PromptPduDeserializer::parseData() { ReturnValue_t result = FileDirectiveDeserializer::parseData(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t currentIdx = FileDirectiveDeserializer::getHeaderSize(); @@ -17,5 +17,5 @@ ReturnValue_t PromptPduDeserializer::parseData() { return SerializeIF::STREAM_TOO_SHORT; } responseRequired = static_cast((rawPtr[currentIdx] >> 7) & 0x01); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/cfdp/pdu/PromptPduSerializer.cpp b/src/fsfw/cfdp/pdu/PromptPduSerializer.cpp index a7287563..e5d5bca7 100644 --- a/src/fsfw/cfdp/pdu/PromptPduSerializer.cpp +++ b/src/fsfw/cfdp/pdu/PromptPduSerializer.cpp @@ -13,7 +13,7 @@ ReturnValue_t PromptPduSerializer::serialize(uint8_t **buffer, size_t *size, siz Endianness streamEndianness) const { ReturnValue_t result = FileDirectiveSerializer::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (*size + 1 > maxSize) { diff --git a/src/fsfw/cfdp/pdu/VarLenField.cpp b/src/fsfw/cfdp/pdu/VarLenField.cpp index b11c3b09..f0059270 100644 --- a/src/fsfw/cfdp/pdu/VarLenField.cpp +++ b/src/fsfw/cfdp/pdu/VarLenField.cpp @@ -6,7 +6,7 @@ cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, size_t value) : VarLenField() { ReturnValue_t result = this->setValue(width, value); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_DISABLE_PRINTOUT == 0 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "cfdp::VarLenField: Setting value failed" << std::endl; @@ -25,21 +25,21 @@ ReturnValue_t cfdp::VarLenField::setValue(cfdp::WidthInBytes widthInBytes, size_ switch (widthInBytes) { case (cfdp::WidthInBytes::ONE_BYTE): { if (value > UINT8_MAX) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } this->value.oneByte = value; break; } case (cfdp::WidthInBytes::TWO_BYTES): { if (value > UINT16_MAX) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } this->value.twoBytes = value; break; } case (cfdp::WidthInBytes::FOUR_BYTES): { if (value > UINT32_MAX) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } this->value.fourBytes = value; break; @@ -49,7 +49,7 @@ ReturnValue_t cfdp::VarLenField::setValue(cfdp::WidthInBytes widthInBytes, size_ } } this->width = widthInBytes; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t cfdp::VarLenField::getValue() const { @@ -77,7 +77,7 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_ **buffer = value.oneByte; *size += 1; *buffer += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case (cfdp::WidthInBytes::TWO_BYTES): { return SerializeAdapter::serialize(&value.twoBytes, buffer, size, maxSize, streamEndianness); @@ -86,7 +86,7 @@ ReturnValue_t cfdp::VarLenField::serialize(uint8_t **buffer, size_t *size, size_ return SerializeAdapter::serialize(&value.fourBytes, buffer, size, maxSize, streamEndianness); } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } } @@ -105,7 +105,7 @@ ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *siz case (cfdp::WidthInBytes::ONE_BYTE): { value.oneByte = **buffer; *size += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case (cfdp::WidthInBytes::TWO_BYTES): { return SerializeAdapter::deSerialize(&value.twoBytes, buffer, size, streamEndianness); @@ -114,7 +114,7 @@ ReturnValue_t cfdp::VarLenField::deSerialize(const uint8_t **buffer, size_t *siz return SerializeAdapter::deSerialize(&value.fourBytes, buffer, size, streamEndianness); } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } } diff --git a/src/fsfw/cfdp/tlv/FaultHandlerOverrideTlv.cpp b/src/fsfw/cfdp/tlv/FaultHandlerOverrideTlv.cpp index f5f777ea..bbcb61d2 100644 --- a/src/fsfw/cfdp/tlv/FaultHandlerOverrideTlv.cpp +++ b/src/fsfw/cfdp/tlv/FaultHandlerOverrideTlv.cpp @@ -22,7 +22,7 @@ ReturnValue_t FaultHandlerOverrideTlv::serialize(uint8_t **buffer, size_t *size, **buffer = this->conditionCode << 4 | this->handlerCode; *buffer += 1; *size += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t FaultHandlerOverrideTlv::getSerializedSize() const { return getLengthField() + 2; } @@ -40,7 +40,7 @@ ReturnValue_t FaultHandlerOverrideTlv::deSerialize(const uint8_t **buffer, size_ *size -= 1; size_t detectedSize = **buffer; if (detectedSize != getLengthField()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *buffer += 1; *size += 1; @@ -48,7 +48,7 @@ ReturnValue_t FaultHandlerOverrideTlv::deSerialize(const uint8_t **buffer, size_ this->handlerCode = static_cast(**buffer & 0x0f); *buffer += 1; *size += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } cfdp::TlvTypes FaultHandlerOverrideTlv::getType() const { return cfdp::TlvTypes::FAULT_HANDLER; } diff --git a/src/fsfw/cfdp/tlv/FilestoreRequestTlv.cpp b/src/fsfw/cfdp/tlv/FilestoreRequestTlv.cpp index 9ad7c645..941e8f5d 100644 --- a/src/fsfw/cfdp/tlv/FilestoreRequestTlv.cpp +++ b/src/fsfw/cfdp/tlv/FilestoreRequestTlv.cpp @@ -16,11 +16,11 @@ void FilestoreRequestTlv::setSecondFileName(cfdp::Lv *secondFileName) { ReturnValue_t FilestoreRequestTlv::serialize(uint8_t **buffer, size_t *size, size_t maxSize, Endianness streamEndianness) const { ReturnValue_t result = commonSerialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = firstFileName.serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (requiresSecondFileName()) { @@ -30,13 +30,13 @@ ReturnValue_t FilestoreRequestTlv::serialize(uint8_t **buffer, size_t *size, siz } secondFileName->serialize(buffer, size, maxSize, streamEndianness); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t FilestoreRequestTlv::deSerialize(const uint8_t **buffer, size_t *size, Endianness streamEndianness) { ReturnValue_t result = commonDeserialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return deSerializeFromValue(buffer, size, streamEndianness); @@ -63,13 +63,13 @@ ReturnValue_t FilestoreRequestTlv::deSerializeFromValue(const uint8_t **buffer, *buffer += 1; *size -= 1; ReturnValue_t result = firstFileName.deSerialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (requiresSecondFileName()) { if (secondFileName == nullptr) { secondFileNameMissing(); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } result = secondFileName->deSerialize(buffer, size, streamEndianness); } diff --git a/src/fsfw/cfdp/tlv/FilestoreResponseTlv.cpp b/src/fsfw/cfdp/tlv/FilestoreResponseTlv.cpp index 36945725..53aaaf8f 100644 --- a/src/fsfw/cfdp/tlv/FilestoreResponseTlv.cpp +++ b/src/fsfw/cfdp/tlv/FilestoreResponseTlv.cpp @@ -32,11 +32,11 @@ ReturnValue_t FilestoreResponseTlv::serialize(uint8_t **buffer, size_t *size, si Endianness streamEndianness) const { ReturnValue_t result = commonSerialize(buffer, size, maxSize, streamEndianness, true, this->statusCode); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = firstFileName.serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (requiresSecondFileName()) { @@ -61,7 +61,7 @@ ReturnValue_t FilestoreResponseTlv::serialize(uint8_t **buffer, size_t *size, si ReturnValue_t FilestoreResponseTlv::deSerialize(const uint8_t **buffer, size_t *size, Endianness streamEndianness) { ReturnValue_t result = commonDeserialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return deSerializeFromValue(buffer, size, streamEndianness); @@ -75,7 +75,7 @@ ReturnValue_t FilestoreResponseTlv::deSerializeFromValue(const uint8_t **buffer, *buffer += 1; *size -= 1; ReturnValue_t result = firstFileName.deSerialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (requiresSecondFileName()) { @@ -83,7 +83,7 @@ ReturnValue_t FilestoreResponseTlv::deSerializeFromValue(const uint8_t **buffer, return cfdp::FILESTORE_REQUIRES_SECOND_FILE; } result = secondFileName->deSerialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -98,7 +98,7 @@ ReturnValue_t FilestoreResponseTlv::deSerializeFromValue(const uint8_t **buffer, *size -= 1; *buffer += 1; // Ignore empty filestore message - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } return filestoreMsg->deSerialize(buffer, size, streamEndianness); } diff --git a/src/fsfw/cfdp/tlv/FilestoreTlvBase.h b/src/fsfw/cfdp/tlv/FilestoreTlvBase.h index 04012cda..c37cb0ad 100644 --- a/src/fsfw/cfdp/tlv/FilestoreTlvBase.h +++ b/src/fsfw/cfdp/tlv/FilestoreTlvBase.h @@ -73,7 +73,7 @@ class FilestoreTlvBase : public TlvIF { Endianness streamEndianness, bool isResponse = false, uint8_t responseStatusCode = 0) const { if (buffer == nullptr or size == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (maxSize < 3) { return SerializeIF::BUFFER_TOO_SHORT; @@ -90,13 +90,13 @@ class FilestoreTlvBase : public TlvIF { } *buffer += 1; *size += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t commonDeserialize(const uint8_t** buffer, size_t* size, SerializeIF::Endianness streamEndianness) { if (buffer == nullptr or size == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (*size < 3) { return SerializeIF::STREAM_TOO_SHORT; @@ -114,7 +114,7 @@ class FilestoreTlvBase : public TlvIF { if (remainingLength == 0) { return SerializeIF::STREAM_TOO_SHORT; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } bool requiresSecondFileName() const { @@ -152,7 +152,7 @@ class FilestoreTlvBase : public TlvIF { size_t serSize = 0; uint8_t* valueStart = buffer + 2; ReturnValue_t result = this->serialize(&buffer, &serSize, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } tlv.setValue(valueStart, serSize - 2); diff --git a/src/fsfw/cfdp/tlv/Lv.cpp b/src/fsfw/cfdp/tlv/Lv.cpp index 1bb16301..9c72b260 100644 --- a/src/fsfw/cfdp/tlv/Lv.cpp +++ b/src/fsfw/cfdp/tlv/Lv.cpp @@ -31,13 +31,13 @@ ReturnValue_t cfdp::Lv::serialize(uint8_t** buffer, size_t* size, size_t maxSize return BUFFER_TOO_SHORT; } if (buffer == nullptr or size == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (zeroLen) { **buffer = 0; *size += 1; *buffer += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } return value.serialize(buffer, size, maxSize, streamEndianness); } @@ -54,7 +54,7 @@ size_t cfdp::Lv::getSerializedSize() const { ReturnValue_t cfdp::Lv::deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { if (buffer == nullptr or size == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (*size < 1) { return SerializeIF::STREAM_TOO_SHORT; @@ -64,7 +64,7 @@ ReturnValue_t cfdp::Lv::deSerialize(const uint8_t** buffer, size_t* size, zeroLen = true; *buffer += 1; *size -= 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else if (*size < lengthField + 1) { return SerializeIF::STREAM_TOO_SHORT; } @@ -73,7 +73,7 @@ ReturnValue_t cfdp::Lv::deSerialize(const uint8_t** buffer, size_t* size, value.setBuffer(const_cast(*buffer + 1), lengthField); *buffer += 1 + lengthField; *size -= 1 + lengthField; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } const uint8_t* cfdp::Lv::getValue(size_t* size) const { diff --git a/src/fsfw/cfdp/tlv/Tlv.cpp b/src/fsfw/cfdp/tlv/Tlv.cpp index f37ff8d5..3a394741 100644 --- a/src/fsfw/cfdp/tlv/Tlv.cpp +++ b/src/fsfw/cfdp/tlv/Tlv.cpp @@ -12,7 +12,7 @@ cfdp::Tlv::Tlv() : value(static_cast(nullptr), 0, true) {} ReturnValue_t cfdp::Tlv::serialize(uint8_t **buffer, size_t *size, size_t maxSize, Endianness streamEndianness) const { if (buffer == nullptr or size == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (*size + 2 > maxSize) { return BUFFER_TOO_SHORT; @@ -28,10 +28,10 @@ ReturnValue_t cfdp::Tlv::serialize(uint8_t **buffer, size_t *size, size_t maxSiz **buffer = 0; *size += 1; *buffer += 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } if (value.getConstBuffer() == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return value.serialize(buffer, size, maxSize, streamEndianness); } @@ -48,7 +48,7 @@ size_t cfdp::Tlv::getSerializedSize() const { ReturnValue_t cfdp::Tlv::deSerialize(const uint8_t **buffer, size_t *size, Endianness streamEndianness) { if (buffer == nullptr or size == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (*size < 2) { return STREAM_TOO_SHORT; @@ -68,7 +68,7 @@ ReturnValue_t cfdp::Tlv::deSerialize(const uint8_t **buffer, size_t *size, zeroLen = true; *buffer += 1; *size -= 1; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } if (lengthField + 1 > *size) { return SerializeIF::STREAM_TOO_SHORT; @@ -78,7 +78,7 @@ ReturnValue_t cfdp::Tlv::deSerialize(const uint8_t **buffer, size_t *size, value.setBuffer(const_cast(*buffer + 1), lengthField); *buffer += 1 + lengthField; *size -= 1 + lengthField; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } const uint8_t *cfdp::Tlv::getValue() const { return value.getConstBuffer(); } diff --git a/src/fsfw/container/ArrayList.h b/src/fsfw/container/ArrayList.h index 11f40039..522ddf3b 100644 --- a/src/fsfw/container/ArrayList.h +++ b/src/fsfw/container/ArrayList.h @@ -191,7 +191,7 @@ class ArrayList { } entries[size] = entry; ++size; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } /** diff --git a/src/fsfw/container/FIFOBase.tpp b/src/fsfw/container/FIFOBase.tpp index 91804b6c..63727869 100644 --- a/src/fsfw/container/FIFOBase.tpp +++ b/src/fsfw/container/FIFOBase.tpp @@ -17,7 +17,7 @@ inline ReturnValue_t FIFOBase::insert(T value) { values[writeIndex] = value; writeIndex = next(writeIndex); ++currentSize; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } }; @@ -27,12 +27,12 @@ inline ReturnValue_t FIFOBase::retrieve(T* value) { return EMPTY; } else { if (value == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *value = values[readIndex]; readIndex = next(readIndex); --currentSize; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } }; @@ -42,10 +42,10 @@ inline ReturnValue_t FIFOBase::peek(T* value) { return EMPTY; } else { if (value == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *value = values[readIndex]; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } }; diff --git a/src/fsfw/container/FixedMap.h b/src/fsfw/container/FixedMap.h index 48822cd5..c6b2c9b5 100644 --- a/src/fsfw/container/FixedMap.h +++ b/src/fsfw/container/FixedMap.h @@ -75,7 +75,7 @@ class FixedMap : public SerializeIF { uint32_t size() const { return _size; } ReturnValue_t insert(key_t key, T value, Iterator* storedValue = nullptr) { - if (exists(key) == HasReturnvaluesIF::RETURN_OK) { + if (exists(key) == returnvalue::OK) { return KEY_ALREADY_EXISTS; } if (_size == theMap.maxSize()) { @@ -87,7 +87,7 @@ class FixedMap : public SerializeIF { *storedValue = Iterator(&theMap[_size]); } ++_size; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t insert(std::pair pair) { return insert(pair.first, pair.second); } @@ -95,7 +95,7 @@ class FixedMap : public SerializeIF { ReturnValue_t exists(key_t key) const { ReturnValue_t result = KEY_DOES_NOT_EXIST; if (findIndex(key) < _size) { - result = HasReturnvaluesIF::RETURN_OK; + result = returnvalue::OK; } return result; } @@ -108,7 +108,7 @@ class FixedMap : public SerializeIF { theMap[i] = theMap[_size - 1]; --_size; --((*iter).value); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t erase(key_t key) { @@ -118,14 +118,14 @@ class FixedMap : public SerializeIF { } theMap[i] = theMap[_size - 1]; --_size; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } T* findValue(key_t key) const { return &theMap[findIndex(key)].second; } Iterator find(key_t key) const { ReturnValue_t result = exists(key); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return end(); } return Iterator(&theMap[findIndex(key)]); @@ -133,11 +133,11 @@ class FixedMap : public SerializeIF { ReturnValue_t find(key_t key, T** value) const { ReturnValue_t result = exists(key); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } *value = &theMap[findIndex(key)].second; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } bool empty() { @@ -165,7 +165,7 @@ class FixedMap : public SerializeIF { ReturnValue_t result = SerializeAdapter::serialize(&this->_size, buffer, size, maxSize, streamEndianness); uint32_t i = 0; - while ((result == HasReturnvaluesIF::RETURN_OK) && (i < this->_size)) { + while ((result == returnvalue::OK) && (i < this->_size)) { result = SerializeAdapter::serialize(&theMap[i].first, buffer, size, maxSize, streamEndianness); result = @@ -195,7 +195,7 @@ class FixedMap : public SerializeIF { return SerializeIF::TOO_MANY_ELEMENTS; } uint32_t i = 0; - while ((result == HasReturnvaluesIF::RETURN_OK) && (i < this->_size)) { + while ((result == returnvalue::OK) && (i < this->_size)) { result = SerializeAdapter::deSerialize(&theMap[i].first, buffer, size, streamEndianness); result = SerializeAdapter::deSerialize(&theMap[i].second, buffer, size, streamEndianness); ++i; diff --git a/src/fsfw/container/FixedOrderedMultimap.h b/src/fsfw/container/FixedOrderedMultimap.h index 3ef8f8f1..f402d622 100644 --- a/src/fsfw/container/FixedOrderedMultimap.h +++ b/src/fsfw/container/FixedOrderedMultimap.h @@ -148,7 +148,7 @@ class FixedOrderedMultimap { */ Iterator find(key_t key) const { ReturnValue_t result = exists(key); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return end(); } return Iterator(&theMap[findFirstIndex(key)]); diff --git a/src/fsfw/container/FixedOrderedMultimap.tpp b/src/fsfw/container/FixedOrderedMultimap.tpp index fd58bc44..cfdb5331 100644 --- a/src/fsfw/container/FixedOrderedMultimap.tpp +++ b/src/fsfw/container/FixedOrderedMultimap.tpp @@ -16,7 +16,7 @@ inline ReturnValue_t FixedOrderedMultimap::insert(key_t k if (storedValue != nullptr) { *storedValue = Iterator(&theMap[position]); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } template inline ReturnValue_t FixedOrderedMultimap::insert(std::pair pair) { @@ -27,7 +27,7 @@ template inline ReturnValue_t FixedOrderedMultimap::exists(key_t key) const { ReturnValue_t result = KEY_DOES_NOT_EXIST; if (findFirstIndex(key) < _size) { - result = HasReturnvaluesIF::RETURN_OK; + result = returnvalue::OK; } return result; } @@ -44,7 +44,7 @@ inline ReturnValue_t FixedOrderedMultimap::erase(Iterator } else { *iter = begin(); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } template @@ -57,17 +57,17 @@ inline ReturnValue_t FixedOrderedMultimap::erase(key_t ke removeFromPosition(i); i = findFirstIndex(key, i); } while (i < _size); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } template inline ReturnValue_t FixedOrderedMultimap::find(key_t key, T **value) const { ReturnValue_t result = exists(key); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } *value = &theMap[findFirstIndex(key)].second; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } template diff --git a/src/fsfw/container/IndexedRingMemoryArray.h b/src/fsfw/container/IndexedRingMemoryArray.h index b76e7d56..4ad72592 100644 --- a/src/fsfw/container/IndexedRingMemoryArray.h +++ b/src/fsfw/container/IndexedRingMemoryArray.h @@ -52,15 +52,15 @@ class Index : public SerializeIF { Endianness streamEndianness) const { ReturnValue_t result = SerializeAdapter::serialize(&blockStartAddress, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = indexType.serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&this->size, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = @@ -71,19 +71,19 @@ class Index : public SerializeIF { ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { ReturnValue_t result = SerializeAdapter::deSerialize(&blockStartAddress, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = indexType.deSerialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&this->size, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&this->storedPackets, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return result; @@ -449,13 +449,13 @@ class IndexedRingMemoryArray : public SerializeIF, public ArrayList, ui // Check Next Block if (!isNextBlockWritable()) { // The Index is full and does not overwrite old - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } // Next block can be written, update Metadata currentWriteBlock = getNextWrite(); currentWriteBlock->setSize(0); currentWriteBlock->setStoredPackets(0); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } /** @@ -475,21 +475,21 @@ class IndexedRingMemoryArray : public SerializeIF, public ArrayList, ui additionalInfo->serialize(buffer, size, maxSize, streamEndianness); } ReturnValue_t result = currentWriteBlock->serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&this->size, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } uint32_t i = 0; - while ((result == HasReturnvaluesIF::RETURN_OK) && (i < this->size)) { + while ((result == returnvalue::OK) && (i < this->size)) { result = SerializeAdapter::serialize(&this->entries[i], buffer, size, maxSize, streamEndianness); ++i; } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } uint16_t crc = Calculate_CRC(crcBuffer, (*size - oldSize)); @@ -523,44 +523,44 @@ class IndexedRingMemoryArray : public SerializeIF, public ArrayList, ui */ ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; if (additionalInfo != NULL) { result = additionalInfo->deSerialize(buffer, size, streamEndianness); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } Index tempIndex; result = tempIndex.deSerialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } uint32_t tempSize = 0; result = SerializeAdapter::deSerialize(&tempSize, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (this->size != tempSize) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } uint32_t i = 0; - while ((result == HasReturnvaluesIF::RETURN_OK) && (i < this->size)) { + while ((result == returnvalue::OK) && (i < this->size)) { result = SerializeAdapter::deSerialize(&this->entries[i], buffer, size, streamEndianness); ++i; } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } typename IndexedRingMemoryArray::Iterator cmp(&tempIndex); for (typename IndexedRingMemoryArray::Iterator it = this->begin(); it != this->end(); ++it) { if (*(cmp.value) == *(it.value)) { currentWriteBlock = it; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } // Reached if current write block iterator is not found - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } uint32_t getIndexAddress() const { return indexAddress; } diff --git a/src/fsfw/container/PlacementFactory.h b/src/fsfw/container/PlacementFactory.h index 936be59d..e59fc134 100644 --- a/src/fsfw/container/PlacementFactory.h +++ b/src/fsfw/container/PlacementFactory.h @@ -40,7 +40,7 @@ class PlacementFactory { store_address_t tempId; uint8_t* pData = nullptr; ReturnValue_t result = dataBackend->getFreeElement(&tempId, sizeof(T), &pData); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return nullptr; } T* temp = new (pData) T(std::forward(args)...); @@ -56,7 +56,7 @@ class PlacementFactory { template ReturnValue_t destroy(T* thisElement) { if (thisElement == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } // Need to call destructor first, in case something was allocated by the object (shouldn't do // that, however). diff --git a/src/fsfw/container/RingBufferBase.h b/src/fsfw/container/RingBufferBase.h index 98207698..77a0583b 100644 --- a/src/fsfw/container/RingBufferBase.h +++ b/src/fsfw/container/RingBufferBase.h @@ -58,18 +58,18 @@ class RingBufferBase { ReturnValue_t readData(uint32_t amount, uint8_t n = 0) { if (getAvailableReadData(n) >= amount) { incrementRead(amount, n); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } ReturnValue_t writeData(uint32_t amount) { if (availableWriteSpace() >= amount or overwriteOld) { incrementWrite(amount); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/container/SimpleRingBuffer.cpp b/src/fsfw/container/SimpleRingBuffer.cpp index c104ea97..a006df46 100644 --- a/src/fsfw/container/SimpleRingBuffer.cpp +++ b/src/fsfw/container/SimpleRingBuffer.cpp @@ -32,14 +32,14 @@ ReturnValue_t SimpleRingBuffer::getFreeElement(uint8_t** writePointer, size_t am size_t amountTillWrap = writeTillWrap(); if (amountTillWrap < amount) { if ((amount - amountTillWrap + excessBytes) > maxExcessBytes) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } excessBytes = amount - amountTillWrap; } *writePointer = &buffer[write]; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -52,7 +52,7 @@ void SimpleRingBuffer::confirmBytesWritten(size_t amount) { ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) { if (data == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (amount > getMaxSize()) { #if FSFW_VERBOSE_LEVEL >= 1 @@ -62,7 +62,7 @@ ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) { sif::printError("SimpleRingBuffer::writeData: Amount of data too large\n"); #endif #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (availableWriteSpace() >= amount or overwriteOld) { size_t amountTillWrap = writeTillWrap(); @@ -74,9 +74,9 @@ ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) { memcpy(buffer, data + amountTillWrap, amount - amountTillWrap); } incrementWrite(amount); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -89,7 +89,7 @@ ReturnValue_t SimpleRingBuffer::readData(uint8_t* data, size_t amount, bool incr // more data available than amount specified. amount = availableData; } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } if (trueAmount != nullptr) { @@ -105,7 +105,7 @@ ReturnValue_t SimpleRingBuffer::readData(uint8_t* data, size_t amount, bool incr if (incrementReadPtr) { deleteData(amount, readRemaining); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t SimpleRingBuffer::getExcessBytes() const { return excessBytes; } @@ -124,12 +124,12 @@ ReturnValue_t SimpleRingBuffer::deleteData(size_t amount, bool deleteRemaining, if (deleteRemaining) { amount = availableData; } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } if (trueAmount != nullptr) { *trueAmount = amount; } incrementRead(amount, READ_PTR); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/container/SimpleRingBuffer.h b/src/fsfw/container/SimpleRingBuffer.h index b9762451..7495e31c 100644 --- a/src/fsfw/container/SimpleRingBuffer.h +++ b/src/fsfw/container/SimpleRingBuffer.h @@ -48,7 +48,7 @@ class SimpleRingBuffer : public RingBufferBase<> { * @param data * @param amount * @return -@c RETURN_OK if write operation was successful - * -@c RETURN_FAILED if + * -@c returnvalue::FAILED if */ ReturnValue_t writeData(const uint8_t* data, size_t amount); @@ -96,7 +96,7 @@ class SimpleRingBuffer : public RingBufferBase<> { * to the passed value. * @return * - @c RETURN_OK if data was read successfully - * - @c RETURN_FAILED if not enough data was available and readRemaining + * - @c returnvalue::FAILED if not enough data was available and readRemaining * was set to false. */ ReturnValue_t readData(uint8_t* data, size_t amount, bool incrementReadPtr = false, diff --git a/src/fsfw/controller/ControllerBase.cpp b/src/fsfw/controller/ControllerBase.cpp index 7a8b6bc4..a9d19ef2 100644 --- a/src/fsfw/controller/ControllerBase.cpp +++ b/src/fsfw/controller/ControllerBase.cpp @@ -20,7 +20,7 @@ ControllerBase::~ControllerBase() { QueueFactory::instance()->deleteMessageQueue ReturnValue_t ControllerBase::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -28,7 +28,7 @@ ReturnValue_t ControllerBase::initialize() { if (parentId != objects::NO_OBJECT) { auto* parent = ObjectManager::instance()->get(parentId); if (parent == nullptr) { - return RETURN_FAILED; + return returnvalue::FAILED; } parentQueue = parent->getCommandQueue(); @@ -36,16 +36,16 @@ ReturnValue_t ControllerBase::initialize() { } result = healthHelper.initialize(parentQueue); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = modeHelper.initialize(parentQueue); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return RETURN_OK; + return returnvalue::OK; } MessageQueueId_t ControllerBase::getCommandQueue() const { return commandQueue->getId(); } @@ -53,19 +53,19 @@ MessageQueueId_t ControllerBase::getCommandQueue() const { return commandQueue-> void ControllerBase::handleQueue() { CommandMessage command; ReturnValue_t result; - for (result = commandQueue->receiveMessage(&command); result == RETURN_OK; + for (result = commandQueue->receiveMessage(&command); result == returnvalue::OK; result = commandQueue->receiveMessage(&command)) { result = modeHelper.handleModeCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = healthHelper.handleHealthCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = handleCommandMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } command.setToUnknownCommand(); @@ -96,7 +96,7 @@ void ControllerBase::announceMode(bool recursive) { triggerEvent(MODE_INFO, mode ReturnValue_t ControllerBase::performOperation(uint8_t opCode) { handleQueue(); performControlOperation(); - return RETURN_OK; + return returnvalue::OK; } void ControllerBase::modeChanged(Mode_t mode_, Submode_t submode_) {} @@ -106,7 +106,7 @@ ReturnValue_t ControllerBase::setHealth(HealthState health) { case HEALTHY: case EXTERNAL_CONTROL: healthHelper.setHealth(health); - return RETURN_OK; + return returnvalue::OK; default: return INVALID_HEALTH_STATE; } @@ -117,4 +117,4 @@ void ControllerBase::setTaskIF(PeriodicTaskIF* task_) { executingTask = task_; } void ControllerBase::changeHK(Mode_t mode_, Submode_t submode_, bool enable) {} -ReturnValue_t ControllerBase::initializeAfterTaskCreation() { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t ControllerBase::initializeAfterTaskCreation() { return returnvalue::OK; } diff --git a/src/fsfw/controller/ControllerBase.h b/src/fsfw/controller/ControllerBase.h index 550659b8..56c28585 100644 --- a/src/fsfw/controller/ControllerBase.h +++ b/src/fsfw/controller/ControllerBase.h @@ -18,8 +18,7 @@ class ControllerBase : public HasModesIF, public HasHealthIF, public ExecutableObjectIF, - public SystemObject, - public HasReturnvaluesIF { + public SystemObject { public: static const Mode_t MODE_NORMAL = 2; diff --git a/src/fsfw/controller/ExtendedControllerBase.cpp b/src/fsfw/controller/ExtendedControllerBase.cpp index 64b39a31..4d5c90c8 100644 --- a/src/fsfw/controller/ExtendedControllerBase.cpp +++ b/src/fsfw/controller/ExtendedControllerBase.cpp @@ -12,7 +12,7 @@ ReturnValue_t ExtendedControllerBase::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t *data, size_t size) { /* Needs to be overriden and implemented by child class. */ - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } object_id_t ExtendedControllerBase::getObjectId() const { return SystemObject::getObjectId(); } @@ -23,7 +23,7 @@ uint32_t ExtendedControllerBase::getPeriodicOperationFrequency() const { ReturnValue_t ExtendedControllerBase::handleCommandMessage(CommandMessage *message) { ReturnValue_t result = actionHelper.handleActionMessage(message); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return result; } return poolManager.handleHousekeepingMessage(message); @@ -32,30 +32,30 @@ ReturnValue_t ExtendedControllerBase::handleCommandMessage(CommandMessage *messa void ExtendedControllerBase::handleQueue() { CommandMessage command; ReturnValue_t result; - for (result = commandQueue->receiveMessage(&command); result == RETURN_OK; + for (result = commandQueue->receiveMessage(&command); result == returnvalue::OK; result = commandQueue->receiveMessage(&command)) { result = actionHelper.handleActionMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = modeHelper.handleModeCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = healthHelper.handleHealthCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = poolManager.handleHousekeepingMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = handleCommandMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } command.setToUnknownCommand(); @@ -65,11 +65,11 @@ void ExtendedControllerBase::handleQueue() { ReturnValue_t ExtendedControllerBase::initialize() { ReturnValue_t result = ControllerBase::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = actionHelper.initialize(commandQueue); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -86,7 +86,7 @@ ReturnValue_t ExtendedControllerBase::performOperation(uint8_t opCode) { /* We do this after performing control operation because variables will be set changed in this function. */ poolManager.performHkOperation(); - return RETURN_OK; + return returnvalue::OK; } MessageQueueId_t ExtendedControllerBase::getCommandQueue() const { return commandQueue->getId(); } diff --git a/src/fsfw/coordinates/Sgp4Propagator.cpp b/src/fsfw/coordinates/Sgp4Propagator.cpp index 4a43842c..e79ffef5 100644 --- a/src/fsfw/coordinates/Sgp4Propagator.cpp +++ b/src/fsfw/coordinates/Sgp4Propagator.cpp @@ -152,7 +152,7 @@ ReturnValue_t Sgp4Propagator::initialize(const uint8_t* line1, const uint8_t* li return MAKE_RETURN_CODE(result); } else { initialized = true; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } @@ -195,6 +195,6 @@ ReturnValue_t Sgp4Propagator::propagate(double* position, double* velocity, time if (result != 0) { return MAKE_RETURN_CODE(result || 0xB0); } else { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } diff --git a/src/fsfw/datalinklayer/DataLinkLayer.cpp b/src/fsfw/datalinklayer/DataLinkLayer.cpp index ca607478..6fe3e664 100644 --- a/src/fsfw/datalinklayer/DataLinkLayer.cpp +++ b/src/fsfw/datalinklayer/DataLinkLayer.cpp @@ -28,7 +28,7 @@ ReturnValue_t DataLinkLayer::frameDelimitingAndFillRemoval() { TcTransferFrame frame_candidate(frameBuffer); this->currentFrame = frame_candidate; // should work with shallow copy. - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t DataLinkLayer::frameValidationCheck() { @@ -59,14 +59,14 @@ ReturnValue_t DataLinkLayer::frameValidationCheck() { if (USE_CRC) { return this->frameCheckCRC(); } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t DataLinkLayer::frameCheckCRC() { uint16_t checkValue = CRC::crc16ccitt(this->currentFrame.getFullFrame(), this->currentFrame.getFullSize()); if (checkValue == 0) { - return RETURN_OK; + return returnvalue::OK; } else { return CRC_FAILED; } @@ -74,7 +74,7 @@ ReturnValue_t DataLinkLayer::frameCheckCRC() { ReturnValue_t DataLinkLayer::allFramesReception() { ReturnValue_t status = this->frameDelimitingAndFillRemoval(); - if (status != RETURN_OK) { + if (status != returnvalue::OK) { return status; } return this->frameValidationCheck(); @@ -90,7 +90,7 @@ ReturnValue_t DataLinkLayer::virtualChannelDemultiplexing() { virtualChannelIterator iter = virtualChannels.find(vcId); if (iter == virtualChannels.end()) { // Do not report because passive board will get this error all the time. - return RETURN_OK; + return returnvalue::OK; } else { return (iter->second)->frameAcceptanceAndReportingMechanism(¤tFrame, clcw); } @@ -99,7 +99,7 @@ ReturnValue_t DataLinkLayer::virtualChannelDemultiplexing() { ReturnValue_t DataLinkLayer::processFrame(uint16_t length) { receivedDataLength = length; ReturnValue_t status = allFramesReception(); - if (status != RETURN_OK) { + if (status != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "DataLinkLayer::processFrame: frame reception failed. " "Error code: " @@ -117,14 +117,14 @@ ReturnValue_t DataLinkLayer::addVirtualChannel(uint8_t virtualChannelId, std::pair returnValue = virtualChannels.insert( std::pair(virtualChannelId, object)); if (returnValue.second == true) { - return RETURN_OK; + return returnvalue::OK; } else { - return RETURN_FAILED; + return returnvalue::FAILED; } } ReturnValue_t DataLinkLayer::initialize() { - ReturnValue_t returnValue = RETURN_FAILED; + ReturnValue_t returnValue = returnvalue::FAILED; // Set Virtual Channel ID to first virtual channel instance in this DataLinkLayer instance to // avoid faulty information (e.g. 0) in the VCID. if (virtualChannels.begin() != virtualChannels.end()) { @@ -133,13 +133,13 @@ ReturnValue_t DataLinkLayer::initialize() { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "DataLinkLayer::initialize: No VC assigned to this DLL instance! " << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } for (virtualChannelIterator iterator = virtualChannels.begin(); iterator != virtualChannels.end(); iterator++) { returnValue = iterator->second->initialize(); - if (returnValue != RETURN_OK) break; + if (returnValue != returnvalue::OK) break; } return returnValue; } diff --git a/src/fsfw/datalinklayer/DataLinkLayer.h b/src/fsfw/datalinklayer/DataLinkLayer.h index 8735feb6..64d33016 100644 --- a/src/fsfw/datalinklayer/DataLinkLayer.h +++ b/src/fsfw/datalinklayer/DataLinkLayer.h @@ -61,7 +61,7 @@ class DataLinkLayer : public CCSDSReturnValuesIF { * handle Frames directed to this VC. * @param virtualChannelId Id of the VC. Shall be smaller than 64. * @param object Reference to the object that handles the Frame. - * @return @c RETURN_OK on success, @c RETURN_FAILED otherwise. + * @return @c RETURN_OK on success, @c returnvalue::FAILED otherwise. */ ReturnValue_t addVirtualChannel(uint8_t virtualChannelId, VirtualChannelReceptionIF* object); /** diff --git a/src/fsfw/datalinklayer/Farm1StateOpen.cpp b/src/fsfw/datalinklayer/Farm1StateOpen.cpp index cf3339a7..b27f609c 100644 --- a/src/fsfw/datalinklayer/Farm1StateOpen.cpp +++ b/src/fsfw/datalinklayer/Farm1StateOpen.cpp @@ -11,7 +11,7 @@ ReturnValue_t Farm1StateOpen::handleADFrame(TcTransferFrame* frame, ClcwIF* clcw if (diff == 0) { myVC->vR++; clcw->setRetransmitFlag(false); - return RETURN_OK; + return returnvalue::OK; } else if (diff < myVC->positiveWindow && diff > 0) { clcw->setRetransmitFlag(true); return NS_POSITIVE_W; diff --git a/src/fsfw/datalinklayer/MapPacketExtraction.cpp b/src/fsfw/datalinklayer/MapPacketExtraction.cpp index 57aa2f08..a2ee51e8 100644 --- a/src/fsfw/datalinklayer/MapPacketExtraction.cpp +++ b/src/fsfw/datalinklayer/MapPacketExtraction.cpp @@ -31,7 +31,7 @@ ReturnValue_t MapPacketExtraction::extractPackets(TcTransferFrame* frame) { if (packetLength <= MAX_PACKET_SIZE) { memcpy(packetBuffer, frame->getDataField(), packetLength); bufferPosition = &packetBuffer[packetLength]; - status = RETURN_OK; + status = returnvalue::OK; } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "MapPacketExtraction::extractPackets. Packet too large! Size: " @@ -52,7 +52,7 @@ ReturnValue_t MapPacketExtraction::extractPackets(TcTransferFrame* frame) { status = sendCompletePacket(packetBuffer, packetLength); clearBuffers(); } - status = RETURN_OK; + status = returnvalue::OK; } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "MapPacketExtraction::extractPackets. Packet too large! Size: " @@ -95,7 +95,7 @@ ReturnValue_t MapPacketExtraction::unpackBlockingPackets(TcTransferFrame* frame) status = sendCompletePacket(packet.getWholeData(), packet.getFullSize()); totalLength -= packet.getFullSize(); position += packet.getFullSize(); - status = RETURN_OK; + status = returnvalue::OK; } else { status = DATA_CORRUPTED; totalLength = 0; @@ -110,7 +110,7 @@ ReturnValue_t MapPacketExtraction::unpackBlockingPackets(TcTransferFrame* frame) ReturnValue_t MapPacketExtraction::sendCompletePacket(uint8_t* data, uint32_t size) { store_address_t store_id; ReturnValue_t status = this->packetStore->addData(&store_id, data, size); - if (status == RETURN_OK) { + if (status == returnvalue::OK) { TmTcMessage message(store_id); status = MessageQueueSenderIF::sendMessage(tcQueueId, &message); } @@ -130,9 +130,9 @@ ReturnValue_t MapPacketExtraction::initialize() { ObjectManager::instance()->get(packetDestination); if ((packetStore != NULL) && (distributor != NULL)) { tcQueueId = distributor->getRequestQueue(); - return RETURN_OK; + return returnvalue::OK; } else { - return RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/datalinklayer/MapPacketExtraction.h b/src/fsfw/datalinklayer/MapPacketExtraction.h index c2673b2e..54faaf04 100644 --- a/src/fsfw/datalinklayer/MapPacketExtraction.h +++ b/src/fsfw/datalinklayer/MapPacketExtraction.h @@ -63,7 +63,7 @@ class MapPacketExtraction : public MapPacketExtractionIF { ReturnValue_t extractPackets(TcTransferFrame* frame); /** * The #packetStore and the default destination of #tcQueue are initialized here. - * @return @c RETURN_OK on success, @c RETURN_FAILED otherwise. + * @return @c RETURN_OK on success, @c returnvalue::FAILED otherwise. */ ReturnValue_t initialize(); /** diff --git a/src/fsfw/datalinklayer/VirtualChannelReception.cpp b/src/fsfw/datalinklayer/VirtualChannelReception.cpp index 258bc1e6..4c44cf01 100644 --- a/src/fsfw/datalinklayer/VirtualChannelReception.cpp +++ b/src/fsfw/datalinklayer/VirtualChannelReception.cpp @@ -57,18 +57,18 @@ ReturnValue_t VirtualChannelReception::doFARM(TcTransferFrame* frame, ClcwIF* cl ReturnValue_t VirtualChannelReception::frameAcceptanceAndReportingMechanism(TcTransferFrame* frame, ClcwIF* clcw) { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; result = doFARM(frame, &internalClcw); internalClcw.setReceiverFrameSequenceNumber(vR); internalClcw.setFarmBCount(farmBCounter); clcw->setWhole(internalClcw.getAsWhole()); switch (result) { - case RETURN_OK: + case returnvalue::OK: return mapDemultiplexing(frame); case BC_IS_SET_VR_COMMAND: case BC_IS_UNLOCK_COMMAND: // Need to catch these codes to avoid error reporting later. - return RETURN_OK; + return returnvalue::OK; default: break; } @@ -79,15 +79,15 @@ ReturnValue_t VirtualChannelReception::addMapChannel(uint8_t mapId, MapPacketExt std::pair returnValue = mapChannels.insert(std::pair(mapId, object)); if (returnValue.second == true) { - return RETURN_OK; + return returnvalue::OK; } else { - return RETURN_FAILED; + return returnvalue::FAILED; } } ReturnValue_t VirtualChannelReception::handleBDFrame(TcTransferFrame* frame, ClcwIF* clcw) { farmBCounter++; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t VirtualChannelReception::handleBCFrame(TcTransferFrame* frame, ClcwIF* clcw) { @@ -107,18 +107,18 @@ ReturnValue_t VirtualChannelReception::handleBCFrame(TcTransferFrame* frame, Clc uint8_t VirtualChannelReception::getChannelId() const { return channelId; } ReturnValue_t VirtualChannelReception::initialize() { - ReturnValue_t returnValue = RETURN_FAILED; + ReturnValue_t returnValue = returnvalue::FAILED; if ((slidingWindowWidth > 254) || (slidingWindowWidth % 2 != 0)) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "VirtualChannelReception::initialize: Illegal sliding window width: " << (int)slidingWindowWidth << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } for (mapChannelIterator iterator = mapChannels.begin(); iterator != mapChannels.end(); iterator++) { returnValue = iterator->second->initialize(); - if (returnValue != RETURN_OK) break; + if (returnValue != returnvalue::OK) break; } return returnValue; } diff --git a/src/fsfw/datalinklayer/VirtualChannelReception.h b/src/fsfw/datalinklayer/VirtualChannelReception.h index 6dc17dd8..d425123a 100644 --- a/src/fsfw/datalinklayer/VirtualChannelReception.h +++ b/src/fsfw/datalinklayer/VirtualChannelReception.h @@ -102,13 +102,13 @@ class VirtualChannelReception : public VirtualChannelReceptionIF, public CCSDSRe * Helper method to simplify adding a mapChannel during construction. * @param mapId The mapId of the object to add. * @param object Pointer to the MapPacketExtraction object itself. - * @return @c RETURN_OK if the channel was successfully inserted, @c RETURN_FAILED otherwise. + * @return @c RETURN_OK if the channel was successfully inserted, @c returnvalue::FAILED otherwise. */ ReturnValue_t addMapChannel(uint8_t mapId, MapPacketExtractionIF* object); /** * The initialization routine checks the set #slidingWindowWidth and initializes all MAP * channels. - * @return @c RETURN_OK on successful initialization, @c RETURN_FAILED otherwise. + * @return @c RETURN_OK on successful initialization, @c returnvalue::FAILED otherwise. */ ReturnValue_t initialize(); /** diff --git a/src/fsfw/datapool/PoolDataSetBase.cpp b/src/fsfw/datapool/PoolDataSetBase.cpp index b31f4725..0df21d2a 100644 --- a/src/fsfw/datapool/PoolDataSetBase.cpp +++ b/src/fsfw/datapool/PoolDataSetBase.cpp @@ -14,7 +14,7 @@ PoolDataSetBase::~PoolDataSetBase() {} ReturnValue_t PoolDataSetBase::registerVariable(PoolVariableIF* variable) { if (registeredVariables == nullptr) { /* Underlying container invalid */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (state != States::STATE_SET_UNINITIALISED) { #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -42,17 +42,17 @@ ReturnValue_t PoolDataSetBase::registerVariable(PoolVariableIF* variable) { } registeredVariables[fillCount] = variable; fillCount++; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t PoolDataSetBase::read(MutexIF::TimeoutType timeoutType, uint32_t lockTimeout) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; ReturnValue_t error = result; if (state == States::STATE_SET_UNINITIALISED) { lockDataPool(timeoutType, lockTimeout); for (uint16_t count = 0; count < fillCount; count++) { result = readVariable(count); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { error = result; } } @@ -71,7 +71,7 @@ ReturnValue_t PoolDataSetBase::read(MutexIF::TimeoutType timeoutType, uint32_t l result = SET_WAS_ALREADY_READ; } - if (error != HasReturnvaluesIF::RETURN_OK) { + if (error != returnvalue::OK) { result = error; } return result; @@ -80,10 +80,10 @@ ReturnValue_t PoolDataSetBase::read(MutexIF::TimeoutType timeoutType, uint32_t l uint16_t PoolDataSetBase::getFillCount() const { return fillCount; } ReturnValue_t PoolDataSetBase::readVariable(uint16_t count) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; if (registeredVariables[count] == nullptr) { /* Configuration error. */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } /* These checks are often performed by the respective variable implementation too, but I guess @@ -98,7 +98,7 @@ ReturnValue_t PoolDataSetBase::readVariable(uint16_t count) { result = ReadCommitIFAttorney::readWithoutLock(registeredVariables[count]); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { result = INVALID_PARAMETER_DEFINITION; } } @@ -108,7 +108,7 @@ ReturnValue_t PoolDataSetBase::readVariable(uint16_t count) { ReturnValue_t PoolDataSetBase::commit(MutexIF::TimeoutType timeoutType, uint32_t lockTimeout) { if (state == States::STATE_SET_WAS_READ) { handleAlreadyReadDatasetCommit(timeoutType, lockTimeout); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return handleUnreadDatasetCommit(timeoutType, lockTimeout); } @@ -134,7 +134,7 @@ void PoolDataSetBase::handleAlreadyReadDatasetCommit(MutexIF::TimeoutType timeou ReturnValue_t PoolDataSetBase::handleUnreadDatasetCommit(MutexIF::TimeoutType timeoutType, uint32_t lockTimeout) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; lockDataPool(timeoutType, lockTimeout); for (uint16_t count = 0; count < fillCount; count++) { if ((registeredVariables[count]->getReadWriteMode() == PoolVariableIF::VAR_WRITE) and @@ -165,17 +165,17 @@ ReturnValue_t PoolDataSetBase::handleUnreadDatasetCommit(MutexIF::TimeoutType ti ReturnValue_t PoolDataSetBase::lockDataPool(MutexIF::TimeoutType timeoutType, uint32_t lockTimeout) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } -ReturnValue_t PoolDataSetBase::unlockDataPool() { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t PoolDataSetBase::unlockDataPool() { return returnvalue::OK; } ReturnValue_t PoolDataSetBase::serialize(uint8_t** buffer, size_t* size, const size_t maxSize, SerializeIF::Endianness streamEndianness) const { - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; for (uint16_t count = 0; count < fillCount; count++) { result = registeredVariables[count]->serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -184,10 +184,10 @@ ReturnValue_t PoolDataSetBase::serialize(uint8_t** buffer, size_t* size, const s ReturnValue_t PoolDataSetBase::deSerialize(const uint8_t** buffer, size_t* size, SerializeIF::Endianness streamEndianness) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; for (uint16_t count = 0; count < fillCount; count++) { result = registeredVariables[count]->deSerialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } diff --git a/src/fsfw/datapool/PoolDataSetBase.h b/src/fsfw/datapool/PoolDataSetBase.h index dc6ec135..79a1095b 100644 --- a/src/fsfw/datapool/PoolDataSetBase.h +++ b/src/fsfw/datapool/PoolDataSetBase.h @@ -29,20 +29,20 @@ * @author Bastian Baetz * @ingroup data_pool */ -class PoolDataSetBase : public PoolDataSetIF, public SerializeIF, public HasReturnvaluesIF { +class PoolDataSetBase : public PoolDataSetIF, public SerializeIF { public: /** * @brief Creates an empty dataset. Use registerVariable or * supply a pointer to this dataset to PoolVariable * initializations to register pool variables. */ - PoolDataSetBase(PoolVariableIF** registeredVariablesArray, const size_t maxFillCount); + PoolDataSetBase(PoolVariableIF** registeredVariablesArray, size_t maxFillCount); /* Forbidden for now */ PoolDataSetBase(const PoolDataSetBase& otherSet) = delete; const PoolDataSetBase& operator=(const PoolDataSetBase& otherSet) = delete; - virtual ~PoolDataSetBase(); + ~PoolDataSetBase() override; /** * @brief The read call initializes reading out all registered variables. diff --git a/src/fsfw/datapool/PoolReadGuard.h b/src/fsfw/datapool/PoolReadGuard.h index 24d98933..f9bf35fe 100644 --- a/src/fsfw/datapool/PoolReadGuard.h +++ b/src/fsfw/datapool/PoolReadGuard.h @@ -17,7 +17,7 @@ class PoolReadGuard { : readObject(readObject), mutexTimeout(mutexTimeout) { if (readObject != nullptr) { readResult = readObject->read(timeoutType, mutexTimeout); - if (readResult != HasReturnvaluesIF::RETURN_OK) { + if (readResult != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "PoolReadHelper: Read failed!" << std::endl; @@ -47,7 +47,7 @@ class PoolReadGuard { private: ReadCommitIF* readObject = nullptr; - ReturnValue_t readResult = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t readResult = returnvalue::OK; bool noCommit = false; MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; uint32_t mutexTimeout = 20; diff --git a/src/fsfw/datapool/ReadCommitIFAttorney.h b/src/fsfw/datapool/ReadCommitIFAttorney.h index ea39ffe5..361ac6e4 100644 --- a/src/fsfw/datapool/ReadCommitIFAttorney.h +++ b/src/fsfw/datapool/ReadCommitIFAttorney.h @@ -12,14 +12,14 @@ class ReadCommitIFAttorney { private: static ReturnValue_t readWithoutLock(ReadCommitIF* readCommitIF) { if (readCommitIF == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return readCommitIF->readWithoutLock(); } static ReturnValue_t commitWithoutLock(ReadCommitIF* readCommitIF) { if (readCommitIF == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return readCommitIF->commitWithoutLock(); } diff --git a/src/fsfw/datapoollocal/HasLocalDataPoolIF.h b/src/fsfw/datapoollocal/HasLocalDataPoolIF.h index a2925a46..2cf20e0b 100644 --- a/src/fsfw/datapoollocal/HasLocalDataPoolIF.h +++ b/src/fsfw/datapoollocal/HasLocalDataPoolIF.h @@ -111,10 +111,10 @@ class HasLocalDataPoolIF { * These function can be implemented by pool owner, if they are required * and used by the housekeeping message interface. * */ - virtual ReturnValue_t addDataSet(sid_t sid) { return HasReturnvaluesIF::RETURN_FAILED; }; - virtual ReturnValue_t removeDataSet(sid_t sid) { return HasReturnvaluesIF::RETURN_FAILED; }; + virtual ReturnValue_t addDataSet(sid_t sid) { return returnvalue::FAILED; }; + virtual ReturnValue_t removeDataSet(sid_t sid) { return returnvalue::FAILED; }; virtual ReturnValue_t changeCollectionInterval(sid_t sid, float newIntervalSeconds) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; }; /** diff --git a/src/fsfw/datapoollocal/LocalDataPoolManager.cpp b/src/fsfw/datapoollocal/LocalDataPoolManager.cpp index 9b7f800f..497e4ef3 100644 --- a/src/fsfw/datapoollocal/LocalDataPoolManager.cpp +++ b/src/fsfw/datapoollocal/LocalDataPoolManager.cpp @@ -22,14 +22,14 @@ LocalDataPoolManager::LocalDataPoolManager(HasLocalDataPoolIF* owner, MessageQue : appendValidityBuffer(appendValidityBuffer) { if (owner == nullptr) { printWarningOrError(sif::OutputTypes::OUT_WARNING, "LocalDataPoolManager", - HasReturnvaluesIF::RETURN_FAILED, "Invalid supplied owner"); + returnvalue::FAILED, "Invalid supplied owner"); return; } this->owner = owner; mutex = MutexFactory::instance()->createMutex(); if (mutex == nullptr) { printWarningOrError(sif::OutputTypes::OUT_ERROR, "LocalDataPoolManager", - HasReturnvaluesIF::RETURN_FAILED, "Could not create mutex"); + returnvalue::FAILED, "Could not create mutex"); } hkQueue = queueToUse; @@ -51,9 +51,9 @@ ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) { ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); if (ipcStore == nullptr) { /* Error, all destinations invalid */ - printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", HasReturnvaluesIF::RETURN_FAILED, + printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", returnvalue::FAILED, "Could not set IPC store."); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (defaultHkDestination != objects::NO_OBJECT) { @@ -67,7 +67,7 @@ ReturnValue_t LocalDataPoolManager::initialize(MessageQueueIF* queueToUse) { } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::initializeAfterTaskCreation(uint8_t nonDiagInvlFactor) { @@ -78,19 +78,19 @@ ReturnValue_t LocalDataPoolManager::initializeAfterTaskCreation(uint8_t nonDiagI ReturnValue_t LocalDataPoolManager::initializeHousekeepingPoolEntriesOnce() { if (not mapInitialized) { ReturnValue_t result = owner->initializeLocalDataPool(localPoolMap, *this); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { mapInitialized = true; } return result; } printWarningOrError(sif::OutputTypes::OUT_WARNING, "initializeHousekeepingPoolEntriesOnce", - HasReturnvaluesIF::RETURN_FAILED, "The map should only be initialized once"); - return HasReturnvaluesIF::RETURN_OK; + returnvalue::FAILED, "The map should only be initialized once"); + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::performHkOperation() { - ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t status = returnvalue::OK; for (auto& receiver : hkReceivers) { switch (receiver.reportingType) { case (ReportingType::PERIODIC): { @@ -115,7 +115,7 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() { } default: // This should never happen. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } resetHkUpdateResetHelper(); @@ -125,7 +125,7 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() { ReturnValue_t LocalDataPoolManager::handleHkUpdate(HkReceiver& receiver, ReturnValue_t& status) { if (receiver.dataType == DataType::LOCAL_POOL_VARIABLE) { /* Update packets shall only be generated from datasets. */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner, receiver.dataId.sid); @@ -135,12 +135,12 @@ ReturnValue_t LocalDataPoolManager::handleHkUpdate(HkReceiver& receiver, ReturnV if (dataSet->hasChanged()) { /* Prepare and send update notification */ ReturnValue_t result = generateHousekeepingPacket(receiver.dataId.sid, dataSet, true); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } } handleChangeResetLogic(receiver.dataType, receiver.dataId, dataSet); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::handleNotificationUpdate(HkReceiver& receiver, @@ -160,7 +160,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationUpdate(HkReceiver& receive HousekeepingMessage::setUpdateNotificationVariableCommand( ¬ification, gp_id_t(owner->getObjectId(), receiver.dataId.localPoolId)); ReturnValue_t result = hkQueue->sendMessage(receiver.destinationQueue, ¬ification); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } toReset = poolObj; @@ -179,7 +179,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationUpdate(HkReceiver& receive CommandMessage notification; HousekeepingMessage::setUpdateNotificationSetCommand(¬ification, receiver.dataId.sid); ReturnValue_t result = hkQueue->sendMessage(receiver.destinationQueue, ¬ification); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } toReset = dataSet; @@ -188,7 +188,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationUpdate(HkReceiver& receive if (toReset != nullptr) { handleChangeResetLogic(receiver.dataType, receiver.dataId, toReset); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(HkReceiver& receiver, @@ -205,7 +205,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(HkReceiver& recei } if (not poolObj->hasChanged()) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } /* Prepare and send update snapshot */ @@ -219,7 +219,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(HkReceiver& recei store_address_t storeId; ReturnValue_t result = addUpdateToStore(updatePacket, storeId); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -227,7 +227,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(HkReceiver& recei HousekeepingMessage::setUpdateSnapshotVariableCommand( ¬ification, gp_id_t(owner->getObjectId(), receiver.dataId.localPoolId), storeId); result = hkQueue->sendMessage(receiver.destinationQueue, ¬ification); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } toReset = poolObj; @@ -241,7 +241,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(HkReceiver& recei } if (not dataSet->hasChanged()) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } /* Prepare and send update snapshot */ @@ -255,14 +255,14 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(HkReceiver& recei store_address_t storeId; ReturnValue_t result = addUpdateToStore(updatePacket, storeId); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } CommandMessage notification; HousekeepingMessage::setUpdateSnapshotSetCommand(¬ification, receiver.dataId.sid, storeId); result = hkQueue->sendMessage(receiver.destinationQueue, ¬ification); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } toReset = dataSet; @@ -270,7 +270,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(HkReceiver& recei if (toReset != nullptr) { handleChangeResetLogic(receiver.dataType, receiver.dataId, toReset); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::addUpdateToStore(HousekeepingSnapshot& updatePacket, @@ -279,7 +279,7 @@ ReturnValue_t LocalDataPoolManager::addUpdateToStore(HousekeepingSnapshot& updat uint8_t* storePtr = nullptr; ReturnValue_t result = ipcStore->getFreeElement(&storeId, updatePacket.getSerializedSize(), &storePtr); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t serializedSize = 0; @@ -362,7 +362,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForPeriodicPacket(sid_t sid, bool e } hkReceivers.push_back(hkReceiver); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::subscribeForUpdatePacket(sid_t sid, bool isDiagnostics, @@ -391,7 +391,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForUpdatePacket(sid_t sid, bool isD hkReceivers.push_back(hkReceiver); handleHkUpdateResetListInsertion(hkReceiver.dataType, hkReceiver.dataId); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::subscribeForSetUpdateMessage(const uint32_t setId, @@ -412,7 +412,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForSetUpdateMessage(const uint32_t hkReceivers.push_back(hkReceiver); handleHkUpdateResetListInsertion(hkReceiver.dataType, hkReceiver.dataId); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::subscribeForVariableUpdateMessage( @@ -432,7 +432,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForVariableUpdateMessage( hkReceivers.push_back(hkReceiver); handleHkUpdateResetListInsertion(hkReceiver.dataType, hkReceiver.dataId); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void LocalDataPoolManager::handleHkUpdateResetListInsertion(DataType dataType, DataId dataId) { @@ -470,7 +470,7 @@ void LocalDataPoolManager::handleHkUpdateResetListInsertion(DataType dataType, D ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* message) { Command_t command = message->getCommand(); sid_t sid = HousekeepingMessage::getSid(message); - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; switch (command) { // Houskeeping interface handling. case (HousekeepingMessage::ENABLE_PERIODIC_DIAGNOSTICS_GENERATION): { @@ -495,7 +495,7 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me case (HousekeepingMessage::REPORT_DIAGNOSTICS_REPORT_STRUCTURES): { result = generateSetStructurePacket(sid, true); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return result; } break; @@ -503,7 +503,7 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me case (HousekeepingMessage::REPORT_HK_REPORT_STRUCTURES): { result = generateSetStructurePacket(sid, false); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return result; } break; @@ -543,12 +543,12 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me /* Notification handling */ case (HousekeepingMessage::UPDATE_NOTIFICATION_SET): { owner->handleChangedDataset(sid); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case (HousekeepingMessage::UPDATE_NOTIFICATION_VARIABLE): { gp_id_t globPoolId = HousekeepingMessage::getUpdateNotificationVariableCommand(message); owner->handleChangedPoolVariable(globPoolId); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case (HousekeepingMessage::UPDATE_SNAPSHOT_SET): { store_address_t storeId; @@ -558,7 +558,7 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me if (clearMessage) { message->clear(); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case (HousekeepingMessage::UPDATE_SNAPSHOT_VARIABLE): { store_address_t storeId; @@ -568,7 +568,7 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me if (clearMessage) { message->clear(); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } default: @@ -576,7 +576,7 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me } CommandMessage reply; - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { HousekeepingMessage::setHkRequestFailureReply(&reply, sid, result); } else { HousekeepingMessage::setHkRequestSuccessReply(&reply, sid); @@ -593,7 +593,7 @@ ReturnValue_t LocalDataPoolManager::printPoolEntry(lp_id_t localPoolId) { return localpool::POOL_ENTRY_NOT_FOUND; } poolIter->second->print(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } MutexIF* LocalDataPoolManager::getMutexHandle() { return mutex; } @@ -616,7 +616,7 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid, size_t serializedSize = 0; ReturnValue_t result = serializeHkPacketIntoStore(hkPacket, storeId, forDownlink, &serializedSize); - if (result != HasReturnvaluesIF::RETURN_OK or serializedSize == 0) { + if (result != returnvalue::OK or serializedSize == 0) { return result; } @@ -653,7 +653,7 @@ ReturnValue_t LocalDataPoolManager::serializeHkPacketIntoStore(HousekeepingPacke uint8_t* dataPtr = nullptr; const size_t maxSize = hkPacket.getSerializedSize(); ReturnValue_t result = ipcStore->getFreeElement(&storeId, maxSize, &dataPtr); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -693,7 +693,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) { } ReturnValue_t result = generateHousekeepingPacket(sid, dataSet, true); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { /* Configuration error */ #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "LocalDataPoolManager::performPeriodicHkOperation: HK generation failed." @@ -724,7 +724,7 @@ ReturnValue_t LocalDataPoolManager::togglePeriodicGeneration(sid_t sid, bool ena } LocalPoolDataSetAttorney::setReportingEnabled(*dataSet, enable); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::changeCollectionInterval(sid_t sid, float newCollectionInterval, @@ -750,7 +750,7 @@ ReturnValue_t LocalDataPoolManager::changeCollectionInterval(sid_t sid, float ne } periodicHelper->changeCollectionInterval(newCollectionInterval); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid, bool isDiagnostics) { @@ -778,9 +778,9 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid, bool i uint8_t* storePtr = nullptr; store_address_t storeId; ReturnValue_t result = ipcStore->getFreeElement(&storeId, expectedSize, &storePtr); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { printWarningOrError(sif::OutputTypes::OUT_ERROR, "generateSetStructurePacket", - HasReturnvaluesIF::RETURN_FAILED, + returnvalue::FAILED, "Could not get free element from IPC store."); return result; } @@ -788,13 +788,13 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid, bool i // Serialize set packet into store. size_t size = 0; result = setPacket.serialize(&storePtr, &size, expectedSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ipcStore->deleteData(storeId); return result; } if (expectedSize != size) { printWarningOrError(sif::OutputTypes::OUT_WARNING, "generateSetStructurePacket", - HasReturnvaluesIF::RETURN_FAILED, + returnvalue::FAILED, "Expected size is not equal to serialized size"); } @@ -807,7 +807,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid, bool i } result = hkQueue->reply(&reply); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ipcStore->deleteData(storeId); } return result; @@ -835,7 +835,7 @@ void LocalDataPoolManager::printWarningOrError(sif::OutputTypes outputType, errorPrint = "Dataset not found"; } else if (error == POOLOBJECT_NOT_FOUND) { errorPrint = "Pool Object not found"; - } else if (error == HasReturnvaluesIF::RETURN_FAILED) { + } else if (error == returnvalue::FAILED) { if (outputType == sif::OutputTypes::OUT_WARNING) { errorPrint = "Generic Warning"; } else { diff --git a/src/fsfw/datapoollocal/LocalDataPoolManager.h b/src/fsfw/datapoollocal/LocalDataPoolManager.h index e7ec0b6f..bb2ea564 100644 --- a/src/fsfw/datapoollocal/LocalDataPoolManager.h +++ b/src/fsfw/datapoollocal/LocalDataPoolManager.h @@ -376,7 +376,7 @@ class LocalDataPoolManager : public ProvidesDataPoolSubscriptionIF, public Acces ReturnValue_t addUpdateToStore(HousekeepingSnapshot& updatePacket, store_address_t& storeId); void printWarningOrError(sif::OutputTypes outputType, const char* functionName, - ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED, + ReturnValue_t errorCode = returnvalue::FAILED, const char* errorPrint = nullptr); }; @@ -384,7 +384,7 @@ template inline ReturnValue_t LocalDataPoolManager::fetchPoolEntry(lp_id_t localPoolId, PoolEntry** poolEntry) { if (poolEntry == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } auto poolIter = localPoolMap.find(localPoolId); @@ -400,7 +400,7 @@ inline ReturnValue_t LocalDataPoolManager::fetchPoolEntry(lp_id_t localPoolId, localpool::POOL_ENTRY_TYPE_CONFLICT); return localpool::POOL_ENTRY_TYPE_CONFLICT; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } #endif /* FSFW_DATAPOOLLOCAL_LOCALDATAPOOLMANAGER_H_ */ diff --git a/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp b/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp index 62fdb184..38aad828 100644 --- a/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp +++ b/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp @@ -85,13 +85,13 @@ ReturnValue_t LocalPoolDataSetBase::lockDataPool(MutexIF::TimeoutType timeoutTyp if (mutexIfSingleDataCreator != nullptr) { return mutexIfSingleDataCreator->lockMutex(timeoutType, timeoutMs); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalPoolDataSetBase::serializeWithValidityBuffer( uint8_t **buffer, size_t *size, size_t maxSize, SerializeIF::Endianness streamEndianness) const { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; const uint8_t validityMaskSize = std::ceil(static_cast(fillCount) / 8.0); uint8_t *validityPtr = nullptr; #if defined(_MSC_VER) || defined(__clang__) @@ -119,7 +119,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeWithValidityBuffer( } result = registeredVariables[count]->serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -135,10 +135,10 @@ ReturnValue_t LocalPoolDataSetBase::serializeWithValidityBuffer( ReturnValue_t LocalPoolDataSetBase::deSerializeWithValidityBuffer( const uint8_t **buffer, size_t *size, SerializeIF::Endianness streamEndianness) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; for (uint16_t count = 0; count < fillCount; count++) { result = registeredVariables[count]->deSerialize(buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -169,7 +169,7 @@ ReturnValue_t LocalPoolDataSetBase::unlockDataPool() { if (mutexIfSingleDataCreator != nullptr) { return mutexIfSingleDataCreator->unlockMutex(); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t **buffer, size_t *size, @@ -185,7 +185,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t **buffer, size lp_id_t currentPoolId = registeredVariables[count]->getDataPoolId(); auto result = SerializeAdapter::serialize(¤tPoolId, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "LocalPoolDataSetBase::serializeLocalPoolIds: " << "Serialization error!" << std::endl; @@ -197,7 +197,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t **buffer, size return result; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } uint8_t LocalPoolDataSetBase::getLocalPoolIdsSerializedSize(bool serializeFillCount) const { diff --git a/src/fsfw/datapoollocal/LocalPoolObjectBase.h b/src/fsfw/datapoollocal/LocalPoolObjectBase.h index b2ffa4c1..f454fea3 100644 --- a/src/fsfw/datapoollocal/LocalPoolObjectBase.h +++ b/src/fsfw/datapoollocal/LocalPoolObjectBase.h @@ -15,7 +15,7 @@ class HasLocalDataPoolIF; * @brief This class serves as a non-template base for pool objects like pool variables * or pool vectors. */ -class LocalPoolObjectBase : public PoolVariableIF, public HasReturnvaluesIF, public MarkChangedIF { +class LocalPoolObjectBase : public PoolVariableIF, public MarkChangedIF { public: LocalPoolObjectBase(lp_id_t poolId, HasLocalDataPoolIF* hkOwner, DataSetIF* dataSet, pool_rwm_t setReadWriteMode); diff --git a/src/fsfw/datapoollocal/LocalPoolVariable.tpp b/src/fsfw/datapoollocal/LocalPoolVariable.tpp index f800dfd3..969a047b 100644 --- a/src/fsfw/datapoollocal/LocalPoolVariable.tpp +++ b/src/fsfw/datapoollocal/LocalPoolVariable.tpp @@ -29,7 +29,7 @@ inline ReturnValue_t LocalPoolVariable::read(MutexIF::TimeoutType timeoutType } MutexIF* mutex = LocalDpManagerAttorney::getMutexHandle(*hkManager); ReturnValue_t result = mutex->lockMutex(timeoutType, timeoutMs); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = readWithoutLock(); @@ -49,7 +49,7 @@ inline ReturnValue_t LocalPoolVariable::readWithoutLock() { PoolEntry* poolEntry = nullptr; ReturnValue_t result = LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, &poolEntry); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { object_id_t ownerObjectId = hkManager->getCreatorObjectId(); reportReadCommitError("LocalPoolVariable", result, false, ownerObjectId, localPoolId); return result; @@ -57,7 +57,7 @@ inline ReturnValue_t LocalPoolVariable::readWithoutLock() { this->value = *(poolEntry->getDataPtr()); this->valid = poolEntry->getValid(); - return RETURN_OK; + return returnvalue::OK; } template @@ -75,7 +75,7 @@ inline ReturnValue_t LocalPoolVariable::commit(MutexIF::TimeoutType timeoutTy } MutexIF* mutex = LocalDpManagerAttorney::getMutexHandle(*hkManager); ReturnValue_t result = mutex->lockMutex(timeoutType, timeoutMs); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = commitWithoutLock(); @@ -95,7 +95,7 @@ inline ReturnValue_t LocalPoolVariable::commitWithoutLock() { PoolEntry* poolEntry = nullptr; ReturnValue_t result = LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, &poolEntry); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { object_id_t ownerObjectId = hkManager->getCreatorObjectId(); reportReadCommitError("LocalPoolVariable", result, false, ownerObjectId, localPoolId); return result; @@ -103,7 +103,7 @@ inline ReturnValue_t LocalPoolVariable::commitWithoutLock() { *(poolEntry->getDataPtr()) = this->value; poolEntry->setValid(this->valid); - return RETURN_OK; + return returnvalue::OK; } template diff --git a/src/fsfw/datapoollocal/LocalPoolVector.tpp b/src/fsfw/datapoollocal/LocalPoolVector.tpp index a2c2b752..939405a9 100644 --- a/src/fsfw/datapoollocal/LocalPoolVector.tpp +++ b/src/fsfw/datapoollocal/LocalPoolVector.tpp @@ -43,14 +43,14 @@ inline ReturnValue_t LocalPoolVector::readWithoutLock() { LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, &poolEntry); memset(this->value, 0, vectorSize * sizeof(T)); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { object_id_t targetObjectId = hkManager->getCreatorObjectId(); reportReadCommitError("LocalPoolVector", result, true, targetObjectId, localPoolId); return result; } std::memcpy(this->value, poolEntry->getDataPtr(), poolEntry->getByteSize()); this->valid = poolEntry->getValid(); - return RETURN_OK; + return returnvalue::OK; } template @@ -79,14 +79,14 @@ inline ReturnValue_t LocalPoolVector::commitWithoutLock() { PoolEntry* poolEntry = nullptr; ReturnValue_t result = LocalDpManagerAttorney::fetchPoolEntry(*hkManager, localPoolId, &poolEntry); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { object_id_t targetObjectId = hkManager->getCreatorObjectId(); reportReadCommitError("LocalPoolVector", result, false, targetObjectId, localPoolId); return result; } std::memcpy(poolEntry->getDataPtr(), this->value, poolEntry->getByteSize()); poolEntry->setValid(this->valid); - return RETURN_OK; + return returnvalue::OK; } template @@ -131,10 +131,10 @@ template inline ReturnValue_t LocalPoolVector::serialize( uint8_t** buffer, size_t* size, size_t maxSize, SerializeIF::Endianness streamEndianness) const { - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; for (uint16_t i = 0; i < vectorSize; i++) { result = SerializeAdapter::serialize(&(value[i]), buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { break; } } @@ -149,10 +149,10 @@ inline size_t LocalPoolVector::getSerializedSize() const { template inline ReturnValue_t LocalPoolVector::deSerialize( const uint8_t** buffer, size_t* size, SerializeIF::Endianness streamEndianness) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; for (uint16_t i = 0; i < vectorSize; i++) { result = SerializeAdapter::deSerialize(&(value[i]), buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { break; } } diff --git a/src/fsfw/datapoollocal/SharedLocalDataSet.cpp b/src/fsfw/datapoollocal/SharedLocalDataSet.cpp index 248c1577..6d0b0b11 100644 --- a/src/fsfw/datapoollocal/SharedLocalDataSet.cpp +++ b/src/fsfw/datapoollocal/SharedLocalDataSet.cpp @@ -20,7 +20,7 @@ ReturnValue_t SharedLocalDataSet::lockDataset(MutexIF::TimeoutType timeoutType, if (datasetLock != nullptr) { return datasetLock->lockMutex(timeoutType, mutexTimeout); } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } SharedLocalDataSet::~SharedLocalDataSet() { MutexFactory::instance()->deleteMutex(datasetLock); } @@ -29,5 +29,5 @@ ReturnValue_t SharedLocalDataSet::unlockDataset() { if (datasetLock != nullptr) { return datasetLock->unlockMutex(); } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } diff --git a/src/fsfw/devicehandlers/AssemblyBase.cpp b/src/fsfw/devicehandlers/AssemblyBase.cpp index c29022e5..63178ab9 100644 --- a/src/fsfw/devicehandlers/AssemblyBase.cpp +++ b/src/fsfw/devicehandlers/AssemblyBase.cpp @@ -50,7 +50,7 @@ bool AssemblyBase::isInTransition() { bool AssemblyBase::handleChildrenChanged() { if (childrenChangedMode) { ReturnValue_t result = checkChildrenState(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { handleChildrenLostMode(result); } return true; @@ -116,7 +116,7 @@ void AssemblyBase::handleChildrenTransition() { break; } ReturnValue_t result = checkChildrenState(); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { handleModeReached(); } else { handleModeTransitionFailed(result); @@ -149,7 +149,7 @@ void AssemblyBase::handleModeTransitionFailed(ReturnValue_t result) { void AssemblyBase::sendHealthCommand(MessageQueueId_t sendTo, HealthState health) { CommandMessage command; HealthMessage::setHealthMessage(&command, HealthMessage::HEALTH_SET, health); - if (commandQueue->sendMessage(sendTo, &command) == RETURN_OK) { + if (commandQueue->sendMessage(sendTo, &command) == returnvalue::OK) { commandsOutstanding++; } } @@ -164,25 +164,25 @@ ReturnValue_t AssemblyBase::checkChildrenState() { ReturnValue_t AssemblyBase::checkChildrenStateOff() { for (const auto& childIter : childrenMap) { - if (checkChildOff(childIter.first) != RETURN_OK) { + if (checkChildOff(childIter.first) != returnvalue::OK) { return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE; } } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t AssemblyBase::checkChildOff(uint32_t objectId) { ChildInfo childInfo = childrenMap.find(objectId)->second; if (healthHelper.healthTable->isCommandable(objectId)) { if (childInfo.submode != SUBMODE_NONE) { - return RETURN_FAILED; + return returnvalue::FAILED; } else { if ((childInfo.mode != MODE_OFF) && (childInfo.mode != DeviceHandlerIF::MODE_ERROR_ON)) { - return RETURN_FAILED; + return returnvalue::FAILED; } } } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t AssemblyBase::checkModeCommand(Mode_t mode, Submode_t submode, @@ -192,7 +192,7 @@ ReturnValue_t AssemblyBase::checkModeCommand(Mode_t mode, Submode_t submode, if (submode != SUBMODE_NONE) { return INVALID_SUBMODE; } - return RETURN_OK; + return returnvalue::OK; } if ((mode != MODE_ON) && (mode != DeviceHandlerIF::MODE_NORMAL)) { @@ -212,7 +212,7 @@ ReturnValue_t AssemblyBase::handleHealthReply(CommandMessage* message) { if (health != EXTERNAL_CONTROL) { updateChildChangedHealth(message->getSender(), true); } - return RETURN_OK; + return returnvalue::OK; } if (message->getCommand() == HealthMessage::REPLY_HEALTH_SET || (message->getCommand() == CommandMessage::REPLY_REJECTED && @@ -220,9 +220,9 @@ ReturnValue_t AssemblyBase::handleHealthReply(CommandMessage* message) { if (isInTransition()) { commandsOutstanding--; } - return RETURN_OK; + return returnvalue::OK; } - return RETURN_FAILED; + return returnvalue::FAILED; } bool AssemblyBase::checkAndHandleRecovery() { diff --git a/src/fsfw/devicehandlers/AssemblyBase.h b/src/fsfw/devicehandlers/AssemblyBase.h index 3e235928..92feb6ae 100644 --- a/src/fsfw/devicehandlers/AssemblyBase.h +++ b/src/fsfw/devicehandlers/AssemblyBase.h @@ -79,7 +79,7 @@ class AssemblyBase : public SubsystemBase { * @param submode The targeted submmode * @return Any information why this combination is invalid from HasModesIF * like HasModesIF::INVALID_SUBMODE. - * On success return HasReturnvaluesIF::RETURN_OK + * On success return returnvalue::OK */ virtual ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) = 0; diff --git a/src/fsfw/devicehandlers/ChildHandlerBase.cpp b/src/fsfw/devicehandlers/ChildHandlerBase.cpp index be4f4798..ecd4cfc8 100644 --- a/src/fsfw/devicehandlers/ChildHandlerBase.cpp +++ b/src/fsfw/devicehandlers/ChildHandlerBase.cpp @@ -19,7 +19,7 @@ ChildHandlerBase::~ChildHandlerBase() {} ReturnValue_t ChildHandlerBase::initialize() { ReturnValue_t result = DeviceHandlerBase::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -28,7 +28,7 @@ ReturnValue_t ChildHandlerBase::initialize() { if (parentId != objects::NO_OBJECT) { SubsystemBase* parent = ObjectManager::instance()->get(parentId); if (parent == NULL) { - return RETURN_FAILED; + return returnvalue::FAILED; } parentQueue = parent->getCommandQueue(); @@ -39,5 +39,5 @@ ReturnValue_t ChildHandlerBase::initialize() { modeHelper.setParentQueue(parentQueue); - return RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/devicehandlers/DeviceCommunicationIF.h b/src/fsfw/devicehandlers/DeviceCommunicationIF.h index 7a860411..5af3f3f0 100644 --- a/src/fsfw/devicehandlers/DeviceCommunicationIF.h +++ b/src/fsfw/devicehandlers/DeviceCommunicationIF.h @@ -34,7 +34,7 @@ * @ingroup interfaces * @ingroup comm */ -class DeviceCommunicationIF : public HasReturnvaluesIF { +class DeviceCommunicationIF { public: static const uint8_t INTERFACE_ID = CLASS_ID::DEVICE_COMMUNICATION_IF; diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp index cf457a03..a93aca0d 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp @@ -32,7 +32,7 @@ DeviceHandlerBase::DeviceHandlerBase(object_id_t setObjectId, object_id_t device parameterHelper(this), actionHelper(this, nullptr), poolManager(this, nullptr), - childTransitionFailure(RETURN_OK), + childTransitionFailure(returnvalue::OK), fdirInstance(fdirInstance), defaultFDIRUsed(fdirInstance == nullptr), switchOffWasReported(false), @@ -46,7 +46,7 @@ DeviceHandlerBase::DeviceHandlerBase(object_id_t setObjectId, object_id_t device cookieInfo.pendingCommand = deviceCommandMap.end(); if (comCookie == nullptr) { printWarningOrError(sif::OutputTypes::OUT_ERROR, "DeviceHandlerBase", - HasReturnvaluesIF::RETURN_FAILED, "Invalid cookie"); + returnvalue::FAILED, "Invalid cookie"); } if (this->fdirInstance == nullptr) { this->fdirInstance = new DeviceHandlerFailureIsolation(setObjectId, defaultFdirParentId); @@ -79,7 +79,7 @@ ReturnValue_t DeviceHandlerBase::performOperation(uint8_t counter) { this->lastStep = this->pstStep; if (getComAction() == CommunicationAction::NOTHING) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } if (getComAction() == CommunicationAction::PERFORM_OPERATION) { @@ -90,11 +90,11 @@ ReturnValue_t DeviceHandlerBase::performOperation(uint8_t counter) { decrementDeviceReplyMap(); fdirInstance->checkForFailures(); performOperationHook(); - return RETURN_OK; + return returnvalue::OK; } if (mode == MODE_OFF) { - return RETURN_OK; + return returnvalue::OK; } switch (getComAction()) { @@ -120,12 +120,12 @@ ReturnValue_t DeviceHandlerBase::performOperation(uint8_t counter) { default: break; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t DeviceHandlerBase::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -138,7 +138,7 @@ ReturnValue_t DeviceHandlerBase::initialize() { } result = communicationInterface->initializeInterface(comCookie); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", ObjectManagerIF::CHILD_INIT_FAILED, "ComIF initialization failed"); return result; @@ -192,30 +192,30 @@ ReturnValue_t DeviceHandlerBase::initialize() { } result = healthHelper.initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = modeHelper.initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = actionHelper.initialize(commandQueue); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = fdirInstance->initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = parameterHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = poolManager.initialize(commandQueue); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -224,14 +224,14 @@ ReturnValue_t DeviceHandlerBase::initialize() { if (thermalSet != nullptr) { // Set temperature target state to NON_OP. result = thermalSet->read(); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { thermalSet->heaterRequest.value = ThermalComponentIF::STATE_REQUEST_NON_OPERATIONAL; thermalSet->heaterRequest.setValid(true); thermalSet->commit(); } } - return RETURN_OK; + return returnvalue::OK; } void DeviceHandlerBase::decrementDeviceReplyMap() { @@ -265,42 +265,42 @@ void DeviceHandlerBase::readCommandQueue() { CommandMessage command; ReturnValue_t result = commandQueue->receiveMessage(&command); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return; } result = healthHelper.handleHealthCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { return; } result = modeHelper.handleModeCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { return; } result = actionHelper.handleActionMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { return; } result = parameterHelper.handleParameterMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { return; } result = poolManager.handleHousekeepingMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { return; } result = handleDeviceHandlerMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { return; } result = letChildHandleMessage(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { return; } @@ -328,7 +328,7 @@ void DeviceHandlerBase::doStateMachine() { sprintf(printout, "Transition timeout (%lu) occured !", static_cast(childTransitionDelay)); /* Common configuration error for development, so print it */ - printWarningOrError(sif::OutputTypes::OUT_WARNING, "doStateMachine", RETURN_FAILED, + printWarningOrError(sif::OutputTypes::OUT_WARNING, "doStateMachine", returnvalue::FAILED, printout); #endif triggerEvent(MODE_TRANSITION_FAILED, childTransitionFailure, 0); @@ -407,7 +407,7 @@ ReturnValue_t DeviceHandlerBase::isModeCombinationValid(Mode_t mode, Submode_t s case MODE_NORMAL: case MODE_RAW: if (submode == SUBMODE_NONE) { - return RETURN_OK; + return returnvalue::OK; } else { return INVALID_SUBMODE; } @@ -444,9 +444,9 @@ ReturnValue_t DeviceHandlerBase::insertInReplyMap(DeviceCommandId_t replyId, info.countdown = countdown; auto resultPair = deviceReplyMap.emplace(replyId, info); if (resultPair.second) { - return RETURN_OK; + return returnvalue::OK; } else { - return RETURN_FAILED; + return returnvalue::FAILED; } } @@ -461,9 +461,9 @@ ReturnValue_t DeviceHandlerBase::insertInCommandMap(DeviceCommandId_t deviceComm info.alternativeReplyId = alternativeReplyId; auto resultPair = deviceCommandMap.emplace(deviceCommand, info); if (resultPair.second) { - return RETURN_OK; + return returnvalue::OK; } else { - return RETURN_FAILED; + return returnvalue::FAILED; } } @@ -499,7 +499,7 @@ ReturnValue_t DeviceHandlerBase::updateReplyMapEntry(DeviceCommandId_t deviceRep } info->delayCycles = delayCycles; info->periodic = periodic; - return RETURN_OK; + return returnvalue::OK; } } @@ -529,17 +529,17 @@ ReturnValue_t DeviceHandlerBase::updatePeriodicReply(bool enable, DeviceCommandI } } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t DeviceHandlerBase::setReplyDataset(DeviceCommandId_t replyId, LocalPoolDataSetBase* dataSet) { auto replyIter = deviceReplyMap.find(replyId); if (replyIter == deviceReplyMap.end()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } replyIter->second.dataSet = dataSet; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void DeviceHandlerBase::callChildStatemachine() { @@ -578,7 +578,7 @@ void DeviceHandlerBase::setMode(Mode_t newMode, uint8_t newSubmode) { if (mode == MODE_OFF and thermalSet != nullptr) { ReturnValue_t result = thermalSet->read(); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { if (thermalSet->heaterRequest.value != ThermalComponentIF::STATE_REQUEST_IGNORE) { thermalSet->heaterRequest.value = ThermalComponentIF::STATE_REQUEST_NON_OPERATIONAL; } @@ -593,7 +593,7 @@ void DeviceHandlerBase::setMode(Mode_t newMode) { setMode(newMode, submode); } void DeviceHandlerBase::replyReturnvalueToCommand(ReturnValue_t status, uint32_t parameter) { // This is actually the reply protocol for raw and misc DH commands. - if (status == RETURN_OK) { + if (status == returnvalue::OK) { CommandMessage reply(CommandMessage::REPLY_COMMAND_OK, 0, parameter); commandQueue->reply(&reply); } else { @@ -606,7 +606,7 @@ void DeviceHandlerBase::replyToCommand(ReturnValue_t status, uint32_t parameter) // Check if we reply to a raw command. if (cookieInfo.pendingCommand->first == RAW_COMMAND_ID) { if (status == NO_REPLY_EXPECTED) { - status = RETURN_OK; + status = returnvalue::OK; } replyReturnvalueToCommand(status, parameter); // Always delete data from a raw command. @@ -617,7 +617,7 @@ void DeviceHandlerBase::replyToCommand(ReturnValue_t status, uint32_t parameter) if (cookieInfo.pendingCommand->second.sendReplyTo != NO_COMMANDER) { MessageQueueId_t queueId = cookieInfo.pendingCommand->second.sendReplyTo; if (status == NO_REPLY_EXPECTED) { - actionHelper.finish(true, queueId, cookieInfo.pendingCommand->first, RETURN_OK); + actionHelper.finish(true, queueId, cookieInfo.pendingCommand->first, returnvalue::OK); } else { actionHelper.step(1, queueId, cookieInfo.pendingCommand->first, status); } @@ -635,7 +635,7 @@ void DeviceHandlerBase::replyToReply(const DeviceCommandId_t command, DeviceRepl DeviceCommandInfo* info = &replyInfo.command->second; if (info == nullptr) { printWarningOrError(sif::OutputTypes::OUT_ERROR, "replyToReply", - HasReturnvaluesIF::RETURN_FAILED, "Command pointer not found"); + returnvalue::FAILED, "Command pointer not found"); return; } @@ -649,7 +649,7 @@ void DeviceHandlerBase::replyToReply(const DeviceCommandId_t command, DeviceRepl // Don't send any replies in that case. if (info->sendReplyTo != NO_COMMANDER) { bool success = false; - if (status == HasReturnvaluesIF::RETURN_OK) { + if (status == returnvalue::OK) { success = true; } actionHelper.finish(success, info->sendReplyTo, command, status); @@ -662,7 +662,7 @@ void DeviceHandlerBase::doSendWrite() { if (cookieInfo.state == COOKIE_WRITE_READY) { ReturnValue_t result = communicationInterface->sendMessage(comCookie, rawPacket, rawPacketLen); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { cookieInfo.state = COOKIE_WRITE_SENT; } else { // always generate a failure event, so that FDIR knows what's up @@ -680,7 +680,7 @@ void DeviceHandlerBase::doGetWrite() { } cookieInfo.state = COOKIE_UNUSED; ReturnValue_t result = communicationInterface->getSendSuccess(comCookie); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { if (wiretappingMode == RAW) { replyRawData(rawPacket, rawPacketLen, requestedRawTraffic, true); } @@ -694,7 +694,7 @@ void DeviceHandlerBase::doGetWrite() { // always generate a failure event, so that FDIR knows what's up triggerEvent(DEVICE_SENDING_COMMAND_FAILED, result, cookieInfo.pendingCommand->first); } - if (result != RETURN_OK) { + if (result != returnvalue::OK) { cookieInfo.pendingCommand->second.isExecuting = false; } replyToCommand(result); @@ -704,7 +704,7 @@ void DeviceHandlerBase::doSendRead() { ReturnValue_t result; result = doSendReadHook(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return; } @@ -715,7 +715,7 @@ void DeviceHandlerBase::doSendRead() { result = communicationInterface->requestReceiveMessage(comCookie, replyLen); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { cookieInfo.state = COOKIE_READ_SENT; } else { triggerEvent(DEVICE_REQUESTING_REPLY_FAILED, result); @@ -741,7 +741,7 @@ void DeviceHandlerBase::doGetRead() { ReturnValue_t result = communicationInterface->readReceivedMessage(comCookie, &receivedData, &receivedDataLen); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { triggerEvent(DEVICE_REQUESTING_REPLY_FAILED, result); // I think we can allow to ignore one missedReply. ignoreMissedRepliesCount++; @@ -764,7 +764,7 @@ void DeviceHandlerBase::doGetRead() { } void DeviceHandlerBase::parseReply(const uint8_t* receivedData, size_t receivedDataLen) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; DeviceCommandId_t foundId = DeviceHandlerIF::NO_COMMAND_ID; size_t foundLen = 0; /* The loop may not execute more often than the number of received bytes @@ -773,7 +773,7 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData, size_t receivedD for (uint32_t count = 0; count < receivedDataLen; count++) { result = scanForReply(receivedData, remainingLength, &foundId, &foundLen); switch (result) { - case RETURN_OK: + case returnvalue::OK: handleReply(receivedData, foundId, foundLen); if (foundLen == 0) { printWarningOrError(sif::OutputTypes::OUT_WARNING, "parseReply", @@ -783,7 +783,7 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData, size_t receivedD break; case APERIODIC_REPLY: { result = interpretDeviceReply(foundId, receivedData); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { replyRawReplyIfnotWiretapped(receivedData, foundLen); triggerEvent(DEVICE_INTERPRETING_REPLY_FAILED, result, foundId); } @@ -846,7 +846,7 @@ void DeviceHandlerBase::handleReply(const uint8_t* receivedData, DeviceCommandId resetDelayCyclesControlledReply(info); } - if (result != RETURN_OK) { + if (result != returnvalue::OK) { // Report failed interpretation to FDIR. replyRawReplyIfnotWiretapped(receivedData, foundLen); triggerEvent(DEVICE_INTERPRETING_REPLY_FAILED, result, foundId); @@ -887,12 +887,12 @@ ReturnValue_t DeviceHandlerBase::getStorageData(store_address_t storageAddress, if (IPCStore == nullptr) { *data = nullptr; *len = 0; - return RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t result = IPCStore->modifyData(storageAddress, data, &lenTmp); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { *len = lenTmp; - return RETURN_OK; + return returnvalue::OK; } else { triggerEvent(StorageManagerIF::GET_DATA_FAILED, result, storageAddress.raw); *data = nullptr; @@ -909,7 +909,7 @@ void DeviceHandlerBase::replyRawData(const uint8_t* data, size_t len, MessageQue store_address_t address; ReturnValue_t result = IPCStore->addData(&address, data, len); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { triggerEvent(StorageManagerIF::STORE_DATA_FAILED, result); return; } @@ -921,7 +921,7 @@ void DeviceHandlerBase::replyRawData(const uint8_t* data, size_t len, MessageQue result = commandQueue->sendMessage(sendTo, &command); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { IPCStore->deleteData(address); // Silently discard data, this indicates heavy TM traffic which // should not be increased by additional events. @@ -957,7 +957,7 @@ MessageQueueId_t DeviceHandlerBase::getCommandQueue() const { return commandQueu void DeviceHandlerBase::buildRawDeviceCommand(CommandMessage* commandMessage) { storedRawData = DeviceHandlerMessage::getStoreAddress(commandMessage); ReturnValue_t result = getStorageData(storedRawData, &rawPacket, &rawPacketLen); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { replyReturnvalueToCommand(result, RAW_COMMAND_ID); storedRawData.raw = StorageManagerIF::INVALID_ADDRESS; } else { @@ -974,7 +974,7 @@ void DeviceHandlerBase::commandSwitch(ReturnValue_t onOff) { const uint8_t* switches; uint8_t numberOfSwitches = 0; ReturnValue_t result = getSwitches(&switches, &numberOfSwitches); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { while (numberOfSwitches > 0) { powerSwitcher->sendSwitchCommand(switches[numberOfSwitches - 1], onOff); numberOfSwitches--; @@ -982,7 +982,7 @@ void DeviceHandlerBase::commandSwitch(ReturnValue_t onOff) { } } -ReturnValue_t DeviceHandlerBase::doSendReadHook() { return RETURN_OK; } +ReturnValue_t DeviceHandlerBase::doSendReadHook() { return returnvalue::OK; } ReturnValue_t DeviceHandlerBase::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { return DeviceHandlerBase::NO_SWITCH; @@ -1011,7 +1011,7 @@ ReturnValue_t DeviceHandlerBase::enableReplyInReplyMap(DeviceCommandMap::iterato info->countdown->resetTimer(); } info->active = true; - return RETURN_OK; + return returnvalue::OK; } else { return NO_REPLY_EXPECTED; } @@ -1029,7 +1029,7 @@ ReturnValue_t DeviceHandlerBase::getStateOfSwitches(void) { const uint8_t* switches; ReturnValue_t result = getSwitches(&switches, &numberOfSwitches); - if ((result == RETURN_OK) && (numberOfSwitches != 0)) { + if ((result == returnvalue::OK) && (numberOfSwitches != 0)) { while (numberOfSwitches > 0) { if (powerSwitcher->getSwitchState(switches[numberOfSwitches - 1]) == PowerSwitchIF::SWITCH_OFF) { @@ -1074,7 +1074,7 @@ ReturnValue_t DeviceHandlerBase::checkModeCommand(Mode_t commandedMode, Submode_ if ((commandedMode == MODE_ON) && (mode == MODE_OFF) and (thermalSet != nullptr)) { ReturnValue_t result = thermalSet->read(); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { if ((thermalSet->heaterRequest.value != ThermalComponentIF::STATE_REQUEST_IGNORE) and (not ThermalComponentIF::isOperational(thermalSet->thermalState.value))) { triggerEvent(ThermalComponentIF::TEMP_NOT_IN_OP_RANGE, thermalSet->thermalState.value); @@ -1134,7 +1134,7 @@ void DeviceHandlerBase::handleTransitionToOnMode(Mode_t commandedMode, Submode_t triggerEvent(CHANGING_MODE, commandedMode, commandedSubmode); if (thermalSet != nullptr) { ReturnValue_t result = thermalSet->read(); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { if (thermalSet->heaterRequest != ThermalComponentIF::STATE_REQUEST_IGNORE) { thermalSet->heaterRequest = ThermalComponentIF::STATE_REQUEST_OPERATIONAL; thermalSet->commit(); @@ -1169,7 +1169,7 @@ HasHealthIF::HealthState DeviceHandlerBase::getHealth() { return healthHelper.ge ReturnValue_t DeviceHandlerBase::setHealth(HealthState health) { healthHelper.setHealth(health); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void DeviceHandlerBase::checkSwitchState() { @@ -1191,7 +1191,7 @@ ReturnValue_t DeviceHandlerBase::acceptExternalDeviceCommands() { if ((mode != MODE_ON) && (mode != MODE_NORMAL)) { return WRONG_MODE_FOR_COMMAND; } - return RETURN_OK; + return returnvalue::OK; } void DeviceHandlerBase::replyRawReplyIfnotWiretapped(const uint8_t* data, size_t len) { @@ -1220,10 +1220,10 @@ ReturnValue_t DeviceHandlerBase::handleDeviceHandlerMessage(CommandMessage* mess default: replyReturnvalueToCommand(INVALID_COMMAND_PARAMETER); wiretappingMode = OFF; - return RETURN_OK; + return returnvalue::OK; } - replyReturnvalueToCommand(RETURN_OK); - return RETURN_OK; + replyReturnvalueToCommand(returnvalue::OK); + return returnvalue::OK; case DeviceHandlerMessage::CMD_RAW: if ((mode != MODE_RAW)) { DeviceHandlerMessage::clear(message); @@ -1231,9 +1231,9 @@ ReturnValue_t DeviceHandlerBase::handleDeviceHandlerMessage(CommandMessage* mess } else { buildRawDeviceCommand(message); } - return RETURN_OK; + return returnvalue::OK; default: - return RETURN_FAILED; + return returnvalue::FAILED; } } @@ -1254,7 +1254,7 @@ bool DeviceHandlerBase::isAwaitingReply() { } ReturnValue_t DeviceHandlerBase::letChildHandleMessage(CommandMessage* message) { - return RETURN_FAILED; + return returnvalue::FAILED; } void DeviceHandlerBase::handleDeviceTM(SerializeIF* dataSet, DeviceCommandId_t replyId, @@ -1316,7 +1316,7 @@ void DeviceHandlerBase::handleDeviceTM(SerializeIF* dataSet, DeviceCommandId_t r ReturnValue_t DeviceHandlerBase::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { ReturnValue_t result = acceptExternalDeviceCommands(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } DeviceCommandMap::iterator iter = deviceCommandMap.find(actionId); @@ -1327,7 +1327,7 @@ ReturnValue_t DeviceHandlerBase::executeAction(ActionId_t actionId, MessageQueue } else { result = buildCommandFromCommand(actionId, data, size); } - if (result == RETURN_OK) { + if (result == returnvalue::OK) { iter->second.sendReplyTo = commandedBy; iter->second.isExecuting = true; cookieInfo.pendingCommand = iter; @@ -1345,7 +1345,7 @@ void DeviceHandlerBase::buildInternalCommand(void) { if (result == BUSY) { /* So we can track misconfigurations */ printWarningOrError(sif::OutputTypes::OUT_WARNING, "buildInternalCommand", - HasReturnvaluesIF::RETURN_FAILED, "Busy."); + returnvalue::FAILED, "Busy."); /* No need to report this */ result = NOTHING_TO_SEND; } @@ -1361,7 +1361,7 @@ void DeviceHandlerBase::buildInternalCommand(void) { if (result == NOTHING_TO_SEND) { return; } - if (result == RETURN_OK) { + if (result == returnvalue::OK) { DeviceCommandMap::iterator iter = deviceCommandMap.find(deviceCommandId); if (iter == deviceCommandMap.end()) { #if FSFW_VERBOSE_LEVEL >= 1 @@ -1378,7 +1378,7 @@ void DeviceHandlerBase::buildInternalCommand(void) { sprintf(output, "Command 0x%08x is executing", static_cast(deviceCommandId)); // so we can track misconfigurations printWarningOrError(sif::OutputTypes::OUT_WARNING, "buildInternalCommand", - HasReturnvaluesIF::RETURN_FAILED, output); + returnvalue::FAILED, output); #endif // this is an internal command, no need to report a failure here, // missed reply will track if a reply is too late, otherwise, it's ok @@ -1390,7 +1390,7 @@ void DeviceHandlerBase::buildInternalCommand(void) { cookieInfo.state = COOKIE_WRITE_READY; } } - if (result != RETURN_OK) { + if (result != returnvalue::OK) { triggerEvent(DEVICE_BUILDING_COMMAND_FAILED, result, deviceCommandId); } } @@ -1466,7 +1466,7 @@ ReturnValue_t DeviceHandlerBase::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(thermalSet->heaterRequestPoolId, new PoolEntry); } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t DeviceHandlerBase::initializeAfterTaskCreation() { @@ -1480,7 +1480,7 @@ ReturnValue_t DeviceHandlerBase::initializeAfterTaskCreation() { if (setStartupImmediately) { startTransition(MODE_ON, SUBMODE_NONE); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } LocalPoolDataSetBase* DeviceHandlerBase::getDataSetHandle(sid_t sid) { @@ -1518,7 +1518,7 @@ void DeviceHandlerBase::printWarningOrError(sif::OutputTypes errorType, const ch if (errorPrint == nullptr) { if (errorCode == ObjectManagerIF::CHILD_INIT_FAILED) { errorPrint = "Initialization error"; - } else if (errorCode == HasReturnvaluesIF::RETURN_FAILED) { + } else if (errorCode == returnvalue::FAILED) { if (errorType == sif::OutputTypes::OUT_WARNING) { errorPrint = "Generic Warning"; } else { diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.h b/src/fsfw/devicehandlers/DeviceHandlerBase.h index e29e6596..35a33eab 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -78,7 +78,6 @@ class StorageManagerIF; * @ingroup devices */ class DeviceHandlerBase : public DeviceHandlerIF, - public HasReturnvaluesIF, public ExecutableObjectIF, public SystemObject, public HasModesIF, @@ -359,7 +358,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * buffer is scanned at previous position + foundLen. * @return * - @c RETURN_OK a valid packet was found at @c start, @c foundLen is valid - * - @c RETURN_FAILED no reply could be found starting at @c start, + * - @c returnvalue::FAILED no reply could be found starting at @c start, * implies @c foundLen is not valid, base class will call scanForReply() * again with ++start * - @c DeviceHandlerIF::INVALID_DATA a packet was found but it is invalid, @@ -391,7 +390,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * - @c RETURN_OK when the reply was interpreted. * - @c IGNORE_REPLY_DATA Ignore the reply and don't reset reply cycle * counter. - * - @c RETURN_FAILED when the reply could not be interpreted, + * - @c returnvalue::FAILED when the reply could not be interpreted, * e.g. logical errors or range violations occurred */ virtual ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) = 0; @@ -452,7 +451,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * to provide a pointer to a Countdown object which will signal the timeout * when expired * @return - @c RETURN_OK when the command was successfully inserted, - * - @c RETURN_FAILED else. + * - @c returnvalue::FAILED else. */ ReturnValue_t insertInCommandAndReplyMap(DeviceCommandId_t deviceCommand, uint16_t maxDelayCycles, LocalPoolDataSetBase *replyDataSet = nullptr, @@ -473,7 +472,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * to provide a pointer to a Countdown object which will signal the timeout * when expired * @return - @c RETURN_OK when the command was successfully inserted, - * - @c RETURN_FAILED else. + * - @c returnvalue::FAILED else. */ ReturnValue_t insertInReplyMap(DeviceCommandId_t deviceCommand, uint16_t maxDelayCycles, LocalPoolDataSetBase *dataSet = nullptr, size_t replyLen = 0, @@ -483,7 +482,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @brief A simple command to add a command to the commandList. * @param deviceCommand The command to add * @return - @c RETURN_OK when the command was successfully inserted, - * - @c RETURN_FAILED else. + * - @c returnvalue::FAILED else. */ ReturnValue_t insertInCommandMap(DeviceCommandId_t deviceCommand, bool useAlternativeReply = false, @@ -520,7 +519,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * by the device repeatedly without request) or not. Default is aperiodic (0). * Warning: The setting always overrides the value that was entered in the map. * @return - @c RETURN_OK when the command was successfully inserted, - * - @c RETURN_FAILED else. + * - @c returnvalue::FAILED else. */ ReturnValue_t updateReplyMapEntry(DeviceCommandId_t deviceReply, uint16_t delayCycles, uint16_t maxDelayCycles, bool periodic = false); @@ -604,7 +603,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param submode * @return * - @c RETURN_OK if valid - * - @c RETURN_FAILED if invalid + * - @c returnvalue::FAILED if invalid */ virtual ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode); /** @@ -624,7 +623,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param[out] numberOfSwitches length of returned array * @return * - @c RETURN_OK if the parameters were set - * - @c RETURN_FAILED if no switches exist + * - @c returnvalue::FAILED if no switches exist */ virtual ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches); @@ -1033,7 +1032,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * by #switches are on * - @c PowerSwitchIF::SWITCH_OFF one of the switches specified by * #switches are off - * - @c PowerSwitchIF::RETURN_FAILED if an error occured + * - @c PowerSwitchIF::returnvalue::FAILED if an error occured */ ReturnValue_t getStateOfSwitches(); @@ -1275,7 +1274,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param[out] len * @return * - @c RETURN_OK @c data is valid - * - @c RETURN_FAILED IPCStore is nullptr + * - @c returnvalue::FAILED IPCStore is nullptr * - the return value from the IPCStore if it was not @c RETURN_OK */ ReturnValue_t getStorageData(store_address_t storageAddress, uint8_t **data, size_t *len); @@ -1306,7 +1305,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param errorPrint */ void printWarningOrError(sif::OutputTypes errorType, const char *functionName, - ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED, + ReturnValue_t errorCode = returnvalue::FAILED, const char *errorPrint = nullptr); }; diff --git a/src/fsfw/devicehandlers/DeviceHandlerFailureIsolation.cpp b/src/fsfw/devicehandlers/DeviceHandlerFailureIsolation.cpp index 48783c20..a3ac9ff7 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerFailureIsolation.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerFailureIsolation.cpp @@ -23,9 +23,9 @@ DeviceHandlerFailureIsolation::~DeviceHandlerFailureIsolation() {} ReturnValue_t DeviceHandlerFailureIsolation::eventReceived(EventMessage* event) { if (isFdirInActionOrAreWeFaulty(event)) { - return RETURN_OK; + return returnvalue::OK; } - ReturnValue_t result = RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; switch (event->getEvent()) { case HasModesIF::MODE_TRANSITION_FAILED: case HasModesIF::OBJECT_IN_INVALID_MODE: @@ -48,7 +48,7 @@ ReturnValue_t DeviceHandlerFailureIsolation::eventReceived(EventMessage* event) // The two above should never be confirmed. case DeviceHandlerIF::DEVICE_MISSED_REPLY: result = sendConfirmationRequest(event); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { break; } // else @@ -72,7 +72,7 @@ ReturnValue_t DeviceHandlerFailureIsolation::eventReceived(EventMessage* event) case PowerSwitchIF::SWITCH_WENT_OFF: if (powerConfirmation != MessageQueueIF::NO_QUEUE) { result = sendConfirmationRequest(event, powerConfirmation); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { setFdirState(DEVICE_MIGHT_BE_OFF); } } @@ -106,9 +106,9 @@ ReturnValue_t DeviceHandlerFailureIsolation::eventReceived(EventMessage* event) // break; default: // We don't know the event, someone else should handle it. - return RETURN_FAILED; + return returnvalue::FAILED; } - return RETURN_OK; + return returnvalue::OK; } void DeviceHandlerFailureIsolation::eventConfirmed(EventMessage* event) { @@ -162,7 +162,7 @@ void DeviceHandlerFailureIsolation::clearFaultCounters() { ReturnValue_t DeviceHandlerFailureIsolation::initialize() { ReturnValue_t result = FailureIsolationBase::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "DeviceHandlerFailureIsolation::initialize: Could not" " initialize FailureIsolationBase." @@ -176,7 +176,7 @@ ReturnValue_t DeviceHandlerFailureIsolation::initialize() { powerConfirmation = power->getEventReceptionQueue(); } - return RETURN_OK; + return returnvalue::OK; } void DeviceHandlerFailureIsolation::setFdirState(FDIRState state) { diff --git a/src/fsfw/devicehandlers/DeviceTmReportingWrapper.cpp b/src/fsfw/devicehandlers/DeviceTmReportingWrapper.cpp index 3da431dc..dc987e6d 100644 --- a/src/fsfw/devicehandlers/DeviceTmReportingWrapper.cpp +++ b/src/fsfw/devicehandlers/DeviceTmReportingWrapper.cpp @@ -12,11 +12,11 @@ ReturnValue_t DeviceTmReportingWrapper::serialize(uint8_t** buffer, size_t* size Endianness streamEndianness) const { ReturnValue_t result = SerializeAdapter::serialize(&objectId, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&actionId, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return data->serialize(buffer, size, maxSize, streamEndianness); @@ -29,11 +29,11 @@ size_t DeviceTmReportingWrapper::getSerializedSize() const { ReturnValue_t DeviceTmReportingWrapper::deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { ReturnValue_t result = SerializeAdapter::deSerialize(&objectId, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&actionId, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return data->deSerialize(buffer, size, streamEndianness); diff --git a/src/fsfw/devicehandlers/HealthDevice.cpp b/src/fsfw/devicehandlers/HealthDevice.cpp index a626fa6c..4c09964a 100644 --- a/src/fsfw/devicehandlers/HealthDevice.cpp +++ b/src/fsfw/devicehandlers/HealthDevice.cpp @@ -16,7 +16,7 @@ HealthDevice::~HealthDevice() { QueueFactory::instance()->deleteMessageQueue(com ReturnValue_t HealthDevice::performOperation(uint8_t opCode) { CommandMessage command; ReturnValue_t result = commandQueue->receiveMessage(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { result = healthHelper.handleHealthCommand(&command); } return result; @@ -24,7 +24,7 @@ ReturnValue_t HealthDevice::performOperation(uint8_t opCode) { ReturnValue_t HealthDevice::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (parentQueue != 0) { @@ -50,7 +50,7 @@ bool HealthDevice::hasHealthChanged() { ReturnValue_t HealthDevice::setHealth(HealthState health) { healthHelper.setHealth(health); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } HasHealthIF::HealthState HealthDevice::getHealth() { return healthHelper.getHealth(); } diff --git a/src/fsfw/events/EventManager.cpp b/src/fsfw/events/EventManager.cpp index 47270d2a..f4466817 100644 --- a/src/fsfw/events/EventManager.cpp +++ b/src/fsfw/events/EventManager.cpp @@ -30,18 +30,18 @@ EventManager::~EventManager() { MessageQueueId_t EventManager::getEventReportQueue() { return eventReportQueue->getId(); } ReturnValue_t EventManager::performOperation(uint8_t opCode) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - while (result == HasReturnvaluesIF::RETURN_OK) { + ReturnValue_t result = returnvalue::OK; + while (result == returnvalue::OK) { EventMessage message; result = eventReportQueue->receiveMessage(&message); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { #if FSFW_OBJ_EVENT_TRANSLATION == 1 printEvent(&message); #endif notifyListeners(&message); } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void EventManager::notifyListeners(EventMessage* message) { @@ -59,9 +59,9 @@ ReturnValue_t EventManager::registerListener(MessageQueueId_t listener, auto result = listenerList.insert(std::pair( listener, EventMatchTree(&factoryBackend, forwardAllButSelected))); if (!result.second) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t EventManager::subscribeToEvent(MessageQueueId_t listener, EventId_t event) { diff --git a/src/fsfw/events/eventmatching/EventMatchTree.cpp b/src/fsfw/events/eventmatching/EventMatchTree.cpp index b564e305..cd3da6a2 100644 --- a/src/fsfw/events/eventmatching/EventMatchTree.cpp +++ b/src/fsfw/events/eventmatching/EventMatchTree.cpp @@ -31,12 +31,12 @@ ReturnValue_t EventMatchTree::addMatch(EventId_t idFrom, EventId_t idTo, bool id iterator lastTest; ReturnValue_t result = findOrInsertRangeMatcher( begin(), idFrom, idTo, idInverted, &lastTest); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (reporterFrom == 0) { // No need to add another AND branch - return RETURN_OK; + return returnvalue::OK; } if (reporterTo == 0) { reporterTo = reporterFrom; @@ -95,7 +95,7 @@ inline ReturnValue_t EventMatchTree::findOrInsertRangeMatcher(iterator start, VA if ((matcher->rangeMatcher.lowerBound == idFrom) && (matcher->rangeMatcher.upperBound == idTo) && (matcher->rangeMatcher.inverted == inverted)) { - return RETURN_OK; + return returnvalue::OK; } else { iter = iter.right(); } @@ -115,9 +115,9 @@ inline ReturnValue_t EventMatchTree::findOrInsertRangeMatcher(iterator start, VA *lastTest = insert(attachToBranch, *lastTest, newNode); if (*lastTest == end()) { // This actaully never fails, so creating a dedicated returncode seems an overshoot. - return RETURN_FAILED; + return returnvalue::FAILED; } - return RETURN_OK; + return returnvalue::OK; } template diff --git a/src/fsfw/events/eventmatching/EventMatchTree.h b/src/fsfw/events/eventmatching/EventMatchTree.h index 010e0623..7561e27d 100644 --- a/src/fsfw/events/eventmatching/EventMatchTree.h +++ b/src/fsfw/events/eventmatching/EventMatchTree.h @@ -7,7 +7,7 @@ #include "../../returnvalues/HasReturnvaluesIF.h" class StorageManagerIF; -class EventMatchTree : public MatchTree, public HasReturnvaluesIF { +class EventMatchTree : public MatchTree { public: EventMatchTree(StorageManagerIF* storageBackend, bool invertedMatch); virtual ~EventMatchTree(); diff --git a/src/fsfw/fdir/FailureIsolationBase.cpp b/src/fsfw/fdir/FailureIsolationBase.cpp index 3e6d5dcf..28df16d8 100644 --- a/src/fsfw/fdir/FailureIsolationBase.cpp +++ b/src/fsfw/fdir/FailureIsolationBase.cpp @@ -35,15 +35,15 @@ ReturnValue_t FailureIsolationBase::initialize() { " been initialized!" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t result = manager->registerListener(eventQueue->getId()); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (ownerId != objects::NO_OBJECT) { result = manager->subscribeToAllEventsFrom(eventQueue->getId(), ownerId); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } owner = ObjectManager::instance()->get(ownerId); @@ -68,16 +68,16 @@ ReturnValue_t FailureIsolationBase::initialize() { sif::error << "Make sure it implements ConfirmsFailuresIF." << std::endl; #endif return ObjectManagerIF::CHILD_INIT_FAILED; - return RETURN_FAILED; + return returnvalue::FAILED; } eventQueue->setDefaultDestination(parentIF->getEventReceptionQueue()); } - return RETURN_OK; + return returnvalue::OK; } void FailureIsolationBase::checkForFailures() { EventMessage event; - for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == RETURN_OK; + for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK; result = eventQueue->receiveMessage(&event)) { if (event.getSender() == eventQueue->getId()) { // We already got this event, because we sent it. @@ -124,7 +124,7 @@ ReturnValue_t FailureIsolationBase::sendConfirmationRequest(EventMessage* event, } else if (faultTreeParent != objects::NO_OBJECT) { return eventQueue->sendToDefault(event); } - return RETURN_FAILED; + return returnvalue::FAILED; } void FailureIsolationBase::eventConfirmed(EventMessage* event) {} diff --git a/src/fsfw/fdir/FailureIsolationBase.h b/src/fsfw/fdir/FailureIsolationBase.h index 85d18add..543d9fca 100644 --- a/src/fsfw/fdir/FailureIsolationBase.h +++ b/src/fsfw/fdir/FailureIsolationBase.h @@ -9,8 +9,7 @@ #include "ConfirmsFailuresIF.h" #include "FaultCounter.h" -class FailureIsolationBase : public HasReturnvaluesIF, - public ConfirmsFailuresIF, +class FailureIsolationBase : public ConfirmsFailuresIF, public HasParametersIF { public: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::FDIR_1; diff --git a/src/fsfw/fdir/FaultCounter.cpp b/src/fsfw/fdir/FaultCounter.cpp index 4515e5b1..eea08817 100644 --- a/src/fsfw/fdir/FaultCounter.cpp +++ b/src/fsfw/fdir/FaultCounter.cpp @@ -73,7 +73,7 @@ ReturnValue_t FaultCounter::getParameter(uint8_t domainId, uint8_t uniqueId, default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void FaultCounter::setParameterDomain(uint8_t domain) { parameterDomain = domain; } diff --git a/src/fsfw/globalfunctions/AsciiConverter.cpp b/src/fsfw/globalfunctions/AsciiConverter.cpp index 6d49c777..b99814cb 100644 --- a/src/fsfw/globalfunctions/AsciiConverter.cpp +++ b/src/fsfw/globalfunctions/AsciiConverter.cpp @@ -44,7 +44,7 @@ ReturnValue_t AsciiConverter::scanAsciiHexByte(const uint8_t** dataPtr, uint8_t* *value = *value >> 4; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t AsciiConverter::scanAsciiDecimalNumber_(uint8_t const** dataPtr, uint8_t len, @@ -99,7 +99,7 @@ ReturnValue_t AsciiConverter::scanAsciiDecimalNumber_(uint8_t const** dataPtr, u *dataPtr = ptr; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t AsciiConverter::printFloat(uint8_t* buffer, uint32_t bufferLength, float value, @@ -124,7 +124,7 @@ ReturnValue_t AsciiConverter::printFloat(uint8_t* buffer, uint32_t bufferLength, ReturnValue_t result = printInteger(buffer + streamposition, bufferLength - streamposition - decimalPlaces - 1, value, &integerSize); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } streamposition += integerSize; @@ -161,7 +161,7 @@ ReturnValue_t AsciiConverter::printInteger(uint8_t* buffer, uint32_t bufferLengt } if (!leadingZeros && (value == 0)) { buffer[(*printedSize)++] = '0'; - return RETURN_OK; + return returnvalue::OK; } while (maximumNumber >= 1) { uint8_t number = value / maximumNumber; @@ -174,7 +174,7 @@ ReturnValue_t AsciiConverter::printInteger(uint8_t* buffer, uint32_t bufferLengt maximumNumber /= 10; } } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t AsciiConverter::printSignedInteger(uint8_t* buffer, uint32_t bufferLength, diff --git a/src/fsfw/globalfunctions/AsciiConverter.h b/src/fsfw/globalfunctions/AsciiConverter.h index db382b61..7eb28882 100644 --- a/src/fsfw/globalfunctions/AsciiConverter.h +++ b/src/fsfw/globalfunctions/AsciiConverter.h @@ -3,7 +3,7 @@ #include "../returnvalues/HasReturnvaluesIF.h" -class AsciiConverter : public HasReturnvaluesIF { +class AsciiConverter { public: static const uint8_t INTERFACE_ID = CLASS_ID::ASCII_CONVERTER; static const ReturnValue_t TOO_LONG_FOR_TARGET_TYPE = MAKE_RETURN_CODE(1); diff --git a/src/fsfw/globalfunctions/DleEncoder.cpp b/src/fsfw/globalfunctions/DleEncoder.cpp index 23caf02a..c93b37c3 100644 --- a/src/fsfw/globalfunctions/DleEncoder.cpp +++ b/src/fsfw/globalfunctions/DleEncoder.cpp @@ -73,7 +73,7 @@ ReturnValue_t DleEncoder::encodeStreamEscaped(const uint8_t *sourceStream, size_ ++encodedIndex; } *encodedLen = encodedIndex; - return RETURN_OK; + return returnvalue::OK; } else { return STREAM_TOO_SHORT; } @@ -119,7 +119,7 @@ ReturnValue_t DleEncoder::encodeStreamNonEscaped(const uint8_t *sourceStream, si destStream[encodedIndex++] = ETX_CHAR; } *encodedLen = encodedIndex; - return RETURN_OK; + return returnvalue::OK; } else { return STREAM_TOO_SHORT; } @@ -191,7 +191,7 @@ ReturnValue_t DleEncoder::decodeStreamEscaped(const uint8_t *sourceStream, size_ case (ETX_CHAR): { *readLen = ++encodedIndex; *decodedLen = decodedIndex; - return RETURN_OK; + return returnvalue::OK; } default: { destStream[decodedIndex] = sourceStream[encodedIndex]; @@ -255,7 +255,7 @@ ReturnValue_t DleEncoder::decodeStreamNonEscaped(const uint8_t *sourceStream, // End of stream reached *readLen = encodedIndex + 2; *decodedLen = decodedIndex; - return RETURN_OK; + return returnvalue::OK; } else { *readLen = encodedIndex; return DECODING_ERROR; diff --git a/src/fsfw/globalfunctions/DleEncoder.h b/src/fsfw/globalfunctions/DleEncoder.h index 009c8656..a18527fb 100644 --- a/src/fsfw/globalfunctions/DleEncoder.h +++ b/src/fsfw/globalfunctions/DleEncoder.h @@ -30,7 +30,7 @@ * are escaped with DLE. If the receiver detects a DLE char, it needs to read the next char * to determine whether a start (STX) or end (ETX) of a frame has been detected. */ -class DleEncoder : public HasReturnvaluesIF { +class DleEncoder { public: /** * Create an encoder instance with the given configuration. diff --git a/src/fsfw/globalfunctions/Type.cpp b/src/fsfw/globalfunctions/Type.cpp index 71193673..42c6817e 100644 --- a/src/fsfw/globalfunctions/Type.cpp +++ b/src/fsfw/globalfunctions/Type.cpp @@ -52,12 +52,12 @@ ReturnValue_t Type::serialize(uint8_t** buffer, size_t* size, size_t maxSize, uint8_t ptc; uint8_t pfc; ReturnValue_t result = getPtcPfc(&ptc, &pfc); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&ptc, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -75,18 +75,18 @@ ReturnValue_t Type::deSerialize(const uint8_t** buffer, size_t* size, Endianness uint8_t ptc; uint8_t pfc; ReturnValue_t result = SerializeAdapter::deSerialize(&ptc, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&pfc, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } actualType = getActualType(ptc, pfc); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Type::getPtcPfc(uint8_t* ptc, uint8_t* pfc) const { @@ -124,9 +124,9 @@ ReturnValue_t Type::getPtcPfc(uint8_t* ptc, uint8_t* pfc) const { *pfc = 2; break; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } Type::ActualType_t Type::getActualType(uint8_t ptc, uint8_t pfc) { diff --git a/src/fsfw/globalfunctions/matching/MatchTree.h b/src/fsfw/globalfunctions/matching/MatchTree.h index ec98e22a..0c31cf2a 100644 --- a/src/fsfw/globalfunctions/matching/MatchTree.h +++ b/src/fsfw/globalfunctions/matching/MatchTree.h @@ -40,34 +40,34 @@ class MatchTree : public SerializeableMatcherIF, public BinaryTreecountRight(iter); ReturnValue_t result = SerializeAdapter::serialize(&count, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (iter == this->end()) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } result = iter->serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (maxDepth > 0) { MatchTree temp(iter.left(), maxDepth - 1); result = temp.serialize(buffer, size, maxSize, streamEndianness); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } iter = iter.right(); while (iter != this->end()) { result = iter->serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (maxDepth > 0) { MatchTree temp(iter.left(), maxDepth - 1); result = temp.serialize(buffer, size, maxSize, streamEndianness); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } iter = iter.right(); @@ -106,7 +106,7 @@ class MatchTree : public SerializeableMatcherIF, public BinaryTree, public BinaryTreeerase(position); - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; if (children.first != this->end()) { result = removeElementAndAllChildren(children.first); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (children.second != this->end()) { result = removeElementAndAllChildren(children.second); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } // Delete element itself. @@ -143,13 +143,13 @@ class MatchTree : public SerializeableMatcherIF, public BinaryTreeend()) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } // Delete everything from the AND branch. - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; if (position.left() != this->end()) { result = removeElementAndAllChildren(position.left()); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -176,7 +176,7 @@ class MatchTree : public SerializeableMatcherIF, public BinaryTree { SerializeIF::Endianness streamEndianness) const override { ReturnValue_t result = SerializeAdapter::serialize(&lowerBound, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&upperBound, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SerializeAdapter::serialize(&inverted, buffer, size, maxSize, streamEndianness); @@ -45,11 +45,11 @@ class RangeMatcher : public SerializeableMatcherIF { SerializeIF::Endianness streamEndianness) override { ReturnValue_t result = SerializeAdapter::deSerialize(&lowerBound, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&upperBound, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SerializeAdapter::deSerialize(&inverted, buffer, size, streamEndianness); diff --git a/src/fsfw/health/HealthHelper.cpp b/src/fsfw/health/HealthHelper.cpp index 0f51ddeb..bf1a92d2 100644 --- a/src/fsfw/health/HealthHelper.cpp +++ b/src/fsfw/health/HealthHelper.cpp @@ -11,13 +11,13 @@ ReturnValue_t HealthHelper::handleHealthCommand(CommandMessage* message) { switch (message->getCommand()) { case HealthMessage::HEALTH_SET: handleSetHealthCommand(message); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case HealthMessage::HEALTH_ANNOUNCE: { eventSender->forwardEvent(HasHealthIF::HEALTH_INFO, getHealth(), getHealth()); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -53,10 +53,10 @@ ReturnValue_t HealthHelper::initialize() { } ReturnValue_t result = healthTable->registerObject(objectId, HasHealthIF::HEALTHY); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void HealthHelper::setHealth(HasHealthIF::HealthState health) { @@ -76,7 +76,7 @@ void HealthHelper::informParent(HasHealthIF::HealthState health, CommandMessage information; HealthMessage::setHealthMessage(&information, HealthMessage::HEALTH_INFO, health, oldHealth); if (MessageQueueSenderIF::sendMessage(parentQueue, &information, owner->getCommandQueue()) != - HasReturnvaluesIF::RETURN_OK) { + returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::debug << "HealthHelper::informParent: sending health reply failed." << std::endl; #endif @@ -89,13 +89,13 @@ void HealthHelper::handleSetHealthCommand(CommandMessage* command) { return; } CommandMessage reply; - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { HealthMessage::setHealthMessage(&reply, HealthMessage::REPLY_HEALTH_SET); } else { reply.setReplyRejected(result, command->getCommand()); } if (MessageQueueSenderIF::sendMessage(command->getSender(), &reply, owner->getCommandQueue()) != - HasReturnvaluesIF::RETURN_OK) { + returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::debug << "HealthHelper::handleHealthCommand: sending health " "reply failed." diff --git a/src/fsfw/health/HealthHelper.h b/src/fsfw/health/HealthHelper.h index 9b3b0e2b..0b9a9c78 100644 --- a/src/fsfw/health/HealthHelper.h +++ b/src/fsfw/health/HealthHelper.h @@ -56,7 +56,7 @@ class HealthHelper { * @param message * @return * -@c RETURN_OK if the message was handled - * -@c RETURN_FAILED if the message could not be handled + * -@c returnvalue::FAILED if the message could not be handled * (ie it was not a @c HEALTH_SET or @c HEALTH_READ message) */ ReturnValue_t handleHealthCommand(CommandMessage* message); @@ -90,7 +90,7 @@ class HealthHelper { * @return * -@c RETURN_OK if the Health Table was found and the object * could be registered - * -@c RETURN_FAILED else + * -@c returnvalue::FAILED else */ ReturnValue_t initialize(MessageQueueId_t parentQueue); diff --git a/src/fsfw/health/HealthTable.cpp b/src/fsfw/health/HealthTable.cpp index f4bda1c3..5fb45fb9 100644 --- a/src/fsfw/health/HealthTable.cpp +++ b/src/fsfw/health/HealthTable.cpp @@ -21,19 +21,19 @@ HealthTable::~HealthTable() { MutexFactory::instance()->deleteMutex(mutex); } ReturnValue_t HealthTable::registerObject(object_id_t object, HasHealthIF::HealthState initilialState) { if (healthMap.count(object) != 0) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } healthMap.emplace(object, initilialState); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t HealthTable::removeObject(object_id_t object) { mapIterator = healthMap.find(object); if (mapIterator == healthMap.end()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } healthMap.erase(mapIterator); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void HealthTable::setHealth(object_id_t object, HasHealthIF::HealthState newState) { @@ -76,7 +76,7 @@ void HealthTable::printAll(uint8_t* pointer, size_t maxSize) { uint16_t count = healthMap.size(); ReturnValue_t result = SerializeAdapter::serialize(&count, &pointer, &size, maxSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "HealthTable::printAll: Serialization of health table failed" << std::endl; @@ -89,26 +89,26 @@ void HealthTable::printAll(uint8_t* pointer, size_t maxSize) { for (const auto& health : healthMap) { result = SerializeAdapter::serialize(&health.first, &pointer, &size, maxSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } uint8_t healthValue = health.second; result = SerializeAdapter::serialize(&healthValue, &pointer, &size, maxSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } } } ReturnValue_t HealthTable::iterate(HealthEntry* value, bool reset) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; MutexGuard(mutex, timeoutType, mutexTimeoutMs); if (reset) { mapIterator = healthMap.begin(); } if (mapIterator == healthMap.end()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *value = *mapIterator; mapIterator++; diff --git a/src/fsfw/housekeeping/HousekeepingSetPacket.h b/src/fsfw/housekeeping/HousekeepingSetPacket.h index 96eaaed9..fa039da8 100644 --- a/src/fsfw/housekeeping/HousekeepingSetPacket.h +++ b/src/fsfw/housekeeping/HousekeepingSetPacket.h @@ -22,7 +22,7 @@ class HousekeepingSetPacket : public SerialLinkedListAdapter { Endianness streamEndianness) const override { ReturnValue_t result = SerialLinkedListAdapter::serialize(buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return dataSet->serializeLocalPoolIds(buffer, size, maxSize, streamEndianness); @@ -36,7 +36,7 @@ class HousekeepingSetPacket : public SerialLinkedListAdapter { ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) override { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } private: diff --git a/src/fsfw/housekeeping/HousekeepingSnapshot.h b/src/fsfw/housekeeping/HousekeepingSnapshot.h index c3eabe80..fe9d3617 100644 --- a/src/fsfw/housekeeping/HousekeepingSnapshot.h +++ b/src/fsfw/housekeeping/HousekeepingSnapshot.h @@ -64,7 +64,7 @@ class HousekeepingSnapshot : public SerializeIF { *buffer += timeStampSize; } if (updateData == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return updateData->serialize(buffer, size, maxSize, streamEndianness); @@ -92,7 +92,7 @@ class HousekeepingSnapshot : public SerializeIF { } if (updateData == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (*size < updateData->getSerializedSize()) { return SerializeIF::STREAM_TOO_SHORT; diff --git a/src/fsfw/internalerror/InternalErrorReporter.cpp b/src/fsfw/internalerror/InternalErrorReporter.cpp index fa16ec3f..d0af62d8 100644 --- a/src/fsfw/internalerror/InternalErrorReporter.cpp +++ b/src/fsfw/internalerror/InternalErrorReporter.cpp @@ -52,7 +52,7 @@ ReturnValue_t InternalErrorReporter::performOperation(uint8_t opCode) { { PoolReadGuard readGuard(&internalErrorDataset); - if (readGuard.getReadResult() == HasReturnvaluesIF::RETURN_OK) { + if (readGuard.getReadResult() == returnvalue::OK) { internalErrorDataset.queueHits.value += newQueueHits; internalErrorDataset.storeHits.value += newStoreHits; internalErrorDataset.tmHits.value += newTmHits; @@ -64,7 +64,7 @@ ReturnValue_t InternalErrorReporter::performOperation(uint8_t opCode) { } poolManager.performHkOperation(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void InternalErrorReporter::queueMessageNotSent() { incrementQueueHits(); } @@ -132,7 +132,7 @@ ReturnValue_t InternalErrorReporter::initializeLocalDataPool(localpool::DataPool poolManager.subscribeForPeriodicPacket(internalErrorSid, false, getPeriodicOperationFrequency(), true); internalErrorDataset.setValidity(true, true); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } dur_millis_t InternalErrorReporter::getPeriodicOperationFrequency() const { @@ -147,7 +147,7 @@ void InternalErrorReporter::setTaskIF(PeriodicTaskIF *task) { this->executingTas ReturnValue_t InternalErrorReporter::initialize() { ReturnValue_t result = poolManager.initialize(commandQueue); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SystemObject::initialize(); diff --git a/src/fsfw/ipc/MutexGuard.h b/src/fsfw/ipc/MutexGuard.h index f7b90663..f6d2f25f 100644 --- a/src/fsfw/ipc/MutexGuard.h +++ b/src/fsfw/ipc/MutexGuard.h @@ -30,7 +30,7 @@ class MutexGuard { timeoutMs); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - } else if (result != HasReturnvaluesIF::RETURN_OK) { + } else if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "MutexGuard: Lock of Mutex failed with code " << result << std::endl; #else @@ -51,7 +51,7 @@ class MutexGuard { private: MutexIF* internalMutex; - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; }; #endif /* FRAMEWORK_IPC_MUTEXGUARD_H_ */ diff --git a/src/fsfw/memory/GenericFileSystemMessage.cpp b/src/fsfw/memory/GenericFileSystemMessage.cpp index 805c7dcc..cdbfeb62 100644 --- a/src/fsfw/memory/GenericFileSystemMessage.cpp +++ b/src/fsfw/memory/GenericFileSystemMessage.cpp @@ -157,10 +157,10 @@ ReturnValue_t GenericFileSystemMessage::clear(CommandMessage *message) { store_address_t storeId = GenericFileSystemMessage::getStoreId(message); auto ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); if (ipcStore == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return ipcStore->deleteData(storeId); } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/memory/HasMemoryIF.h b/src/fsfw/memory/HasMemoryIF.h index 7aa66377..342f7115 100644 --- a/src/fsfw/memory/HasMemoryIF.h +++ b/src/fsfw/memory/HasMemoryIF.h @@ -31,14 +31,14 @@ class HasMemoryIF { * startAddress is a proposal for an address, or the base address if multiple addresses are set. */ virtual ReturnValue_t setAddress(uint32_t* startAddress) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } static bool memAccessWasSuccessful(ReturnValue_t result) { switch (result) { case DO_IT_MYSELF: case POINTS_TO_MEMORY: case POINTS_TO_VARIABLE: - case HasReturnvaluesIF::RETURN_OK: + case returnvalue::OK: case ACTIVITY_COMPLETED: return true; default: diff --git a/src/fsfw/memory/MemoryHelper.cpp b/src/fsfw/memory/MemoryHelper.cpp index 462a818e..cf4d205d 100644 --- a/src/fsfw/memory/MemoryHelper.cpp +++ b/src/fsfw/memory/MemoryHelper.cpp @@ -24,13 +24,13 @@ ReturnValue_t MemoryHelper::handleMemoryCommand(CommandMessage* message) { switch (lastCommand) { case MemoryMessage::CMD_MEMORY_DUMP: handleMemoryCheckOrDump(message); - return RETURN_OK; + return returnvalue::OK; case MemoryMessage::CMD_MEMORY_LOAD: handleMemoryLoad(message); - return RETURN_OK; + return returnvalue::OK; case MemoryMessage::CMD_MEMORY_CHECK: handleMemoryCheckOrDump(message); - return RETURN_OK; + return returnvalue::OK; default: lastCommand = CommandMessage::CMD_NONE; return UNKNOWN_CMD; @@ -51,7 +51,7 @@ void MemoryHelper::completeLoad(ReturnValue_t errorCode, const uint8_t* dataToCo EndianConverter::convertBigEndian(copyHere, dataToCopy, size); break; case HasMemoryIF::ACTIVITY_COMPLETED: - case RETURN_OK: + case returnvalue::OK: break; default: ipcStore->deleteData(ipcAddress); @@ -75,7 +75,7 @@ void MemoryHelper::completeDump(ReturnValue_t errorCode, const uint8_t* dataToCo case HasMemoryIF::DO_IT_MYSELF: busy = true; return; - case HasReturnvaluesIF::RETURN_OK: + case returnvalue::OK: case HasMemoryIF::POINTS_TO_MEMORY: case HasMemoryIF::POINTS_TO_VARIABLE: //"data" must be valid pointer! @@ -118,7 +118,7 @@ void MemoryHelper::completeDump(ReturnValue_t errorCode, const uint8_t* dataToCo ipcStore->deleteData(ipcAddress); break; } - if (queueToUse->sendMessage(lastSender, &reply) != RETURN_OK) { + if (queueToUse->sendMessage(lastSender, &reply) != returnvalue::OK) { reply.clear(); } } @@ -148,7 +148,7 @@ void MemoryHelper::handleMemoryLoad(CommandMessage* message) { uint8_t* dataPointer = NULL; size_t size = 0; ReturnValue_t returnCode = ipcStore->getData(ipcAddress, &p_data, &size); - if (returnCode == RETURN_OK) { + if (returnCode == returnvalue::OK) { returnCode = workOnThis->handleMemoryLoad(address, p_data, size, &dataPointer); completeLoad(returnCode, p_data, size, dataPointer); } else { @@ -164,7 +164,7 @@ void MemoryHelper::handleMemoryCheckOrDump(CommandMessage* message) { uint32_t size = MemoryMessage::getLength(message); uint8_t* dataPointer = NULL; ReturnValue_t returnCode = ipcStore->getFreeElement(&ipcAddress, size, &reservedSpaceInIPC); - if (returnCode == RETURN_OK) { + if (returnCode == returnvalue::OK) { returnCode = workOnThis->handleMemoryDump(address, size, &dataPointer, reservedSpaceInIPC); completeDump(returnCode, dataPointer, size); } else { @@ -176,7 +176,7 @@ void MemoryHelper::handleMemoryCheckOrDump(CommandMessage* message) { ReturnValue_t MemoryHelper::initialize(MessageQueueIF* queueToUse_) { if (queueToUse_ == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } this->queueToUse = queueToUse_; return initialize(); @@ -185,8 +185,8 @@ ReturnValue_t MemoryHelper::initialize(MessageQueueIF* queueToUse_) { ReturnValue_t MemoryHelper::initialize() { ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); if (ipcStore != nullptr) { - return RETURN_OK; + return returnvalue::OK; } else { - return RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/memory/MemoryHelper.h b/src/fsfw/memory/MemoryHelper.h index 7a645b79..3a51f7dc 100644 --- a/src/fsfw/memory/MemoryHelper.h +++ b/src/fsfw/memory/MemoryHelper.h @@ -10,7 +10,7 @@ /** * @brief TODO: documentation. */ -class MemoryHelper : public HasReturnvaluesIF { +class MemoryHelper { public: static const uint8_t INTERFACE_ID = CLASS_ID::MEMORY_HELPER; static const ReturnValue_t UNKNOWN_CMD = MAKE_RETURN_CODE(0xE0); diff --git a/src/fsfw/modes/HasModesIF.h b/src/fsfw/modes/HasModesIF.h index 0ebe77d8..03cc45bf 100644 --- a/src/fsfw/modes/HasModesIF.h +++ b/src/fsfw/modes/HasModesIF.h @@ -53,7 +53,7 @@ class HasModesIF { protected: virtual ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t *msToReachTheMode) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } virtual void startTransition(Mode_t mode, Submode_t submode) {} diff --git a/src/fsfw/modes/ModeHelper.cpp b/src/fsfw/modes/ModeHelper.cpp index 2ea392ab..8c83012f 100644 --- a/src/fsfw/modes/ModeHelper.cpp +++ b/src/fsfw/modes/ModeHelper.cpp @@ -25,7 +25,7 @@ ReturnValue_t ModeHelper::handleModeCommand(CommandMessage* command) { submode = ModeMessage::getSubmode(command); uint32_t timeout; ReturnValue_t result = owner->checkModeCommand(mode, submode, &timeout); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { ModeMessage::setCantReachMode(&reply, result); MessageQueueSenderIF::sendMessage(command->getSender(), &reply, owner->getCommandQueue()); break; @@ -55,9 +55,9 @@ ReturnValue_t ModeHelper::handleModeCommand(CommandMessage* command) { owner->announceMode(true); break; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t ModeHelper::initialize(MessageQueueId_t parentQueueId) { @@ -99,7 +99,7 @@ void ModeHelper::setParentQueue(MessageQueueId_t parentQueueId) { this->parentQueueId = parentQueueId; } -ReturnValue_t ModeHelper::initialize(void) { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t ModeHelper::initialize(void) { return returnvalue::OK; } bool ModeHelper::isTimedOut() { return countdown.hasTimedOut(); } diff --git a/src/fsfw/monitoring/AbsLimitMonitor.h b/src/fsfw/monitoring/AbsLimitMonitor.h index c6400166..790808ee 100644 --- a/src/fsfw/monitoring/AbsLimitMonitor.h +++ b/src/fsfw/monitoring/AbsLimitMonitor.h @@ -29,7 +29,7 @@ class AbsLimitMonitor : public MonitorBase { return MonitoringIF::OUT_OF_RANGE; } } - return HasReturnvaluesIF::RETURN_OK; // We're not out of range. + return returnvalue::OK; // We're not out of range. } virtual ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId, @@ -49,7 +49,7 @@ class AbsLimitMonitor : public MonitorBase { default: return this->INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } bool isOutOfLimits() { if (this->oldState == MonitoringIF::OUT_OF_RANGE) { diff --git a/src/fsfw/monitoring/LimitMonitor.h b/src/fsfw/monitoring/LimitMonitor.h index 229f1dc2..4fe9ee39 100644 --- a/src/fsfw/monitoring/LimitMonitor.h +++ b/src/fsfw/monitoring/LimitMonitor.h @@ -32,7 +32,7 @@ class LimitMonitor : public MonitorBase { *crossedLimit = lowerLimit; return MonitoringIF::BELOW_LOW_LIMIT; } else { - return HasReturnvaluesIF::RETURN_OK; // Within limits. + return returnvalue::OK; // Within limits. } } @@ -55,7 +55,7 @@ class LimitMonitor : public MonitorBase { default: return this->INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } bool isOutOfLimits() { if (this->oldState == MonitoringIF::ABOVE_HIGH_LIMIT or diff --git a/src/fsfw/monitoring/LimitViolationReporter.cpp b/src/fsfw/monitoring/LimitViolationReporter.cpp index 43ecf4d3..ec6fa2e6 100644 --- a/src/fsfw/monitoring/LimitViolationReporter.cpp +++ b/src/fsfw/monitoring/LimitViolationReporter.cpp @@ -7,7 +7,7 @@ ReturnValue_t LimitViolationReporter::sendLimitViolationReport(const SerializeIF* data) { ReturnValue_t result = checkClassLoaded(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } store_address_t storeId; @@ -17,12 +17,12 @@ ReturnValue_t LimitViolationReporter::sendLimitViolationReport(const SerializeIF return MonitoringIF::INVALID_SIZE; } result = ipcStore->getFreeElement(&storeId, maxSize, &dataTarget); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } size_t size = 0; result = data->serialize(&dataTarget, &size, maxSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } CommandMessage report; @@ -42,10 +42,10 @@ ReturnValue_t LimitViolationReporter::checkClassLoaded() { if (ipcStore == nullptr) { ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); if (ipcStore == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } // Lazy initialization. diff --git a/src/fsfw/monitoring/MonitorBase.h b/src/fsfw/monitoring/MonitorBase.h index b2653d75..dd0792b2 100644 --- a/src/fsfw/monitoring/MonitorBase.h +++ b/src/fsfw/monitoring/MonitorBase.h @@ -36,7 +36,7 @@ class MonitorBase : public MonitorReporter { // 2. If returning from fetch != OK, parameter is invalid. // Report (if oldState is != invalidity). - if (validity != HasReturnvaluesIF::RETURN_OK) { + if (validity != returnvalue::OK) { this->monitorStateIs(validity, sample, 0); } else { // 3. Otherwise, check sample. @@ -56,14 +56,14 @@ class MonitorBase : public MonitorReporter { protected: virtual ReturnValue_t fetchSample(T* sample) { ReturnValue_t result = poolVariable.read(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (not poolVariable.isValid()) { return MonitoringIF::INVALID; } *sample = poolVariable.value; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } LocalPoolVariable poolVariable; diff --git a/src/fsfw/monitoring/MonitorReporter.h b/src/fsfw/monitoring/MonitorReporter.h index bcbaf26d..09c39222 100644 --- a/src/fsfw/monitoring/MonitorReporter.h +++ b/src/fsfw/monitoring/MonitorReporter.h @@ -70,7 +70,7 @@ class MonitorReporter : public HasParametersIF { default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } virtual ReturnValue_t setToUnchecked() { return setToState(MonitoringIF::UNCHECKED); } virtual ReturnValue_t setToInvalid() { return setToState(MonitoringIF::INVALID); } @@ -135,7 +135,7 @@ class MonitorReporter : public HasParametersIF { case MonitoringIF::UNCHECKED: case MonitoringIF::UNSELECTED: case MonitoringIF::INVALID: - case HasReturnvaluesIF::RETURN_OK: + case returnvalue::OK: break; default: EventManagerIF::triggerEvent(reportingId, MonitoringIF::MONITOR_CHANGED_STATE, state); @@ -159,7 +159,7 @@ class MonitorReporter : public HasParametersIF { LimitViolationReporter::sendLimitViolationReport(&report); oldState = state; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } }; diff --git a/src/fsfw/monitoring/TriplexMonitor.h b/src/fsfw/monitoring/TriplexMonitor.h index 1d9182aa..e007ea5f 100644 --- a/src/fsfw/monitoring/TriplexMonitor.h +++ b/src/fsfw/monitoring/TriplexMonitor.h @@ -49,7 +49,7 @@ class TriplexMonitor : public HasParametersIF { nAvailable++; } } - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; switch (nAvailable) { case 3: result = doTriplexMonitoring(); @@ -67,9 +67,9 @@ class TriplexMonitor : public HasParametersIF { ReturnValue_t initialize() { healthTable = ObjectManager::instance()->get(objects::HEALTH_TABLE); if (healthTable == NULL) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId, ParameterWrapper *parameterWrapper, @@ -84,7 +84,7 @@ class TriplexMonitor : public HasParametersIF { default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } protected: @@ -96,7 +96,7 @@ class TriplexMonitor : public HasParametersIF { HealthTableIF *healthTable; uint8_t domainId; ReturnValue_t doTriplexMonitoring() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; // Find middle value, by ordering indices uint8_t index[3] = {0, 1, 2}; if (values[index[0]].value > values[index[1]].value) { @@ -118,7 +118,7 @@ class TriplexMonitor : public HasParametersIF { if (values[index[2]] > (values[index[1]] + limit)) { EventManagerIF::triggerEvent(getRefereneceObject(index[2]), eventTripleCheck, HIGHEST_VALUE_OOL, 0); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { result = HIGHEST_VALUE_OOL; } else { result = BOTH_VALUES_OOL; @@ -142,7 +142,7 @@ class TriplexMonitor : public HasParametersIF { return DUPLEX_OOL; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } virtual bool checkObjectHealthState(uint8_t valueIndex) = 0; virtual object_id_t getRefereneceObject(uint8_t valueIndex) = 0; diff --git a/src/fsfw/monitoring/TwoValueLimitMonitor.h b/src/fsfw/monitoring/TwoValueLimitMonitor.h index 79b8c4bb..ad3f5c86 100644 --- a/src/fsfw/monitoring/TwoValueLimitMonitor.h +++ b/src/fsfw/monitoring/TwoValueLimitMonitor.h @@ -18,7 +18,7 @@ class TwoValueLimitMonitor : public LimitMonitor { ReturnValue_t doCheck(T lowSample, T highSample) { T crossedLimit; ReturnValue_t currentState = this->checkSample(lowSample, &crossedLimit); - if (currentState != HasReturnvaluesIF::RETURN_OK) { + if (currentState != returnvalue::OK) { return this->monitorStateIs(currentState, lowSample, crossedLimit); } currentState = this->checkSample(highSample, &crossedLimit); diff --git a/src/fsfw/objectmanager/ObjectManager.cpp b/src/fsfw/objectmanager/ObjectManager.cpp index 2017938a..7a32fcc6 100644 --- a/src/fsfw/objectmanager/ObjectManager.cpp +++ b/src/fsfw/objectmanager/ObjectManager.cpp @@ -36,7 +36,7 @@ ReturnValue_t ObjectManager::insert(object_id_t id, SystemObjectIF* object) { // sif::debug << "ObjectManager::insert: Object " << std::hex // << (int)id << std::dec << " inserted." << std::endl; #endif - return this->RETURN_OK; + return returnvalue::OK; } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "ObjectManager::insert: Object ID " << std::hex << static_cast(id) @@ -59,7 +59,7 @@ ReturnValue_t ObjectManager::remove(object_id_t id) { // sif::debug << "ObjectManager::removeObject: Object " << std::hex // << (int)id << std::dec << " removed." << std::endl; #endif - return RETURN_OK; + return returnvalue::OK; } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "ObjectManager::removeObject: Requested object " << std::hex << (int)id @@ -90,11 +90,11 @@ void ObjectManager::initialize() { return; } objectFactoryFunction(factoryArgs); - ReturnValue_t result = RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; uint32_t errorCount = 0; for (auto const& it : objectList) { result = it.second->initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 object_id_t var = it.first; sif::error << "ObjectManager::initialize: Object 0x" << std::hex << std::setw(8) @@ -116,7 +116,7 @@ void ObjectManager::initialize() { errorCount = 0; for (auto const& it : objectList) { result = it.second->checkObjectConnections(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "ObjectManager::ObjectManager: Object 0x" << std::hex << (int)it.first << " connection check failed with code 0x" << result << std::dec << std::endl; diff --git a/src/fsfw/objectmanager/ObjectManagerIF.h b/src/fsfw/objectmanager/ObjectManagerIF.h index 32a0942f..58ee9ab4 100644 --- a/src/fsfw/objectmanager/ObjectManagerIF.h +++ b/src/fsfw/objectmanager/ObjectManagerIF.h @@ -16,7 +16,7 @@ * @author Bastian Baetz * @ingroup system_objects */ -class ObjectManagerIF : public HasReturnvaluesIF { +class ObjectManagerIF { public: static constexpr uint8_t INTERFACE_ID = CLASS_ID::OBJECT_MANAGER_IF; static constexpr ReturnValue_t INSERTION_FAILED = MAKE_RETURN_CODE(1); diff --git a/src/fsfw/objectmanager/SystemObject.cpp b/src/fsfw/objectmanager/SystemObject.cpp index 7f8acfd8..90839013 100644 --- a/src/fsfw/objectmanager/SystemObject.cpp +++ b/src/fsfw/objectmanager/SystemObject.cpp @@ -22,9 +22,9 @@ void SystemObject::triggerEvent(Event event, uint32_t parameter1, uint32_t param EventManagerIF::triggerEvent(objectId, event, parameter1, parameter2); } -ReturnValue_t SystemObject::initialize() { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t SystemObject::initialize() { return returnvalue::OK; } -ReturnValue_t SystemObject::checkObjectConnections() { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t SystemObject::checkObjectConnections() { return returnvalue::OK; } void SystemObject::forwardEvent(Event event, uint32_t parameter1, uint32_t parameter2) const { EventManagerIF::triggerEvent(objectId, event, parameter1, parameter2); diff --git a/src/fsfw/objectmanager/SystemObjectIF.h b/src/fsfw/objectmanager/SystemObjectIF.h index 72fe9044..660bf9e8 100644 --- a/src/fsfw/objectmanager/SystemObjectIF.h +++ b/src/fsfw/objectmanager/SystemObjectIF.h @@ -46,7 +46,7 @@ class SystemObjectIF : public EventReportingProxyIF { * Therefore, a two-step initialization resolves this problem and prevents * circular dependencies of not-fully initialized objects on start up. * @return - @c RETURN_OK in case the initialization was successful - * - @c RETURN_FAILED otherwise + * - @c returnvalue::FAILED otherwise */ virtual ReturnValue_t initialize() = 0; /** diff --git a/src/fsfw/osal/common/TcpIpBase.cpp b/src/fsfw/osal/common/TcpIpBase.cpp index 67e71053..7e989c36 100644 --- a/src/fsfw/osal/common/TcpIpBase.cpp +++ b/src/fsfw/osal/common/TcpIpBase.cpp @@ -21,10 +21,10 @@ ReturnValue_t TcpIpBase::initialize() { sif::error << "TmTcWinUdpBridge::TmTcWinUdpBridge: WSAStartup failed with error: " << err << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } #endif - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } TcpIpBase::~TcpIpBase() { diff --git a/src/fsfw/osal/common/TcpTmTcBridge.cpp b/src/fsfw/osal/common/TcpTmTcBridge.cpp index 4b2bea73..b57e48c0 100644 --- a/src/fsfw/osal/common/TcpTmTcBridge.cpp +++ b/src/fsfw/osal/common/TcpTmTcBridge.cpp @@ -26,7 +26,7 @@ TcpTmTcBridge::TcpTmTcBridge(object_id_t objectId, object_id_t tcDestination, ob ReturnValue_t TcpTmTcBridge::initialize() { ReturnValue_t result = TmTcBridge::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TcpTmTcBridge::initialize: TmTcBridge initialization failed!" << std::endl; #else @@ -35,7 +35,7 @@ ReturnValue_t TcpTmTcBridge::initialize() { return result; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } TcpTmTcBridge::~TcpTmTcBridge() { @@ -48,21 +48,21 @@ ReturnValue_t TcpTmTcBridge::handleTm() { // Simply store the telemetry in the FIFO, the server will use it to access the TM MutexGuard guard(mutex, timeoutType, mutexTimeoutMs); TmTcMessage message; - ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t status = returnvalue::OK; for (ReturnValue_t result = tmTcReceptionQueue->receiveMessage(&message); - result == HasReturnvaluesIF::RETURN_OK; + result == returnvalue::OK; result = tmTcReceptionQueue->receiveMessage(&message)) { status = storeDownlinkData(&message); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { break; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TcpTmTcBridge::sendTm(const uint8_t *data, size_t dataLen) { // Not used. The Server uses the FIFO to access and send the telemetry. - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TcpTmTcBridge::setMutexProperties(MutexIF::TimeoutType timeoutType, dur_millis_t timeoutMs) { diff --git a/src/fsfw/osal/common/TcpTmTcServer.cpp b/src/fsfw/osal/common/TcpTmTcServer.cpp index a8890006..f9cb923e 100644 --- a/src/fsfw/osal/common/TcpTmTcServer.cpp +++ b/src/fsfw/osal/common/TcpTmTcServer.cpp @@ -39,7 +39,7 @@ ReturnValue_t TcpTmTcServer::initialize() { using namespace tcpip; ReturnValue_t result = TcpIpBase::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -47,7 +47,7 @@ ReturnValue_t TcpTmTcServer::initialize() { case (ReceptionModes::SPACE_PACKETS): { spacePacketParser = new SpacePacketParser(validPacketIds); if (spacePacketParser == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } #if defined PLATFORM_UNIX tcpConfig.tcpFlags |= MSG_DONTWAIT; @@ -79,7 +79,7 @@ ReturnValue_t TcpTmTcServer::initialize() { retval = getaddrinfo(nullptr, tcpConfig.tcpPort.c_str(), &hints, &addrResult); if (retval != 0) { handleError(Protocol::TCP, ErrorSources::GETADDRINFO_CALL); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } // Open TCP (stream) socket @@ -88,7 +88,7 @@ ReturnValue_t TcpTmTcServer::initialize() { if (listenerTcpSocket == INVALID_SOCKET) { freeaddrinfo(addrResult); handleError(Protocol::TCP, ErrorSources::SOCKET_CALL); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } // Bind to the address found by getaddrinfo @@ -96,11 +96,11 @@ ReturnValue_t TcpTmTcServer::initialize() { if (retval == SOCKET_ERROR) { freeaddrinfo(addrResult); handleError(Protocol::TCP, ErrorSources::BIND_CALL); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } freeaddrinfo(addrResult); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } TcpTmTcServer::~TcpTmTcServer() { closeSocket(listenerTcpSocket); } @@ -151,7 +151,7 @@ ReturnValue_t TcpTmTcServer::initializeAfterTaskCreation() { targetTcDestination = tmtcBridge->getRequestQueue(); tcStore = tmtcBridge->tcStore; tmStore = tmtcBridge->tmStore; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TcpTmTcServer::handleServerOperation(socket_t& connSocket) { @@ -214,11 +214,11 @@ ReturnValue_t TcpTmTcServer::handleTcReception(uint8_t* spacePacket, size_t pack } if (spacePacket == nullptr or packetSize == 0) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } store_address_t storeId; ReturnValue_t result = tcStore->addData(&storeId, spacePacket, packetSize); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "TcpTmTcServer::handleServerOperation: Data storage with packet size" @@ -236,7 +236,7 @@ ReturnValue_t TcpTmTcServer::handleTcReception(uint8_t* spacePacket, size_t pack TmTcMessage message(storeId); result = MessageQueueSenderIF::sendMessage(targetTcDestination, &message); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "TcpTmTcServer::handleServerOperation: " @@ -273,7 +273,7 @@ ReturnValue_t TcpTmTcServer::handleTmSending(socket_t connSocket, bool& tmSent) // Using the store accessor will take care of deleting TM from the store automatically ConstStorageAccessor storeAccessor(storeId); ReturnValue_t result = tmStore->getData(storeId, storeAccessor); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (wiretappingEnabled) { @@ -297,12 +297,12 @@ ReturnValue_t TcpTmTcServer::handleTmSending(socket_t connSocket, bool& tmSent) return CONN_BROKEN; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TcpTmTcServer::handleTcRingBufferData(size_t availableReadData) { - ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t status = returnvalue::OK; + ReturnValue_t result = returnvalue::OK; size_t readAmount = availableReadData; lastRingBufferSize = availableReadData; if (readAmount >= ringBuffer.getMaxSize()) { @@ -341,7 +341,7 @@ ReturnValue_t TcpTmTcServer::handleTcRingBufferData(size_t availableReadData) { size_t readLen = 0; while (readLen < readAmount) { if (spacePacketParser == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } result = spacePacketParser->parseSpacePackets(bufPtrPtr, readAmount, startIdx, foundSize, readLen); @@ -350,9 +350,9 @@ ReturnValue_t TcpTmTcServer::handleTcRingBufferData(size_t availableReadData) { case (SpacePacketParser::SPLIT_PACKET): { break; } - case (HasReturnvaluesIF::RETURN_OK): { + case (returnvalue::OK): { result = handleTcReception(receptionBuffer.data() + startIdx, foundSize); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } } diff --git a/src/fsfw/osal/common/TcpTmTcServer.h b/src/fsfw/osal/common/TcpTmTcServer.h index 1181ff10..0e2182a5 100644 --- a/src/fsfw/osal/common/TcpTmTcServer.h +++ b/src/fsfw/osal/common/TcpTmTcServer.h @@ -108,7 +108,7 @@ class TcpTmTcServer : public SystemObject, public TcpIpBase, public ExecutableOb StorageManagerIF* tmStore = nullptr; private: - static constexpr ReturnValue_t CONN_BROKEN = result::makeCode(1, 0); + static constexpr ReturnValue_t CONN_BROKEN = returnvalue::makeCode(1, 0); //! TMTC bridge is cached. object_id_t tmtcBridgeId = objects::NO_OBJECT; TcpTmTcBridge* tmtcBridge = nullptr; diff --git a/src/fsfw/osal/common/UdpTcPollingTask.cpp b/src/fsfw/osal/common/UdpTcPollingTask.cpp index bcc8e9e3..4304fdd2 100644 --- a/src/fsfw/osal/common/UdpTcPollingTask.cpp +++ b/src/fsfw/osal/common/UdpTcPollingTask.cpp @@ -66,7 +66,7 @@ UdpTcPollingTask::UdpTcPollingTask(object_id_t objectId, object_id_t tmtcUdpBrid #endif /* FSFW_UDP_RCV_WIRETAPPING_ENABLED == 1 */ ReturnValue_t result = handleSuccessfullTcRead(bytesReceived); - if (result != HasReturnvaluesIF::RETURN_FAILED) { + if (result != returnvalue::FAILED) { } tmtcBridge->checkAndSetClientAddress(senderAddress); } @@ -80,20 +80,20 @@ ReturnValue_t UdpTcPollingTask::handleSuccessfullTcRead(size_t bytesRead) { #endif ReturnValue_t result = tcStore->addData(&storeId, receptionBuffer.data(), bytesRead); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "UdpTcPollingTask::transferPusToSoftwareBus: Data storage failed." << std::endl; sif::warning << "Packet size: " << bytesRead << std::endl; #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_VERBOSE_LEVEL >= 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } TmTcMessage message(storeId); result = MessageQueueSenderIF::sendMessage(targetTcDestination, &message); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "UdpTcPollingTask::handleSuccessfullTcRead: " @@ -124,11 +124,11 @@ ReturnValue_t UdpTcPollingTask::initialize() { } ReturnValue_t result = TcpIpBase::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t UdpTcPollingTask::initializeAfterTaskCreation() { @@ -138,7 +138,7 @@ ReturnValue_t UdpTcPollingTask::initializeAfterTaskCreation() { /* The server socket is set up in the bridge intialization. Calling this function here ensures that it is set up regardless of which class was initialized first */ this->serverSocket = tmtcBridge->serverSocket; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void UdpTcPollingTask::setTimeout(double timeoutSeconds) { diff --git a/src/fsfw/osal/common/UdpTmTcBridge.cpp b/src/fsfw/osal/common/UdpTmTcBridge.cpp index e3cad58f..0a847271 100644 --- a/src/fsfw/osal/common/UdpTmTcBridge.cpp +++ b/src/fsfw/osal/common/UdpTmTcBridge.cpp @@ -35,7 +35,7 @@ UdpTmTcBridge::UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination, ReturnValue_t UdpTmTcBridge::initialize() { ReturnValue_t result = TmTcBridge::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "UdpTmTcBridge::initialize: TmTcBridge initialization failed!" << std::endl; #endif @@ -56,7 +56,7 @@ ReturnValue_t UdpTmTcBridge::initialize() { #else sif::printError("UdpTmTcBridge::UdpTmTcBridge: WSAStartup failed with error: %d\n", err); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } #endif @@ -75,14 +75,14 @@ ReturnValue_t UdpTmTcBridge::initialize() { int retval = getaddrinfo(nullptr, udpServerPort.c_str(), &hints, &addrResult); if (retval != 0) { tcpip::handleError(tcpip::Protocol::UDP, tcpip::ErrorSources::GETADDRINFO_CALL); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } serverSocket = socket(addrResult->ai_family, addrResult->ai_socktype, addrResult->ai_protocol); if (serverSocket == INVALID_SOCKET) { freeaddrinfo(addrResult); tcpip::handleError(tcpip::Protocol::UDP, tcpip::ErrorSources::SOCKET_CALL); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } #if FSFW_UDP_SEND_WIRETAPPING_ENABLED == 1 @@ -93,10 +93,10 @@ ReturnValue_t UdpTmTcBridge::initialize() { if (retval != 0) { freeaddrinfo(addrResult); tcpip::handleError(tcpip::Protocol::UDP, tcpip::ErrorSources::BIND_CALL); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } freeaddrinfo(addrResult); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } UdpTmTcBridge::~UdpTmTcBridge() { @@ -131,7 +131,7 @@ ReturnValue_t UdpTmTcBridge::sendTm(const uint8_t *data, size_t dataLen) { " sent." << std::endl; #endif - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void UdpTmTcBridge::checkAndSetClientAddress(sockaddr &newAddress) { diff --git a/src/fsfw/osal/freertos/BinSemaphUsingTask.cpp b/src/fsfw/osal/freertos/BinSemaphUsingTask.cpp index 7ffd61d3..54226e18 100644 --- a/src/fsfw/osal/freertos/BinSemaphUsingTask.cpp +++ b/src/fsfw/osal/freertos/BinSemaphUsingTask.cpp @@ -42,7 +42,7 @@ ReturnValue_t BinarySemaphoreUsingTask::acquireWithTickTimeout(TimeoutType timeo TickType_t timeoutTicks) { BaseType_t returncode = ulTaskNotifyTake(pdTRUE, timeoutTicks); if (returncode == pdPASS) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return SemaphoreIF::SEMAPHORE_TIMEOUT; } @@ -56,10 +56,10 @@ ReturnValue_t BinarySemaphoreUsingTask::release(TaskHandle_t taskHandle) { } BaseType_t returncode = xTaskNotifyGive(taskHandle); if (returncode == pdPASS) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { // This should never happen. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -82,7 +82,7 @@ ReturnValue_t BinarySemaphoreUsingTask::releaseFromISR(TaskHandle_t taskHandle, return SemaphoreIF::SEMAPHORE_NOT_OWNED; } vTaskNotifyGiveFromISR(taskHandle, higherPriorityTaskWoken); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } uint8_t BinarySemaphoreUsingTask::getSemaphoreCounterFromISR(TaskHandle_t taskHandle, diff --git a/src/fsfw/osal/freertos/BinSemaphUsingTask.h b/src/fsfw/osal/freertos/BinSemaphUsingTask.h index 34b0d031..a88863c9 100644 --- a/src/fsfw/osal/freertos/BinSemaphUsingTask.h +++ b/src/fsfw/osal/freertos/BinSemaphUsingTask.h @@ -51,7 +51,7 @@ class BinarySemaphoreUsingTask : public SemaphoreIF, public HasReturnvaluesIF { * Same as acquire() with timeout in FreeRTOS ticks. * @param timeoutTicks * @return - @c RETURN_OK on success - * - @c RETURN_FAILED on failure + * - @c returnvalue::FAILED on failure */ ReturnValue_t acquireWithTickTimeout(TimeoutType timeoutType = TimeoutType::BLOCKING, TickType_t timeoutTicks = portMAX_DELAY); @@ -66,7 +66,7 @@ class BinarySemaphoreUsingTask : public SemaphoreIF, public HasReturnvaluesIF { * Wrapper function to give back semaphore from handle * @param semaphore * @return - @c RETURN_OK on success - * - @c RETURN_FAILED on failure + * - @c returnvalue::FAILED on failure */ static ReturnValue_t release(TaskHandle_t taskToNotify); @@ -77,7 +77,7 @@ class BinarySemaphoreUsingTask : public SemaphoreIF, public HasReturnvaluesIF { * a higher priority was unblocked. A context switch should be requested * from an ISR if this is the case (see TaskManagement functions) * @return - @c RETURN_OK on success - * - @c RETURN_FAILED on failure + * - @c returnvalue::FAILED on failure */ static ReturnValue_t releaseFromISR(TaskHandle_t taskToNotify, BaseType_t* higherPriorityTaskWoken); diff --git a/src/fsfw/osal/freertos/BinarySemaphore.cpp b/src/fsfw/osal/freertos/BinarySemaphore.cpp index 6e53380c..0ab621bc 100644 --- a/src/fsfw/osal/freertos/BinarySemaphore.cpp +++ b/src/fsfw/osal/freertos/BinarySemaphore.cpp @@ -59,7 +59,7 @@ ReturnValue_t BinarySemaphore::acquireWithTickTimeout(TimeoutType timeoutType, BaseType_t returncode = xSemaphoreTake(handle, timeoutTicks); if (returncode == pdPASS) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return SemaphoreIF::SEMAPHORE_TIMEOUT; } @@ -73,7 +73,7 @@ ReturnValue_t BinarySemaphore::release(SemaphoreHandle_t semaphore) { } BaseType_t returncode = xSemaphoreGive(semaphore); if (returncode == pdPASS) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return SemaphoreIF::SEMAPHORE_NOT_OWNED; } @@ -91,7 +91,7 @@ ReturnValue_t BinarySemaphore::releaseFromISR(SemaphoreHandle_t semaphore, } BaseType_t returncode = xSemaphoreGiveFromISR(semaphore, higherPriorityTaskWoken); if (returncode == pdPASS) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return SemaphoreIF::SEMAPHORE_NOT_OWNED; } diff --git a/src/fsfw/osal/freertos/Clock.cpp b/src/fsfw/osal/freertos/Clock.cpp index cabf7d81..dc00ac7e 100644 --- a/src/fsfw/osal/freertos/Clock.cpp +++ b/src/fsfw/osal/freertos/Clock.cpp @@ -17,7 +17,7 @@ ReturnValue_t Clock::setClock(const TimeOfDay_t* time) { timeval time_timeval; ReturnValue_t result = convertTimeOfDayToTimeval(time, &time_timeval); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -31,7 +31,7 @@ ReturnValue_t Clock::setClock(const timeval* time) { Timekeeper::instance()->setOffset(offset); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getClock_timeval(timeval* time) { @@ -41,13 +41,13 @@ ReturnValue_t Clock::getClock_timeval(timeval* time) { *time = offset + uptime; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getUptime(timeval* uptime) { *uptime = getUptime(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } timeval Clock::getUptime() { @@ -58,7 +58,7 @@ timeval Clock::getUptime() { ReturnValue_t Clock::getUptime(uint32_t* uptimeMs) { timeval uptime = getUptime(); *uptimeMs = uptime.tv_sec * 1000 + uptime.tv_usec / 1000; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } // uint32_t Clock::getUptimeSeconds() { @@ -69,17 +69,17 @@ ReturnValue_t Clock::getUptime(uint32_t* uptimeMs) { ReturnValue_t Clock::getClock_usecs(uint64_t* time) { timeval time_timeval; ReturnValue_t result = getClock_timeval(&time_timeval); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } *time = time_timeval.tv_sec * 1000000 + time_timeval.tv_usec; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { timeval time_timeval; ReturnValue_t result = getClock_timeval(&time_timeval); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } struct tm time_tm; @@ -96,7 +96,7 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { time->usecond = time_timeval.tv_usec; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* to) { @@ -115,10 +115,10 @@ ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* to->tv_sec = seconds; to->tv_usec = from->usecond; // Fails in 2038.. - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::convertTimevalToJD2000(timeval time, double* JD2000) { *JD2000 = (time.tv_sec - 946728000. + time.tv_usec / 1000000.) / 24. / 3600.; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/osal/freertos/CountingSemaphUsingTask.cpp b/src/fsfw/osal/freertos/CountingSemaphUsingTask.cpp index 0e4d967d..f58e1be9 100644 --- a/src/fsfw/osal/freertos/CountingSemaphUsingTask.cpp +++ b/src/fsfw/osal/freertos/CountingSemaphUsingTask.cpp @@ -65,7 +65,7 @@ ReturnValue_t CountingSemaphoreUsingTask::acquireWithTickTimeout(TimeoutType tim // Decrement notfication value without resetting it. BaseType_t oldCount = ulTaskNotifyTake(pdFALSE, timeoutTicks); if (getSemaphoreCounter() == oldCount - 1) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return SemaphoreIF::SEMAPHORE_TIMEOUT; } @@ -81,10 +81,10 @@ ReturnValue_t CountingSemaphoreUsingTask::release() { ReturnValue_t CountingSemaphoreUsingTask::release(TaskHandle_t taskToNotify) { BaseType_t returncode = xTaskNotifyGive(taskToNotify); if (returncode == pdPASS) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { // This should never happen. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -99,7 +99,7 @@ TaskHandle_t CountingSemaphoreUsingTask::getTaskHandle() { return handle; } ReturnValue_t CountingSemaphoreUsingTask::releaseFromISR(TaskHandle_t taskToNotify, BaseType_t* higherPriorityTaskWoken) { vTaskNotifyGiveFromISR(taskToNotify, higherPriorityTaskWoken); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } uint8_t CountingSemaphoreUsingTask::getSemaphoreCounterFromISR( diff --git a/src/fsfw/osal/freertos/FixedTimeslotTask.cpp b/src/fsfw/osal/freertos/FixedTimeslotTask.cpp index e86636ab..a0a4ecee 100644 --- a/src/fsfw/osal/freertos/FixedTimeslotTask.cpp +++ b/src/fsfw/osal/freertos/FixedTimeslotTask.cpp @@ -48,7 +48,7 @@ ReturnValue_t FixedTimeslotTask::startTask() { vTaskResume(handle); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } [[noreturn]] void FixedTimeslotTask::taskFunctionality() { @@ -108,7 +108,7 @@ void FixedTimeslotTask::handleMissedDeadline() { ReturnValue_t FixedTimeslotTask::sleepFor(uint32_t ms) { vTaskDelay(pdMS_TO_TICKS(ms)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } TaskHandle_t FixedTimeslotTask::getTaskHandle() { return handle; } diff --git a/src/fsfw/osal/freertos/MessageQueue.cpp b/src/fsfw/osal/freertos/MessageQueue.cpp index d1a7f691..e449ef1e 100644 --- a/src/fsfw/osal/freertos/MessageQueue.cpp +++ b/src/fsfw/osal/freertos/MessageQueue.cpp @@ -48,14 +48,14 @@ ReturnValue_t MessageQueue::handleSendResult(BaseType_t result, bool ignoreFault } return MessageQueueIF::FULL; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) { BaseType_t result = xQueueReceive(handle, reinterpret_cast(message->getBuffer()), 0); if (result == pdPASS) { this->last = message->getSender(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return MessageQueueIF::EMPTY; } @@ -65,7 +65,7 @@ ReturnValue_t MessageQueue::flush(uint32_t* count) { // TODO FreeRTOS does not support flushing partially // Is always successful xQueueReset(handle); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } // static core function to send messages. diff --git a/src/fsfw/osal/freertos/Mutex.cpp b/src/fsfw/osal/freertos/Mutex.cpp index 1995e1ea..6c264dd6 100644 --- a/src/fsfw/osal/freertos/Mutex.cpp +++ b/src/fsfw/osal/freertos/Mutex.cpp @@ -31,7 +31,7 @@ ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType, uint32_t timeoutMs) { BaseType_t returncode = xSemaphoreTake(handle, timeout); if (returncode == pdPASS) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return MutexIF::MUTEX_TIMEOUT; } @@ -43,7 +43,7 @@ ReturnValue_t Mutex::unlockMutex() { } BaseType_t returncode = xSemaphoreGive(handle); if (returncode == pdPASS) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return MutexIF::CURR_THREAD_DOES_NOT_OWN_MUTEX; } diff --git a/src/fsfw/osal/freertos/PeriodicTask.cpp b/src/fsfw/osal/freertos/PeriodicTask.cpp index 665be06c..2b6a94db 100644 --- a/src/fsfw/osal/freertos/PeriodicTask.cpp +++ b/src/fsfw/osal/freertos/PeriodicTask.cpp @@ -55,12 +55,12 @@ ReturnValue_t PeriodicTask::startTask() { vTaskResume(handle); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t PeriodicTask::sleepFor(uint32_t ms) { vTaskDelay(pdMS_TO_TICKS(ms)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } [[noreturn]] void PeriodicTask::taskFunctionality() { diff --git a/src/fsfw/osal/freertos/QueueMapManager.cpp b/src/fsfw/osal/freertos/QueueMapManager.cpp index cb3afb1c..172d9dff 100644 --- a/src/fsfw/osal/freertos/QueueMapManager.cpp +++ b/src/fsfw/osal/freertos/QueueMapManager.cpp @@ -34,12 +34,12 @@ ReturnValue_t QueueMapManager::addMessageQueue(QueueHandle_t queue, MessageQueue "QueueMapManager::addMessageQueue This ID is already " "inside the map!\n"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (id != nullptr) { *id = currentId; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } QueueHandle_t QueueMapManager::getMessageQueue(MessageQueueId_t messageQueueId) const { diff --git a/src/fsfw/osal/freertos/TaskFactory.cpp b/src/fsfw/osal/freertos/TaskFactory.cpp index 7acd812f..c79a6cf1 100644 --- a/src/fsfw/osal/freertos/TaskFactory.cpp +++ b/src/fsfw/osal/freertos/TaskFactory.cpp @@ -31,16 +31,16 @@ ReturnValue_t TaskFactory::deleteTask(PeriodicTaskIF* task) { if (task == nullptr) { // delete self vTaskDelete(nullptr); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { // TODO not implemented - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } ReturnValue_t TaskFactory::delayTask(uint32_t delayMs) { vTaskDelay(pdMS_TO_TICKS(delayMs)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TaskFactory::printMissedDeadline() { diff --git a/src/fsfw/osal/host/Clock.cpp b/src/fsfw/osal/host/Clock.cpp index 19e120b3..8b6fc904 100644 --- a/src/fsfw/osal/host/Clock.cpp +++ b/src/fsfw/osal/host/Clock.cpp @@ -32,7 +32,7 @@ ReturnValue_t Clock::setClock(const TimeOfDay_t* time) { #else sif::printWarning("Clock::setClock: Not implemented for host OSAL\n"); #endif - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::setClock(const timeval* time) { @@ -43,7 +43,7 @@ ReturnValue_t Clock::setClock(const timeval* time) { #else sif::printWarning("Clock::setClock: Not implemented for host OSAL\n"); #endif - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getClock_timeval(timeval* time) { @@ -54,33 +54,33 @@ ReturnValue_t Clock::getClock_timeval(timeval* time) { time->tv_sec = std::chrono::duration_cast(epoch).count(); auto fraction = now - secondsChrono; time->tv_usec = std::chrono::duration_cast(fraction).count(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; #elif defined(PLATFORM_UNIX) timespec timeUnix; int status = clock_gettime(CLOCK_REALTIME, &timeUnix); if (status != 0) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } time->tv_sec = timeUnix.tv_sec; time->tv_usec = timeUnix.tv_nsec / 1000.0; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; #else #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "Clock::getUptime: Not implemented for found OS!" << std::endl; #else sif::printWarning("Clock::getUptime: Not implemented for found OS!\n"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; #endif } ReturnValue_t Clock::getClock_usecs(uint64_t* time) { if (time == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } using namespace std::chrono; *time = duration_cast(system_clock::now().time_since_epoch()).count(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } timeval Clock::getUptime() { @@ -108,13 +108,13 @@ timeval Clock::getUptime() { ReturnValue_t Clock::getUptime(timeval* uptime) { *uptime = getUptime(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getUptime(uint32_t* uptimeMs) { timeval uptime = getUptime(); *uptimeMs = uptime.tv_sec * 1000 + uptime.tv_usec / 1000; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { @@ -126,7 +126,7 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { auto fraction = now - seconds; time_t tt = SystemClock::to_time_t(now); ReturnValue_t result = checkOrCreateClockMutex(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } MutexGuard helper(timeMutex); @@ -142,7 +142,7 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { time->second = timeInfo->tm_sec; auto usecond = std::chrono::duration_cast(fraction); time->usecond = usecond.count(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* to) { @@ -162,10 +162,10 @@ ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* to->tv_sec = seconds; to->tv_usec = from->usecond; // Fails in 2038.. - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::convertTimevalToJD2000(timeval time, double* JD2000) { *JD2000 = (time.tv_sec - 946728000. + time.tv_usec / 1000000.) / 24. / 3600.; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/osal/host/FixedTimeslotTask.cpp b/src/fsfw/osal/host/FixedTimeslotTask.cpp index 1d10b8d8..edb2d52d 100644 --- a/src/fsfw/osal/host/FixedTimeslotTask.cpp +++ b/src/fsfw/osal/host/FixedTimeslotTask.cpp @@ -66,12 +66,12 @@ ReturnValue_t FixedTimeslotTask::startTask() { std::lock_guard lock(initMutex); initCondition.notify_one(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t FixedTimeslotTask::sleepFor(uint32_t ms) { std::this_thread::sleep_for(std::chrono::milliseconds(ms)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void FixedTimeslotTask::taskFunctionality() { diff --git a/src/fsfw/osal/host/MessageQueue.cpp b/src/fsfw/osal/host/MessageQueue.cpp index d0a12850..ced30f09 100644 --- a/src/fsfw/osal/host/MessageQueue.cpp +++ b/src/fsfw/osal/host/MessageQueue.cpp @@ -14,7 +14,7 @@ MessageQueue::MessageQueue(size_t messageDepth, size_t maxMessageSize, MqArgs* a messageDepth(messageDepth) { queueLock = MutexFactory::instance()->createMutex(); auto result = QueueMapManager::instance()->addMessageQueue(this, &id); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "MessageQueue::MessageQueue: Could not be created" << std::endl; #else @@ -40,14 +40,14 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) { messageQueue.pop(); // The last partner is the first uint32_t field in the message this->last = message->getSender(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t MessageQueue::flush(uint32_t* count) { *count = messageQueue.size(); // Clears the queue. messageQueue = std::queue>(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } // static core function to send messages. @@ -56,14 +56,14 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo, MessageQueueId_t sentFrom, bool ignoreFault) { if (message == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } message->setSender(sentFrom); if (message->getMessageSize() > message->getMaximumMessageSize()) { // Actually, this should never happen or an error will be emitted // in MessageQueueMessage. // But I will still return a failure here. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } MessageQueue* targetQueue = dynamic_cast(QueueMapManager::instance()->getMessageQueue(sendTo)); @@ -92,7 +92,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo, } return MessageQueueIF::FULL; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t MessageQueue::lockQueue(MutexIF::TimeoutType timeoutType, dur_millis_t lockTimeout) { diff --git a/src/fsfw/osal/host/Mutex.cpp b/src/fsfw/osal/host/Mutex.cpp index 4b7a9582..2b67c7b5 100644 --- a/src/fsfw/osal/host/Mutex.cpp +++ b/src/fsfw/osal/host/Mutex.cpp @@ -7,15 +7,15 @@ Mutex::Mutex() {} ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType, uint32_t timeoutMs) { if (timeoutType == TimeoutType::BLOCKING) { mutex.lock(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else if (timeoutType == TimeoutType::POLLING) { if (mutex.try_lock()) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } else if (timeoutType == TimeoutType::WAITING) { auto chronoMs = std::chrono::milliseconds(timeoutMs); if (mutex.try_lock_for(chronoMs)) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } return MutexIF::MUTEX_TIMEOUT; @@ -23,7 +23,7 @@ ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType, uint32_t timeoutMs) { ReturnValue_t Mutex::unlockMutex() { mutex.unlock(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } std::timed_mutex* Mutex::getMutexHandle() { return &mutex; } diff --git a/src/fsfw/osal/host/PeriodicTask.cpp b/src/fsfw/osal/host/PeriodicTask.cpp index 1f18d335..e16aead0 100644 --- a/src/fsfw/osal/host/PeriodicTask.cpp +++ b/src/fsfw/osal/host/PeriodicTask.cpp @@ -63,12 +63,12 @@ ReturnValue_t PeriodicTask::startTask() { std::lock_guard lock(initMutex); initCondition.notify_one(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t PeriodicTask::sleepFor(uint32_t ms) { std::this_thread::sleep_for(std::chrono::milliseconds(ms)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void PeriodicTask::taskFunctionality() { diff --git a/src/fsfw/osal/host/QueueFactory.cpp b/src/fsfw/osal/host/QueueFactory.cpp index 732892ca..c6605656 100644 --- a/src/fsfw/osal/host/QueueFactory.cpp +++ b/src/fsfw/osal/host/QueueFactory.cpp @@ -13,7 +13,7 @@ ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo, MessageQueueMessageIF* message, MessageQueueId_t sentFrom, bool ignoreFault) { return MessageQueue::sendMessageFromMessageQueue(sendTo, message, sentFrom, ignoreFault); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } QueueFactory* QueueFactory::instance() { diff --git a/src/fsfw/osal/host/QueueMapManager.cpp b/src/fsfw/osal/host/QueueMapManager.cpp index 72c70baa..dc4eb1de 100644 --- a/src/fsfw/osal/host/QueueMapManager.cpp +++ b/src/fsfw/osal/host/QueueMapManager.cpp @@ -39,12 +39,12 @@ ReturnValue_t QueueMapManager::addMessageQueue(MessageQueueIF* queueToInsert, "QueueMapManager::addMessageQueue This ID is already " "inside the map!\n"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (id != nullptr) { *id = currentId; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } MessageQueueIF* QueueMapManager::getMessageQueue(MessageQueueId_t messageQueueId) const { diff --git a/src/fsfw/osal/host/TaskFactory.cpp b/src/fsfw/osal/host/TaskFactory.cpp index ec4c1554..e9415f5a 100644 --- a/src/fsfw/osal/host/TaskFactory.cpp +++ b/src/fsfw/osal/host/TaskFactory.cpp @@ -37,12 +37,12 @@ FixedTimeslotTaskIF* TaskFactory::createFixedTimeslotTask( ReturnValue_t TaskFactory::deleteTask(PeriodicTaskIF* task) { // This might block for some time! delete task; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t TaskFactory::delayTask(uint32_t delayMs) { std::this_thread::sleep_for(std::chrono::milliseconds(delayMs)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TaskFactory::printMissedDeadline() { diff --git a/src/fsfw/osal/host/taskHelpers.cpp b/src/fsfw/osal/host/taskHelpers.cpp index 432cf30c..e5a931ed 100644 --- a/src/fsfw/osal/host/taskHelpers.cpp +++ b/src/fsfw/osal/host/taskHelpers.cpp @@ -10,9 +10,9 @@ ReturnValue_t tasks::insertTaskName(std::thread::id threadId, const std::string& std::lock_guard lg(nameMapLock); auto returnPair = taskNameMap.emplace(threadId, taskName); if (not returnPair.second) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } std::string tasks::getTaskName(std::thread::id threadId) { diff --git a/src/fsfw/osal/linux/BinarySemaphore.cpp b/src/fsfw/osal/linux/BinarySemaphore.cpp index 4fb67f15..9b954d6c 100644 --- a/src/fsfw/osal/linux/BinarySemaphore.cpp +++ b/src/fsfw/osal/linux/BinarySemaphore.cpp @@ -43,7 +43,7 @@ ReturnValue_t BinarySemaphore::acquire(TimeoutType timeoutType, uint32_t timeout } } if (result == 0) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } switch (errno) { @@ -62,10 +62,10 @@ ReturnValue_t BinarySemaphore::acquire(TimeoutType timeoutType, uint32_t timeout case (EINTR): { // Call was interrupted by signal handler utility::printUnixErrorGeneric(CLASS_NAME, "acquire", "EINTR"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -73,13 +73,13 @@ ReturnValue_t BinarySemaphore::release() { return BinarySemaphore::release(&this ReturnValue_t BinarySemaphore::release(sem_t* handle) { ReturnValue_t countResult = checkCount(handle, 1); - if (countResult != HasReturnvaluesIF::RETURN_OK) { + if (countResult != returnvalue::OK) { return countResult; } int result = sem_post(handle); if (result == 0) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } switch (errno) { @@ -91,10 +91,10 @@ ReturnValue_t BinarySemaphore::release(sem_t* handle) { case (EOVERFLOW): { // SEM_MAX_VALUE overflow. This should never happen utility::printUnixErrorGeneric(CLASS_NAME, "release", "EOVERFLOW"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -145,9 +145,9 @@ ReturnValue_t BinarySemaphore::checkCount(sem_t* handle, uint8_t maxCount) { // This is a config error use lightweight printf is this is called // from an interrupt printf("BinarySemaphore::release: Value of binary semaphore greater than 1!\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return SemaphoreIF::SEMAPHORE_NOT_OWNED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/osal/linux/Clock.cpp b/src/fsfw/osal/linux/Clock.cpp index 534e7e22..2b914f75 100644 --- a/src/fsfw/osal/linux/Clock.cpp +++ b/src/fsfw/osal/linux/Clock.cpp @@ -26,9 +26,9 @@ ReturnValue_t Clock::setClock(const TimeOfDay_t* time) { int status = clock_settime(CLOCK_REALTIME, &timeUnix); if (status != 0) { // TODO errno - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::setClock(const timeval* time) { @@ -38,37 +38,37 @@ ReturnValue_t Clock::setClock(const timeval* time) { int status = clock_settime(CLOCK_REALTIME, &timeUnix); if (status != 0) { // TODO errno - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getClock_timeval(timeval* time) { timespec timeUnix; int status = clock_gettime(CLOCK_REALTIME, &timeUnix); if (status != 0) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } time->tv_sec = timeUnix.tv_sec; time->tv_usec = timeUnix.tv_nsec / 1000.0; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getClock_usecs(uint64_t* time) { timeval timeVal; ReturnValue_t result = getClock_timeval(&timeVal); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } *time = (uint64_t)timeVal.tv_sec * 1e6 + timeVal.tv_usec; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } timeval Clock::getUptime() { timeval uptime; auto result = getUptime(&uptime); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Clock::getUptime: Error getting uptime" << std::endl; #endif @@ -84,7 +84,7 @@ ReturnValue_t Clock::getUptime(timeval* uptime) { uptime->tv_sec = uptimeSeconds; uptime->tv_usec = uptimeSeconds * (double)1e6 - (uptime->tv_sec * 1e6); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } // Wait for new FSFW Clock function delivering seconds uptime. @@ -93,7 +93,7 @@ ReturnValue_t Clock::getUptime(timeval* uptime) { // struct sysinfo sysInfo; // int result = sysinfo(&sysInfo); // if(result != 0){ -// return HasReturnvaluesIF::RETURN_FAILED; +// return HasReturnvaluesIF::returnvalue::FAILED; // } // return sysInfo.uptime; //} @@ -101,11 +101,11 @@ ReturnValue_t Clock::getUptime(timeval* uptime) { ReturnValue_t Clock::getUptime(uint32_t* uptimeMs) { timeval uptime; ReturnValue_t result = getUptime(&uptime); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } *uptimeMs = uptime.tv_sec * 1e3 + uptime.tv_usec / 1e3; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { @@ -113,10 +113,10 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { int status = clock_gettime(CLOCK_REALTIME, &timeUnix); if (status != 0) { // TODO errno - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t result = checkOrCreateClockMutex(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } MutexGuard helper(timeMutex); @@ -132,7 +132,7 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { time->second = timeInfo->tm_sec; time->usecond = timeUnix.tv_nsec / 1000.0; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* to) { @@ -148,10 +148,10 @@ ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* to->tv_sec = timegm(&fromTm); to->tv_usec = from->usecond; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::convertTimevalToJD2000(timeval time, double* JD2000) { *JD2000 = (time.tv_sec - 946728000. + time.tv_usec / 1000000.) / 24. / 3600.; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/osal/linux/CountingSemaphore.cpp b/src/fsfw/osal/linux/CountingSemaphore.cpp index 78210996..e2b006d9 100644 --- a/src/fsfw/osal/linux/CountingSemaphore.cpp +++ b/src/fsfw/osal/linux/CountingSemaphore.cpp @@ -35,7 +35,7 @@ CountingSemaphore& CountingSemaphore::operator=(CountingSemaphore&& other) { ReturnValue_t CountingSemaphore::release() { ReturnValue_t result = checkCount(&handle, maxCount); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return CountingSemaphore::release(&this->handle); @@ -44,7 +44,7 @@ ReturnValue_t CountingSemaphore::release() { ReturnValue_t CountingSemaphore::release(sem_t* handle) { int result = sem_post(handle); if (result == 0) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } switch (errno) { @@ -61,7 +61,7 @@ ReturnValue_t CountingSemaphore::release(sem_t* handle) { } default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/osal/linux/FixedTimeslotTask.cpp b/src/fsfw/osal/linux/FixedTimeslotTask.cpp index 156413ea..34729c22 100644 --- a/src/fsfw/osal/linux/FixedTimeslotTask.cpp +++ b/src/fsfw/osal/linux/FixedTimeslotTask.cpp @@ -23,7 +23,7 @@ void* FixedTimeslotTask::taskEntryPoint(void* arg) { ReturnValue_t FixedTimeslotTask::startTask() { started = true; posixThread.createTask(&taskEntryPoint, this); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t FixedTimeslotTask::sleepFor(uint32_t ms) { diff --git a/src/fsfw/osal/linux/InternalErrorCodes.cpp b/src/fsfw/osal/linux/InternalErrorCodes.cpp index 11913906..41472b0c 100644 --- a/src/fsfw/osal/linux/InternalErrorCodes.cpp +++ b/src/fsfw/osal/linux/InternalErrorCodes.cpp @@ -2,7 +2,7 @@ ReturnValue_t InternalErrorCodes::translate(uint8_t code) { // TODO This class can be removed - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } InternalErrorCodes::InternalErrorCodes() {} diff --git a/src/fsfw/osal/linux/MessageQueue.cpp b/src/fsfw/osal/linux/MessageQueue.cpp index ec212165..b2cca3f1 100644 --- a/src/fsfw/osal/linux/MessageQueue.cpp +++ b/src/fsfw/osal/linux/MessageQueue.cpp @@ -54,7 +54,7 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) { "nullptr!" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (message->getMaximumMessageSize() < maxMessageSize) { @@ -62,7 +62,7 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) { sif::error << "MessageQueue::receiveMessage: Message size " << message->getMaximumMessageSize() << " too small to receive data!" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } unsigned int messagePriority = 0; @@ -72,9 +72,9 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) { this->last = message->getSender(); // Check size of incoming message. if (message->getMessageSize() < message->getMinimumMessageSize()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else if (status == 0) { // Success but no message received return MessageQueueIF::EMPTY; @@ -131,9 +131,9 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) { } default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -152,9 +152,9 @@ ReturnValue_t MessageQueue::flush(uint32_t* count) { utility::printUnixErrorGeneric(CLASS_NAME, "flush", "EINVAL"); break; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *count = attrib.mq_curmsgs; attrib.mq_curmsgs = 0; @@ -176,11 +176,11 @@ ReturnValue_t MessageQueue::flush(uint32_t* count) { utility::printUnixErrorGeneric(CLASS_NAME, "flush", "EINVAL"); break; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo, MessageQueueMessageIF* message, @@ -200,7 +200,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo, #else sif::printError("MessageQueue::sendMessageFromMessageQueue: Message is nullptr\n"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } message->setSender(sentFrom); @@ -257,11 +257,11 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo, utility::printUnixErrorGeneric(CLASS_NAME, "sendMessageFromMessageQueue", "EMSGSIZE"); break; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t MessageQueue::handleOpenError(mq_attr* attributes, uint32_t messageDepth) { @@ -320,7 +320,7 @@ ReturnValue_t MessageQueue::handleOpenError(mq_attr* attributes, uint32_t messag if (tempId != -1) { // Successful mq_open this->id = tempId; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } break; @@ -331,5 +331,5 @@ ReturnValue_t MessageQueue::handleOpenError(mq_attr* attributes, uint32_t messag utility::printUnixErrorGeneric(CLASS_NAME, "MessageQueue", "Unknown"); } } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } diff --git a/src/fsfw/osal/linux/Mutex.cpp b/src/fsfw/osal/linux/Mutex.cpp index 2698fb54..be7a0a85 100644 --- a/src/fsfw/osal/linux/Mutex.cpp +++ b/src/fsfw/osal/linux/Mutex.cpp @@ -82,9 +82,9 @@ ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType, uint32_t timeoutMs) { return CURR_THREAD_ALREADY_OWNS_MUTEX; case 0: // Success - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; }; } @@ -103,8 +103,8 @@ ReturnValue_t Mutex::unlockMutex() { return CURR_THREAD_DOES_NOT_OWN_MUTEX; case 0: // Success - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; }; } diff --git a/src/fsfw/osal/linux/PeriodicPosixTask.cpp b/src/fsfw/osal/linux/PeriodicPosixTask.cpp index 09b106ed..556a0367 100644 --- a/src/fsfw/osal/linux/PeriodicPosixTask.cpp +++ b/src/fsfw/osal/linux/PeriodicPosixTask.cpp @@ -23,11 +23,11 @@ ReturnValue_t PeriodicPosixTask::sleepFor(uint32_t ms) { ReturnValue_t PeriodicPosixTask::startTask() { if (isEmpty()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } started = true; posixThread.createTask(&taskEntryPoint, this); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } [[noreturn]] void PeriodicPosixTask::taskFunctionality() { diff --git a/src/fsfw/osal/linux/PosixThread.cpp b/src/fsfw/osal/linux/PosixThread.cpp index 9fc088ae..811d58e2 100644 --- a/src/fsfw/osal/linux/PosixThread.cpp +++ b/src/fsfw/osal/linux/PosixThread.cpp @@ -29,16 +29,16 @@ ReturnValue_t PosixThread::sleep(uint64_t ns) { switch (errno) { case EINTR: // The nanosleep() function was interrupted by a signal. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case EINVAL: // The rqtp argument specified a nanosecond value less than zero or // greater than or equal to 1000 million. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void PosixThread::suspend() { diff --git a/src/fsfw/osal/linux/TaskFactory.cpp b/src/fsfw/osal/linux/TaskFactory.cpp index a28e685d..2cd4fd67 100644 --- a/src/fsfw/osal/linux/TaskFactory.cpp +++ b/src/fsfw/osal/linux/TaskFactory.cpp @@ -28,7 +28,7 @@ FixedTimeslotTaskIF* TaskFactory::createFixedTimeslotTask( ReturnValue_t TaskFactory::deleteTask(PeriodicTaskIF* task) { // TODO not implemented - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t TaskFactory::delayTask(uint32_t delayMs) { diff --git a/src/fsfw/osal/rtems/BinarySemaphore.cpp b/src/fsfw/osal/rtems/BinarySemaphore.cpp index 06b0bf77..3677dd22 100644 --- a/src/fsfw/osal/rtems/BinarySemaphore.cpp +++ b/src/fsfw/osal/rtems/BinarySemaphore.cpp @@ -7,9 +7,9 @@ BinarySemaphore::BinarySemaphore() {} BinarySemaphore::~BinarySemaphore() {} ReturnValue_t BinarySemaphore::acquire(TimeoutType timeoutType, uint32_t timeoutMs) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } -ReturnValue_t BinarySemaphore::release() { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t BinarySemaphore::release() { return returnvalue::OK; } uint8_t BinarySemaphore::getSemaphoreCounter() const { return 0; } diff --git a/src/fsfw/osal/rtems/Clock.cpp b/src/fsfw/osal/rtems/Clock.cpp index 831c67d4..cb7bd042 100644 --- a/src/fsfw/osal/rtems/Clock.cpp +++ b/src/fsfw/osal/rtems/Clock.cpp @@ -23,13 +23,13 @@ ReturnValue_t Clock::setClock(const TimeOfDay_t* time) { rtems_status_code status = rtems_clock_set(&timeRtems); switch (status) { case RTEMS_SUCCESSFUL: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case RTEMS_INVALID_ADDRESS: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_CLOCK: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -38,7 +38,7 @@ ReturnValue_t Clock::setClock(const timeval* time) { newTime.tv_sec = time->tv_sec; if (time->tv_usec < 0) { // better returnvalue. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } newTime.tv_nsec = time->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; @@ -48,10 +48,10 @@ ReturnValue_t Clock::setClock(const timeval* time) { Status_Control status = _TOD_Set(&newTime, &context); _TOD_Unlock(); if (status == STATUS_SUCCESSFUL) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } // better returnvalue - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t Clock::getClock_timeval(timeval* time) { @@ -59,11 +59,11 @@ ReturnValue_t Clock::getClock_timeval(timeval* time) { rtems_status_code status = rtems_clock_get_tod_timeval(time); switch (status) { case RTEMS_SUCCESSFUL: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case RTEMS_NOT_DEFINED: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -77,16 +77,16 @@ ReturnValue_t Clock::getUptime(timeval* uptime) { uptime->tv_usec = time.tv_nsec; switch (status) { case RTEMS_SUCCESSFUL: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } ReturnValue_t Clock::getUptime(uint32_t* uptimeMs) { // This counter overflows after 50 days *uptimeMs = rtems_clock_get_ticks_since_boot(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getClock_usecs(uint64_t* time) { @@ -95,9 +95,9 @@ ReturnValue_t Clock::getClock_usecs(uint64_t* time) { *time = ((uint64_t)temp_time.tv_sec * 1000000) + temp_time.tv_usec; switch (returnValue) { case RTEMS_SUCCESSFUL: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -118,16 +118,16 @@ ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) { time->usecond = static_cast(timeRtems.ticks) / rtems_clock_get_ticks_per_second() * 1e6; time->year = timeRtems.year; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case RTEMS_NOT_DEFINED: /* System date and time is not set */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_ADDRESS: /* time_buffer is NULL */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -143,10 +143,10 @@ ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval* timeRtems.ticks = from->usecond * getTicksPerSecond() / 1e6; to->tv_sec = _TOD_To_seconds(&timeRtems); to->tv_usec = from->usecond; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::convertTimevalToJD2000(timeval time, double* JD2000) { *JD2000 = (time.tv_sec - 946728000. + time.tv_usec / 1000000.) / 24. / 3600.; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/osal/rtems/CpuUsage.cpp b/src/fsfw/osal/rtems/CpuUsage.cpp index 2613a698..4ffc2271 100644 --- a/src/fsfw/osal/rtems/CpuUsage.cpp +++ b/src/fsfw/osal/rtems/CpuUsage.cpp @@ -86,7 +86,7 @@ ReturnValue_t CpuUsage::serialize(uint8_t** buffer, size_t* size, size_t maxSize Endianness streamEndianness) const { ReturnValue_t result = SerializeAdapter::serialize(&timeSinceLastReset, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SerialArrayListAdapter::serialize(&threadData, buffer, size, maxSize, @@ -106,7 +106,7 @@ ReturnValue_t CpuUsage::deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { ReturnValue_t result = SerializeAdapter::deSerialize(&timeSinceLastReset, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SerialArrayListAdapter::deSerialize(&threadData, buffer, size, @@ -116,7 +116,7 @@ ReturnValue_t CpuUsage::deSerialize(const uint8_t** buffer, size_t* size, ReturnValue_t CpuUsage::ThreadData::serialize(uint8_t** buffer, size_t* size, size_t maxSize, Endianness streamEndianness) const { ReturnValue_t result = SerializeAdapter::serialize(&id, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (*size + MAX_LENGTH_OF_THREAD_NAME > maxSize) { @@ -126,14 +126,14 @@ ReturnValue_t CpuUsage::ThreadData::serialize(uint8_t** buffer, size_t* size, si *size += MAX_LENGTH_OF_THREAD_NAME; *buffer += MAX_LENGTH_OF_THREAD_NAME; result = SerializeAdapter::serialize(&timeRunning, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&percentUsage, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } uint32_t CpuUsage::ThreadData::getSerializedSize() const { @@ -150,7 +150,7 @@ uint32_t CpuUsage::ThreadData::getSerializedSize() const { ReturnValue_t CpuUsage::ThreadData::deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { ReturnValue_t result = SerializeAdapter::deSerialize(&id, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (*size < MAX_LENGTH_OF_THREAD_NAME) { @@ -159,12 +159,12 @@ ReturnValue_t CpuUsage::ThreadData::deSerialize(const uint8_t** buffer, size_t* memcpy(name, *buffer, MAX_LENGTH_OF_THREAD_NAME); *buffer -= MAX_LENGTH_OF_THREAD_NAME; result = SerializeAdapter::deSerialize(&timeRunning, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&percentUsage, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/osal/rtems/FixedTimeslotTask.cpp b/src/fsfw/osal/rtems/FixedTimeslotTask.cpp index f400c213..77582d75 100644 --- a/src/fsfw/osal/rtems/FixedTimeslotTask.cpp +++ b/src/fsfw/osal/rtems/FixedTimeslotTask.cpp @@ -48,14 +48,14 @@ ReturnValue_t FixedTimeslotTask::startTask() { switch (status) { case RTEMS_SUCCESSFUL: // ask started successfully - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: /* RTEMS_INVALID_ADDRESS - invalid task entry point RTEMS_INVALID_ID - invalid task id RTEMS_INCORRECT_STATE - task not in the dormant state RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/osal/rtems/InternalErrorCodes.cpp b/src/fsfw/osal/rtems/InternalErrorCodes.cpp index 4d78186c..9e0c1ae7 100644 --- a/src/fsfw/osal/rtems/InternalErrorCodes.cpp +++ b/src/fsfw/osal/rtems/InternalErrorCodes.cpp @@ -50,7 +50,7 @@ ReturnValue_t InternalErrorCodes::translate(uint8_t code) { // case INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0: // return UNLIMITED_AND_MAXIMUM_IS_0; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/osal/rtems/MessageQueue.cpp b/src/fsfw/osal/rtems/MessageQueue.cpp index 534015dc..bae3b5e0 100644 --- a/src/fsfw/osal/rtems/MessageQueue.cpp +++ b/src/fsfw/osal/rtems/MessageQueue.cpp @@ -32,7 +32,7 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) { this->last = message->getSender(); // Check size of incoming message. if (message->getMessageSize() < message->getMinimumMessageSize()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } else { // No message was received. Keep lastPartner anyway, I might send something later. @@ -66,7 +66,7 @@ ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo, MessageQueu ReturnValue_t returnCode = convertReturnCode(result); if (returnCode == MessageQueueIF::EMPTY) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return returnCode; @@ -75,23 +75,23 @@ ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo, MessageQueu ReturnValue_t MessageQueue::convertReturnCode(rtems_status_code inValue) { switch (inValue) { case RTEMS_SUCCESSFUL: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case RTEMS_INVALID_ID: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_TIMEOUT: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_OBJECT_WAS_DELETED: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_ADDRESS: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_SIZE: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_TOO_MANY: return MessageQueueIF::FULL; case RTEMS_UNSATISFIED: return MessageQueueIF::EMPTY; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/osal/rtems/Mutex.cpp b/src/fsfw/osal/rtems/Mutex.cpp index 94f0041e..eb1a3718 100644 --- a/src/fsfw/osal/rtems/Mutex.cpp +++ b/src/fsfw/osal/rtems/Mutex.cpp @@ -43,7 +43,7 @@ ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType = TimeoutType::BLOCKING, switch (status) { case RTEMS_SUCCESSFUL: // semaphore obtained successfully - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case RTEMS_UNSATISFIED: // semaphore not available return MUTEX_NOT_FOUND; @@ -57,7 +57,7 @@ ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType = TimeoutType::BLOCKING, // invalid semaphore id return MUTEX_INVALID_ID; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -66,7 +66,7 @@ ReturnValue_t Mutex::unlockMutex() { switch (status) { case RTEMS_SUCCESSFUL: // semaphore obtained successfully - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case RTEMS_NOT_OWNER_OF_RESOURCE: // semaphore not available return CURR_THREAD_DOES_NOT_OWN_MUTEX; @@ -74,6 +74,6 @@ ReturnValue_t Mutex::unlockMutex() { // invalid semaphore id return MUTEX_INVALID_ID; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/osal/rtems/PeriodicTask.cpp b/src/fsfw/osal/rtems/PeriodicTask.cpp index cccf937f..5c397815 100644 --- a/src/fsfw/osal/rtems/PeriodicTask.cpp +++ b/src/fsfw/osal/rtems/PeriodicTask.cpp @@ -37,13 +37,13 @@ ReturnValue_t PeriodicTask::startTask() { switch (status) { case RTEMS_SUCCESSFUL: /* Task started successfully */ - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: /* RTEMS_INVALID_ADDRESS - invalid task entry point RTEMS_INVALID_ID - invalid task id RTEMS_INCORRECT_STATE - task not in the dormant state RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/osal/rtems/QueueFactory.cpp b/src/fsfw/osal/rtems/QueueFactory.cpp index 074ce273..1918f7bc 100644 --- a/src/fsfw/osal/rtems/QueueFactory.cpp +++ b/src/fsfw/osal/rtems/QueueFactory.cpp @@ -16,25 +16,25 @@ ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo, switch (result) { case RTEMS_SUCCESSFUL: // message sent successfully - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case RTEMS_INVALID_ID: // invalid queue id - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_SIZE: // invalid message size - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_ADDRESS: // buffer is NULL - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_UNSATISFIED: // out of message buffers - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_TOO_MANY: // queue's limit has been reached return MessageQueueIF::FULL; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/osal/rtems/RTEMSTaskBase.cpp b/src/fsfw/osal/rtems/RTEMSTaskBase.cpp index a306b9e2..b235f6a0 100644 --- a/src/fsfw/osal/rtems/RTEMSTaskBase.cpp +++ b/src/fsfw/osal/rtems/RTEMSTaskBase.cpp @@ -21,7 +21,7 @@ RTEMSTaskBase::RTEMSTaskBase(rtems_task_priority set_priority, size_t stack_size RTEMS_FLOATING_POINT, &id); } ReturnValue_t result = convertReturnCode(status); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TaskBase::TaskBase: createTask with name " << std::hex << osalName << std::dec << " failed with return code " << (uint32_t)status << std::endl; @@ -42,21 +42,21 @@ ReturnValue_t RTEMSTaskBase::sleepFor(uint32_t ms) { ReturnValue_t RTEMSTaskBase::convertReturnCode(rtems_status_code inValue) { switch (inValue) { case RTEMS_SUCCESSFUL: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case RTEMS_MP_NOT_CONFIGURED: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_NAME: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_TOO_MANY: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_ADDRESS: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_UNSATISFIED: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; case RTEMS_INVALID_PRIORITY: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/osal/rtems/TaskFactory.cpp b/src/fsfw/osal/rtems/TaskFactory.cpp index fb52eb0e..f10e5cf3 100644 --- a/src/fsfw/osal/rtems/TaskFactory.cpp +++ b/src/fsfw/osal/rtems/TaskFactory.cpp @@ -31,13 +31,13 @@ FixedTimeslotTaskIF* TaskFactory::createFixedTimeslotTask( ReturnValue_t TaskFactory::deleteTask(PeriodicTaskIF* task) { // This should call the OS specific destructor delete (dynamic_cast(task)); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t TaskFactory::delayTask(uint32_t delayMs) { rtems_task_wake_after(RtemsBasic::convertMsToTicks(delayMs)); // Only return value is "RTEMS_SUCCESSFUL - always successful" so it has been neglected - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TaskFactory::printMissedDeadline() { diff --git a/src/fsfw/osal/windows/winTaskHelpers.cpp b/src/fsfw/osal/windows/winTaskHelpers.cpp index c863c4ca..206ee7a7 100644 --- a/src/fsfw/osal/windows/winTaskHelpers.cpp +++ b/src/fsfw/osal/windows/winTaskHelpers.cpp @@ -89,7 +89,7 @@ ReturnValue_t tasks::setTaskPriority(HANDLE nativeHandle, TaskPriority priority) #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "PeriodicTask: Windows SetPriorityClass failed with code " << GetLastError() << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; #endif } result = SetThreadPriority(reinterpret_cast(nativeHandle), nPriorityNumber); @@ -97,8 +97,8 @@ ReturnValue_t tasks::setTaskPriority(HANDLE nativeHandle, TaskPriority priority) #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "PeriodicTask: Windows SetPriorityClass failed with code " << GetLastError() << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; #endif } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/parameters/ParameterHelper.cpp b/src/fsfw/parameters/ParameterHelper.cpp index 58356af5..ba0e70a4 100644 --- a/src/fsfw/parameters/ParameterHelper.cpp +++ b/src/fsfw/parameters/ParameterHelper.cpp @@ -10,10 +10,10 @@ ParameterHelper::~ParameterHelper() {} ReturnValue_t ParameterHelper::handleParameterMessage(CommandMessage* message) { if (storage == nullptr) { // ParameterHelper was not initialized - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; switch (message->getCommand()) { case ParameterMessage::CMD_PARAMETER_DUMP: { ParameterWrapper description; @@ -21,7 +21,7 @@ ReturnValue_t ParameterHelper::handleParameterMessage(CommandMessage* message) { uint8_t uniqueIdentifier = HasParametersIF::getUniqueIdentifierId(ParameterMessage::getParameterId(message)); result = owner->getParameter(domain, uniqueIdentifier, &description, &description, 0); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { result = sendParameter(message->getSender(), ParameterMessage::getParameterId(message), &description); } @@ -42,7 +42,7 @@ ReturnValue_t ParameterHelper::handleParameterMessage(CommandMessage* message) { ConstStorageAccessor accessor(storeId); result = storage->getData(storeId, accessor); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "ParameterHelper::handleParameterMessage: Getting" << " store data failed for load command." << std::endl; @@ -52,19 +52,19 @@ ReturnValue_t ParameterHelper::handleParameterMessage(CommandMessage* message) { ParameterWrapper streamWrapper; result = streamWrapper.set(type, rows, columns, accessor.data(), accessor.size()); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } ParameterWrapper ownerWrapper; result = owner->getParameter(domain, uniqueIdentifier, &ownerWrapper, &streamWrapper, linearIndex); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = ownerWrapper.copyFrom(&streamWrapper, linearIndex); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -73,14 +73,14 @@ ReturnValue_t ParameterHelper::handleParameterMessage(CommandMessage* message) { break; } default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { rejectCommand(message->getSender(), result, message->getCommand()); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t ParameterHelper::sendParameter(MessageQueueId_t to, uint32_t id, @@ -91,7 +91,7 @@ ReturnValue_t ParameterHelper::sendParameter(MessageQueueId_t to, uint32_t id, store_address_t address; ReturnValue_t result = storage->getFreeElement(&address, serializedSize, &storeElement); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -100,7 +100,7 @@ ReturnValue_t ParameterHelper::sendParameter(MessageQueueId_t to, uint32_t id, result = description->serialize(&storeElement, &storeElementSize, serializedSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { storage->deleteData(address); return result; } @@ -111,7 +111,7 @@ ReturnValue_t ParameterHelper::sendParameter(MessageQueueId_t to, uint32_t id, MessageQueueSenderIF::sendMessage(to, &reply, ownerQueueId); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t ParameterHelper::initialize() { @@ -121,7 +121,7 @@ ReturnValue_t ParameterHelper::initialize() { if (storage == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void ParameterHelper::rejectCommand(MessageQueueId_t to, ReturnValue_t reason, diff --git a/src/fsfw/parameters/ParameterWrapper.cpp b/src/fsfw/parameters/ParameterWrapper.cpp index 27552290..522a68b1 100644 --- a/src/fsfw/parameters/ParameterWrapper.cpp +++ b/src/fsfw/parameters/ParameterWrapper.cpp @@ -28,16 +28,16 @@ ReturnValue_t ParameterWrapper::serialize(uint8_t **buffer, size_t *size, size_t ReturnValue_t result; result = SerializeAdapter::serialize(&type, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&columns, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&rows, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -91,11 +91,11 @@ template ReturnValue_t ParameterWrapper::serializeData(uint8_t **buffer, size_t *size, size_t maxSize, Endianness streamEndianness) const { const T *element = (const T *)readonlyData; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; uint16_t dataSize = columns * rows; while (dataSize != 0) { result = SerializeAdapter::serialize(element, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } element++; @@ -112,7 +112,7 @@ ReturnValue_t ParameterWrapper::deSerializeData(uint8_t startingRow, uint8_t sta const uint8_t *fromAsStream = reinterpret_cast(from); size_t streamSize = fromRows * fromColumns * sizeof(T); - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; for (uint8_t fromRow = 0; fromRow < fromRows; fromRow++) { // get the start element of this row in data @@ -122,7 +122,7 @@ ReturnValue_t ParameterWrapper::deSerializeData(uint8_t startingRow, uint8_t sta for (uint8_t fromColumn = 0; fromColumn < fromColumns; fromColumn++) { result = SerializeAdapter::deSerialize(dataWithDataType + fromColumn, &fromAsStream, &streamSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -142,7 +142,7 @@ ReturnValue_t ParameterWrapper::deSerialize(const uint8_t **buffer, size_t *size ParameterWrapper streamDescription; ReturnValue_t result = streamDescription.set(*buffer, *size, buffer, size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -163,24 +163,24 @@ ReturnValue_t ParameterWrapper::set(Type type, uint8_t rows, uint8_t columns, co this->data = nullptr; this->readonlyData = data; pointsToStream = true; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t ParameterWrapper::set(const uint8_t *stream, size_t streamSize, const uint8_t **remainingStream, size_t *remainingSize) { ReturnValue_t result = SerializeAdapter::deSerialize(&type, &stream, &streamSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&columns, &stream, &streamSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&rows, &stream, &streamSize, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -203,7 +203,7 @@ ReturnValue_t ParameterWrapper::set(const uint8_t *stream, size_t streamSize, *remainingSize = streamSize; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t ParameterWrapper::copyFrom(const ParameterWrapper *from, @@ -265,7 +265,7 @@ ReturnValue_t ParameterWrapper::copyFrom(const ParameterWrapper *from, uint8_t typeSize = type.getSize(); - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; // copy data if (from->pointsToStream) { switch (type) { diff --git a/src/fsfw/parameters/ParameterWrapper.h b/src/fsfw/parameters/ParameterWrapper.h index 873db7b2..3b04199a 100644 --- a/src/fsfw/parameters/ParameterWrapper.h +++ b/src/fsfw/parameters/ParameterWrapper.h @@ -185,7 +185,7 @@ inline ReturnValue_t ParameterWrapper::getElement(T *value, uint8_t row, uint8_t } else { const T *dataWithType = static_cast(readonlyData); *value = dataWithType[row * columns + column]; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } diff --git a/src/fsfw/power/DummyPowerSwitcher.cpp b/src/fsfw/power/DummyPowerSwitcher.cpp index 48ab22c6..952a5a57 100644 --- a/src/fsfw/power/DummyPowerSwitcher.cpp +++ b/src/fsfw/power/DummyPowerSwitcher.cpp @@ -20,28 +20,28 @@ ReturnValue_t DummyPowerSwitcher::sendSwitchCommand(power::Switch_t switchNr, Re if (switchNr < switcherList.size()) { switcherList[switchNr] = onOff; } - return RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t DummyPowerSwitcher::sendFuseOnCommand(uint8_t fuseNr) { if (fuseNr < fuseList.size()) { fuseList[fuseNr] = FUSE_ON; } - return RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t DummyPowerSwitcher::getSwitchState(power::Switch_t switchNr) const { if (switchNr < switcherList.size()) { return switcherList[switchNr]; } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t DummyPowerSwitcher::getFuseState(uint8_t fuseNr) const { if (fuseNr < fuseList.size()) { return fuseList[fuseNr]; } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } uint32_t DummyPowerSwitcher::getSwitchDelayMs(void) const { return switchDelayMs; } diff --git a/src/fsfw/power/Fuse.cpp b/src/fsfw/power/Fuse.cpp index 81b51c89..73b29452 100644 --- a/src/fsfw/power/Fuse.cpp +++ b/src/fsfw/power/Fuse.cpp @@ -32,22 +32,22 @@ void Fuse::addDevice(PowerComponentIF* switchSet) { devices.push_back(switchSet) ReturnValue_t Fuse::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = parameterHelper.initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = healthHelper.initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } powerIF = ObjectManager::instance()->get(powerSwitchId); if (powerIF == NULL) { - return RETURN_FAILED; + return returnvalue::FAILED; } - return RETURN_OK; + return returnvalue::OK; } void Fuse::calculatePowerLimits(float* low, float* high) { @@ -66,7 +66,7 @@ ReturnValue_t Fuse::check() { set.setValidity(false, true); return set.commit(); } - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; checkFuseState(); calculateFusePower(); // Check if power is valid and if fuse state is off or invalid. @@ -89,14 +89,14 @@ ReturnValue_t Fuse::check() { ReturnValue_t Fuse::serialize(uint8_t** buffer, size_t* size, size_t maxSize, Endianness streamEndianness) const { - ReturnValue_t result = RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; for (DeviceList::const_iterator iter = devices.begin(); iter != devices.end(); iter++) { result = (*iter)->serialize(buffer, size, maxSize, streamEndianness); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } } - return RETURN_OK; + return returnvalue::OK; } size_t Fuse::getSerializedSize() const { @@ -108,21 +108,21 @@ size_t Fuse::getSerializedSize() const { } ReturnValue_t Fuse::deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { - ReturnValue_t result = RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; for (DeviceList::iterator iter = devices.begin(); iter != devices.end(); iter++) { result = (*iter)->deSerialize(buffer, size, streamEndianness); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } } - return RETURN_OK; + return returnvalue::OK; } uint8_t Fuse::getFuseId() const { return fuseId; } void Fuse::calculateFusePower() { ReturnValue_t result1 = currentLimit.check(); - if (result1 != HasReturnvaluesIF::RETURN_OK || !(voltage.isValid())) { + if (result1 != returnvalue::OK || !(voltage.isValid())) { power.setValid(PoolVariableIF::INVALID); return; } @@ -133,7 +133,7 @@ void Fuse::calculateFusePower() { ReturnValue_t Fuse::performOperation(uint8_t opCode) { checkCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void Fuse::reportEvents(Event event) { @@ -157,15 +157,15 @@ void Fuse::setAllMonitorsToUnchecked() { void Fuse::checkCommandQueue() { CommandMessage command; ReturnValue_t result = commandQueue->receiveMessage(&command); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } result = healthHelper.handleHealthCommand(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return; } result = parameterHelper.handleParameterMessage(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return; } command.setToUnknownCommand(); @@ -227,7 +227,7 @@ bool Fuse::isPowerValid() { return power.isValid(); } ReturnValue_t Fuse::setHealth(HealthState health) { healthHelper.setHealth(health); - return RETURN_OK; + return returnvalue::OK; } HasHealthIF::HealthState Fuse::getHealth() { return healthHelper.getHealth(); } @@ -238,6 +238,6 @@ ReturnValue_t Fuse::PowerMonitor::checkPower(float sample, float lowerLimit, flo } else if (sample < lowerLimit) { return this->monitorStateIs(MonitoringIF::BELOW_LOW_LIMIT, sample, lowerLimit); } else { - return this->monitorStateIs(RETURN_OK, sample, 0.0); // Within limits. + return this->monitorStateIs(returnvalue::OK, sample, 0.0); // Within limits. } } diff --git a/src/fsfw/power/Fuse.h b/src/fsfw/power/Fuse.h index 43896f75..1f880f3a 100644 --- a/src/fsfw/power/Fuse.h +++ b/src/fsfw/power/Fuse.h @@ -16,7 +16,6 @@ void setStaticFrameworkObjectIds(); class Fuse : public SystemObject, public HasHealthIF, - public HasReturnvaluesIF, public ReceivesParameterMessagesIF, public SerializeIF { friend void(Factory::setStaticFrameworkObjectIds)(); diff --git a/src/fsfw/power/PowerComponent.cpp b/src/fsfw/power/PowerComponent.cpp index e4c336c7..fd780841 100644 --- a/src/fsfw/power/PowerComponent.cpp +++ b/src/fsfw/power/PowerComponent.cpp @@ -18,7 +18,7 @@ ReturnValue_t PowerComponent::serialize(uint8_t** buffer, size_t* size, size_t m Endianness streamEndianness) const { ReturnValue_t result = SerializeAdapter::serialize(&minPower, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SerializeAdapter::serialize(&maxPower, buffer, size, maxSize, streamEndianness); @@ -41,7 +41,7 @@ float PowerComponent::getMax() { return maxPower; } ReturnValue_t PowerComponent::deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { ReturnValue_t result = SerializeAdapter::deSerialize(&minPower, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SerializeAdapter::deSerialize(&maxPower, buffer, size, streamEndianness); @@ -64,5 +64,5 @@ ReturnValue_t PowerComponent::getParameter(uint8_t domainId, uint8_t uniqueId, default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/power/PowerSensor.cpp b/src/fsfw/power/PowerSensor.cpp index 08ff4724..69c9e272 100644 --- a/src/fsfw/power/PowerSensor.cpp +++ b/src/fsfw/power/PowerSensor.cpp @@ -22,8 +22,8 @@ PowerSensor::~PowerSensor() { QueueFactory::instance()->deleteMessageQueue(comma ReturnValue_t PowerSensor::calculatePower() { powerSensorSet.read(); - ReturnValue_t result1 = HasReturnvaluesIF::RETURN_FAILED; - ReturnValue_t result2 = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result1 = returnvalue::FAILED; + ReturnValue_t result2 = returnvalue::FAILED; if (healthHelper.healthTable->isHealthy(getObjectId()) && voltage.isValid() && current.isValid()) { result1 = voltageLimit.doCheck(voltage.value); @@ -33,7 +33,7 @@ ReturnValue_t PowerSensor::calculatePower() { currentLimit.setToInvalid(); result1 = OBJECT_NOT_HEALTHY; } - if (result1 != HasReturnvaluesIF::RETURN_OK || result2 != HasReturnvaluesIF::RETURN_OK) { + if (result1 != returnvalue::OK || result2 != returnvalue::OK) { result1 = MonitoringIF::INVALID; power.setValid(PoolVariableIF::INVALID); } else { @@ -46,22 +46,22 @@ ReturnValue_t PowerSensor::calculatePower() { ReturnValue_t PowerSensor::performOperation(uint8_t opCode) { checkCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } MessageQueueId_t PowerSensor::getCommandQueue() const { return commandQueue->getId(); } ReturnValue_t PowerSensor::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = healthHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = parameterHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return result; @@ -75,15 +75,15 @@ void PowerSensor::setAllMonitorsToUnchecked() { void PowerSensor::checkCommandQueue() { CommandMessage command; ReturnValue_t result = commandQueue->receiveMessage(&command); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } result = healthHelper.handleHealthCommand(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return; } result = parameterHelper.handleParameterMessage(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return; } command.setToUnknownCommand(); @@ -106,7 +106,7 @@ float PowerSensor::getPower() { ReturnValue_t PowerSensor::setHealth(HealthState health) { healthHelper.setHealth(health); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } HasHealthIF::HealthState PowerSensor::getHealth() { return healthHelper.getHealth(); } diff --git a/src/fsfw/power/PowerSwitchIF.h b/src/fsfw/power/PowerSwitchIF.h index bc883fbc..054923f4 100644 --- a/src/fsfw/power/PowerSwitchIF.h +++ b/src/fsfw/power/PowerSwitchIF.h @@ -13,7 +13,7 @@ * because they can be called asynchronosuly (const ending). * @ingroup interfaces */ -class PowerSwitchIF : public HasReturnvaluesIF { +class PowerSwitchIF { public: /** * Empty dtor. @@ -50,7 +50,7 @@ class PowerSwitchIF : public HasReturnvaluesIF { * @return * - @c SWITCH_ON if the specified switch is on. * - @c SWITCH_OFF if the specified switch is off. - * - @c RETURN_FAILED if an error occured + * - @c returnvalue::FAILED if an error occured */ virtual ReturnValue_t getSwitchState(power::Switch_t switchNr) const = 0; /** @@ -59,7 +59,7 @@ class PowerSwitchIF : public HasReturnvaluesIF { * @return * - @c FUSE_ON if the specified fuse is on. * - @c FUSE_OFF if the specified fuse is off. - * - @c RETURN_FAILED if an error occured + * - @c returnvalue::FAILED if an error occured */ virtual ReturnValue_t getFuseState(uint8_t fuseNr) const = 0; /** diff --git a/src/fsfw/power/PowerSwitcher.cpp b/src/fsfw/power/PowerSwitcher.cpp index 7608c6e7..77733884 100644 --- a/src/fsfw/power/PowerSwitcher.cpp +++ b/src/fsfw/power/PowerSwitcher.cpp @@ -24,11 +24,11 @@ ReturnValue_t PowerSwitcher::getStateOfSwitches() { (secondSwitchState == PowerSwitchIF::SWITCH_OFF)) { return PowerSwitchIF::SWITCH_OFF; } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -111,18 +111,18 @@ ReturnValue_t PowerSwitcher::checkSwitchState() { return IN_POWER_TRANSITION; case SWITCH_IS_OFF: if (getStateOfSwitches() == PowerSwitchIF::SWITCH_OFF) { - return RETURN_OK; + return returnvalue::OK; } else { return SWITCH_STATE_MISMATCH; } case SWITCH_IS_ON: if (getStateOfSwitches() == PowerSwitchIF::SWITCH_ON) { - return RETURN_OK; + return returnvalue::OK; } else { return SWITCH_STATE_MISMATCH; } } - return RETURN_FAILED; + return returnvalue::FAILED; } PowerSwitcher::State_t PowerSwitcher::getState() { return state; } diff --git a/src/fsfw/power/PowerSwitcher.h b/src/fsfw/power/PowerSwitcher.h index 279ffacf..7aa60494 100644 --- a/src/fsfw/power/PowerSwitcher.h +++ b/src/fsfw/power/PowerSwitcher.h @@ -6,7 +6,7 @@ #include "../timemanager/Countdown.h" #include "PowerSwitchIF.h" -class PowerSwitcher : public HasReturnvaluesIF { +class PowerSwitcher { public: enum State_t { WAIT_OFF, diff --git a/src/fsfw/power/PowerSwitcherComponent.cpp b/src/fsfw/power/PowerSwitcherComponent.cpp index 9c1ed4cf..b6b67a83 100644 --- a/src/fsfw/power/PowerSwitcherComponent.cpp +++ b/src/fsfw/power/PowerSwitcherComponent.cpp @@ -16,15 +16,15 @@ ReturnValue_t PowerSwitcherComponent::performOperation(uint8_t opCode) { ReturnValue_t result; CommandMessage command; - for (result = queue->receiveMessage(&command); result == RETURN_OK; + for (result = queue->receiveMessage(&command); result == returnvalue::OK; result = queue->receiveMessage(&command)) { result = healthHelper.handleHealthCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = modeHelper.handleModeCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } } @@ -37,16 +37,16 @@ ReturnValue_t PowerSwitcherComponent::performOperation(uint8_t opCode) { setMode(MODE_ON, 0); } } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t PowerSwitcherComponent::initialize() { ReturnValue_t result = modeHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = healthHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SystemObject::initialize(); @@ -61,7 +61,7 @@ void PowerSwitcherComponent::getMode(Mode_t *mode, Submode_t *submode) { ReturnValue_t PowerSwitcherComponent::setHealth(HealthState health) { healthHelper.setHealth(health); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t PowerSwitcherComponent::checkModeCommand(Mode_t mode, Submode_t submode, @@ -70,7 +70,7 @@ ReturnValue_t PowerSwitcherComponent::checkModeCommand(Mode_t mode, Submode_t su if (mode != MODE_ON and mode != MODE_OFF) { return TRANS_NOT_ALLOWED; } - return RETURN_OK; + return returnvalue::OK; } void PowerSwitcherComponent::startTransition(Mode_t mode, Submode_t submode) { diff --git a/src/fsfw/power/PowerSwitcherComponent.h b/src/fsfw/power/PowerSwitcherComponent.h index a3ed640e..01689bef 100644 --- a/src/fsfw/power/PowerSwitcherComponent.h +++ b/src/fsfw/power/PowerSwitcherComponent.h @@ -23,7 +23,6 @@ class PowerSwitchIF; * commanding in to MODE_ON will cause the switcher to turn the switch on. */ class PowerSwitcherComponent : public SystemObject, - public HasReturnvaluesIF, public ExecutableObjectIF, public HasModesIF, public HasHealthIF { diff --git a/src/fsfw/pus/CService200ModeCommanding.cpp b/src/fsfw/pus/CService200ModeCommanding.cpp index 41be3d13..fedc4760 100644 --- a/src/fsfw/pus/CService200ModeCommanding.cpp +++ b/src/fsfw/pus/CService200ModeCommanding.cpp @@ -20,7 +20,7 @@ ReturnValue_t CService200ModeCommanding::isValidSubservice(uint8_t subservice) { case (Subservice::COMMAND_MODE_COMMAND): case (Subservice::COMMAND_MODE_READ): case (Subservice::COMMAND_MODE_ANNCOUNCE): - return RETURN_OK; + return returnvalue::OK; default: return AcceptsTelecommandsIF::INVALID_SUBSERVICE; } @@ -47,7 +47,7 @@ ReturnValue_t CService200ModeCommanding::checkInterfaceAndAcquireMessageQueue( } *messageQueueToSet = destination->getCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t CService200ModeCommanding::prepareCommand(CommandMessage *message, uint8_t subservice, @@ -56,7 +56,7 @@ ReturnValue_t CService200ModeCommanding::prepareCommand(CommandMessage *message, ModePacket modeCommandPacket; ReturnValue_t result = modeCommandPacket.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -70,7 +70,7 @@ ReturnValue_t CService200ModeCommanding::handleReply(const CommandMessage *reply CommandMessage *optionalNextCommand, object_id_t objectId, bool *isStep) { Command_t replyId = reply->getCommand(); - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; switch (replyId) { case (ModeMessage::REPLY_MODE_REPLY): { result = prepareModeReply(reply, objectId); @@ -88,7 +88,7 @@ ReturnValue_t CService200ModeCommanding::handleReply(const CommandMessage *reply result = INVALID_REPLY; break; default: - result = RETURN_FAILED; + result = returnvalue::FAILED; } return result; } @@ -103,9 +103,9 @@ ReturnValue_t CService200ModeCommanding::prepareWrongModeReply(const CommandMess object_id_t objectId) { ModePacket wrongModeReply(objectId, ModeMessage::getMode(reply), ModeMessage::getSubmode(reply)); ReturnValue_t result = sendTmPacket(Subservice::REPLY_WRONG_MODE_REPLY, &wrongModeReply); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { // We want to produce an error here in any case because the mode was not correct - return RETURN_FAILED; + return returnvalue::FAILED; } return result; } @@ -114,9 +114,9 @@ ReturnValue_t CService200ModeCommanding::prepareCantReachModeReply(const Command object_id_t objectId) { CantReachModePacket cantReachModePacket(objectId, ModeMessage::getCantReachModeReason(reply)); ReturnValue_t result = sendTmPacket(Subservice::REPLY_CANT_REACH_MODE, &cantReachModePacket); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { // We want to produce an error here in any case because the mode was not reached - return RETURN_FAILED; + return returnvalue::FAILED; } return result; } diff --git a/src/fsfw/pus/CService201HealthCommanding.cpp b/src/fsfw/pus/CService201HealthCommanding.cpp index 644e0d7c..45473581 100644 --- a/src/fsfw/pus/CService201HealthCommanding.cpp +++ b/src/fsfw/pus/CService201HealthCommanding.cpp @@ -18,7 +18,7 @@ ReturnValue_t CService201HealthCommanding::isValidSubservice(uint8_t subservice) case (Subservice::COMMAND_SET_HEALTH): case (Subservice::COMMAND_ANNOUNCE_HEALTH): case (Subservice::COMMAND_ANNOUNCE_HEALTH_ALL): - return RETURN_OK; + return returnvalue::OK; default: #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Invalid Subservice" << std::endl; @@ -48,19 +48,19 @@ ReturnValue_t CService201HealthCommanding::checkInterfaceAndAcquireMessageQueue( } *messageQueueToSet = destination->getCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t CService201HealthCommanding::prepareCommand(CommandMessage *message, uint8_t subservice, const uint8_t *tcData, size_t tcDataLen, uint32_t *state, object_id_t objectId) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; switch (subservice) { case (Subservice::COMMAND_SET_HEALTH): { HealthSetCommand healthCommand; result = healthCommand.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { break; } HealthMessage::setHealthMessage(message, HealthMessage::HEALTH_SET, @@ -77,7 +77,7 @@ ReturnValue_t CService201HealthCommanding::prepareCommand(CommandMessage *messag } default: { // Should never happen, subservice was already checked - result = RETURN_FAILED; + result = returnvalue::FAILED; } } return result; diff --git a/src/fsfw/pus/Service11TelecommandScheduling.tpp b/src/fsfw/pus/Service11TelecommandScheduling.tpp index 968a59ff..7b9ba7c0 100644 --- a/src/fsfw/pus/Service11TelecommandScheduling.tpp +++ b/src/fsfw/pus/Service11TelecommandScheduling.tpp @@ -62,13 +62,13 @@ inline ReturnValue_t Service11TelecommandScheduling::handleRequest( default: return AcceptsTelecommandsIF::INVALID_SUBSERVICE; } - return RETURN_OK; + return returnvalue::OK; } template inline ReturnValue_t Service11TelecommandScheduling::performService() { if (not schedulingEnabled) { - return RETURN_OK; + return returnvalue::OK; } // get current time as UNIX timestamp timeval tNow = {}; @@ -84,7 +84,7 @@ inline ReturnValue_t Service11TelecommandScheduling::performService TmTcMessage releaseMsg(it->second.storeAddr); auto sendRet = this->requestQueue->sendMessage(recipientMsgQueueId, &releaseMsg, false); - if (sendRet != HasReturnvaluesIF::RETURN_OK) { + if (sendRet != returnvalue::OK) { return sendRet; } if (debugMode) { @@ -103,13 +103,13 @@ inline ReturnValue_t Service11TelecommandScheduling::performService it++; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } template inline ReturnValue_t Service11TelecommandScheduling::initialize() { ReturnValue_t res = PusServiceBase::initialize(); - if (res != HasReturnvaluesIF::RETURN_OK) { + if (res != returnvalue::OK) { return res; } @@ -130,7 +130,7 @@ template inline ReturnValue_t Service11TelecommandScheduling::handleResetCommand() { for (auto it = telecommandMap.begin(); it != telecommandMap.end(); it++) { ReturnValue_t result = tcStore->deleteData(it->second.storeAddr); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 // This should not happen sif::warning << "Service11TelecommandScheduling::handleRequestDeleting: Deletion failed" @@ -143,7 +143,7 @@ inline ReturnValue_t Service11TelecommandScheduling::handleResetCom } } telecommandMap.clear(); - return RETURN_OK; + return returnvalue::OK; } template @@ -151,7 +151,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doInsertActivi const uint8_t *data, size_t size) { uint32_t timestamp = 0; ReturnValue_t result = SerializeAdapter::deSerialize(×tamp, &data, &size, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -169,12 +169,12 @@ inline ReturnValue_t Service11TelecommandScheduling::doInsertActivi "Service11TelecommandScheduling::doInsertActivity: Release time too close to current " "time\n"); #endif - return RETURN_FAILED; + return returnvalue::FAILED; } // store currentPacket and receive the store address store_address_t addr{}; - if (tcStore->addData(&addr, data, size) != RETURN_OK || + if (tcStore->addData(&addr, data, size) != returnvalue::OK || addr.raw == storeId::INVALID_STORE_ADDRESS) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Service11TelecommandScheduling::doInsertActivity: Adding data to TC Store failed" @@ -183,7 +183,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doInsertActivi sif::printError( "Service11TelecommandScheduling::doInsertActivity: Adding data to TC Store failed\n"); #endif - return RETURN_FAILED; + return returnvalue::FAILED; } // insert into multimap with new store address @@ -195,7 +195,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doInsertActivi auto it = telecommandMap.insert(std::pair(timestamp, tc)); if (it == telecommandMap.end()) { - return RETURN_FAILED; + return returnvalue::FAILED; } if (debugMode) { @@ -206,7 +206,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doInsertActivi #endif debugPrintMultimapContent(); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } template @@ -215,7 +215,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doDeleteActivi // Get request ID uint64_t requestId; ReturnValue_t result = getRequestIdFromData(data, size, requestId); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -249,11 +249,11 @@ inline ReturnValue_t Service11TelecommandScheduling::doDeleteActivi "Service11TelecommandScheduling::doDeleteActivity: No or more than 1 TC found. " "Cannot explicitly delete TC"); #endif - return RETURN_FAILED; + return returnvalue::FAILED; } // delete packet from store - if (tcStore->deleteData(tcToDelete->second.storeAddr) != RETURN_OK) { + if (tcStore->deleteData(tcToDelete->second.storeAddr) != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Service11TelecommandScheduling::doDeleteActivity: Could not delete TC from Store" << std::endl; @@ -261,7 +261,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doDeleteActivi sif::printError( "Service11TelecommandScheduling::doDeleteActivity: Could not delete TC from Store\n"); #endif - return RETURN_FAILED; + return returnvalue::FAILED; } telecommandMap.erase(tcToDelete); @@ -273,7 +273,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doDeleteActivi #endif } - return RETURN_OK; + return returnvalue::OK; } template @@ -284,14 +284,14 @@ inline ReturnValue_t Service11TelecommandScheduling::doFilterDelete ReturnValue_t result = getMapFilterFromData(data, size, itBegin, itEnd); // get the filter window as map range via dedicated method - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } int deletedTCs = 0; for (TcMapIter it = itBegin; it != itEnd; it++) { // delete packet from store - if (tcStore->deleteData(it->second.storeAddr) != RETURN_OK) { + if (tcStore->deleteData(it->second.storeAddr) != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Service11TelecommandScheduling::doFilterDeleteActivity: Could not delete TC " "from Store" @@ -322,7 +322,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doFilterDelete sif::printInfo("PUS11::doFilterDeleteActivity: Deleted %d TCs\n", deletedTCs); #endif } - return RETURN_OK; + return returnvalue::OK; } template @@ -331,7 +331,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doTimeshiftAct // Get relative time uint32_t relativeTime = 0; ReturnValue_t result = SerializeAdapter::deSerialize(&relativeTime, &data, &size, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (relativeTime == 0) { @@ -342,7 +342,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doTimeshiftAct // Get request ID uint64_t requestId; result = getRequestIdFromData(data, size, requestId); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -400,7 +400,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doTimeshiftAct debugPrintMultimapContent(); } - return RETURN_OK; + return returnvalue::OK; } template @@ -409,7 +409,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doFilterTimesh // Get relative time uint32_t relativeTime = 0; ReturnValue_t result = SerializeAdapter::deSerialize(&relativeTime, &data, &size, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (relativeTime == 0) { @@ -420,7 +420,7 @@ inline ReturnValue_t Service11TelecommandScheduling::doFilterTimesh TcMapIter itBegin; TcMapIter itEnd; result = getMapFilterFromData(data, size, itBegin, itEnd); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -449,9 +449,9 @@ inline ReturnValue_t Service11TelecommandScheduling::doFilterTimesh } if (shiftedItemsCount > 0) { - return RETURN_OK; + return returnvalue::OK; } - return RETURN_FAILED; + return returnvalue::FAILED; } template @@ -474,20 +474,20 @@ inline ReturnValue_t Service11TelecommandScheduling::getRequestIdFr uint16_t ssc = 0; ReturnValue_t result = SerializeAdapter::deSerialize(&srcId, &data, &dataSize, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&apid, &data, &dataSize, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&ssc, &data, &dataSize, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } requestId = buildRequestId(srcId, apid, ssc); - return RETURN_OK; + return returnvalue::OK; } template @@ -507,7 +507,7 @@ inline ReturnValue_t Service11TelecommandScheduling::getMapFilterFr // get filter type first uint32_t typeRaw = 0; ReturnValue_t result = SerializeAdapter::deSerialize(&typeRaw, &data, &dataSize, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -530,7 +530,7 @@ inline ReturnValue_t Service11TelecommandScheduling::getMapFilterFr case TypeOfTimeWindow::FROM_TIMETAG: { uint32_t fromTimestamp = 0; result = SerializeAdapter::deSerialize(&fromTimestamp, &data, &dataSize, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -546,7 +546,7 @@ inline ReturnValue_t Service11TelecommandScheduling::getMapFilterFr case TypeOfTimeWindow::TO_TIMETAG: { uint32_t toTimestamp; result = SerializeAdapter::deSerialize(&toTimestamp, &data, &dataSize, DEF_END); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } itBegin = telecommandMap.begin(); @@ -563,12 +563,12 @@ inline ReturnValue_t Service11TelecommandScheduling::getMapFilterFr result = SerializeAdapter::deSerialize(&fromTimestamp, &data, &dataSize, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&toTimestamp, &data, &dataSize, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } itBegin = telecommandMap.begin(); @@ -584,7 +584,7 @@ inline ReturnValue_t Service11TelecommandScheduling::getMapFilterFr } default: - return RETURN_FAILED; + return returnvalue::FAILED; } // additional security check, this should never be true @@ -593,11 +593,11 @@ inline ReturnValue_t Service11TelecommandScheduling::getMapFilterFr #else sif::printError("11::GetMapFilterFromData: itBegin > itEnd\n"); #endif - return RETURN_FAILED; + return returnvalue::FAILED; } // the map range should now be set according to the sent filter. - return RETURN_OK; + return returnvalue::OK; } template @@ -610,7 +610,7 @@ inline ReturnValue_t Service11TelecommandScheduling::handleInvalidD sif::printWarning("Service11TelecommandScheduling::%s: Invalid buffer\n", ctx); #endif #endif - return RETURN_FAILED; + return returnvalue::FAILED; } template diff --git a/src/fsfw/pus/Service17Test.cpp b/src/fsfw/pus/Service17Test.cpp index f784acf4..acc48819 100644 --- a/src/fsfw/pus/Service17Test.cpp +++ b/src/fsfw/pus/Service17Test.cpp @@ -21,7 +21,7 @@ ReturnValue_t Service17Test::handleRequest(uint8_t subservice) { packetSubCounter++); #endif connectionPacket.sendPacket(requestQueue->getDefaultDestination(), requestQueue->getId()); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case Subservice::EVENT_TRIGGER_TEST: { #if FSFW_USE_PUS_C_TELEMETRY == 0 @@ -33,11 +33,11 @@ ReturnValue_t Service17Test::handleRequest(uint8_t subservice) { #endif connectionPacket.sendPacket(requestQueue->getDefaultDestination(), requestQueue->getId()); triggerEvent(TEST, 1234, 5678); - return RETURN_OK; + return returnvalue::OK; } default: return AcceptsTelecommandsIF::INVALID_SUBSERVICE; } } -ReturnValue_t Service17Test::performService() { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t Service17Test::performService() { return returnvalue::OK; } diff --git a/src/fsfw/pus/Service1TelecommandVerification.cpp b/src/fsfw/pus/Service1TelecommandVerification.cpp index 13d6a1c4..2e96a33a 100644 --- a/src/fsfw/pus/Service1TelecommandVerification.cpp +++ b/src/fsfw/pus/Service1TelecommandVerification.cpp @@ -30,15 +30,15 @@ MessageQueueId_t Service1TelecommandVerification::getVerificationQueue() { ReturnValue_t Service1TelecommandVerification::performOperation(uint8_t operationCode) { PusVerificationMessage message; ReturnValue_t status = tmQueue->receiveMessage(&message); - while (status == HasReturnvaluesIF::RETURN_OK) { + while (status == returnvalue::OK) { status = sendVerificationReport(&message); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { return status; } status = tmQueue->receiveMessage(&message); } if (status == MessageQueueIF::EMPTY) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return status; } @@ -52,7 +52,7 @@ ReturnValue_t Service1TelecommandVerification::sendVerificationReport( } else { result = generateSuccessReport(message); } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Service1TelecommandVerification::sendVerificationReport: " "Sending verification packet failed !" diff --git a/src/fsfw/pus/Service1TelecommandVerification.h b/src/fsfw/pus/Service1TelecommandVerification.h index 10d2da0e..02a5e513 100644 --- a/src/fsfw/pus/Service1TelecommandVerification.h +++ b/src/fsfw/pus/Service1TelecommandVerification.h @@ -38,8 +38,7 @@ */ class Service1TelecommandVerification : public AcceptsVerifyMessageIF, public SystemObject, - public ExecutableObjectIF, - public HasReturnvaluesIF { + public ExecutableObjectIF { public: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_1; diff --git a/src/fsfw/pus/Service20ParameterManagement.cpp b/src/fsfw/pus/Service20ParameterManagement.cpp index 61e29412..382aea00 100644 --- a/src/fsfw/pus/Service20ParameterManagement.cpp +++ b/src/fsfw/pus/Service20ParameterManagement.cpp @@ -20,7 +20,7 @@ ReturnValue_t Service20ParameterManagement::isValidSubservice(uint8_t subservice switch (static_cast(subservice)) { case Subservice::PARAMETER_LOAD: case Subservice::PARAMETER_DUMP: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Invalid Subservice for Service 20" << std::endl; @@ -37,7 +37,7 @@ ReturnValue_t Service20ParameterManagement::getMessageQueueAndObject(uint8_t sub MessageQueueId_t* id, object_id_t* objectId) { ReturnValue_t result = checkAndAcquireTargetID(objectId, tcData, tcDataLen); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } return checkInterfaceAndAcquireMessageQueue(id, objectId); @@ -47,7 +47,7 @@ ReturnValue_t Service20ParameterManagement::checkAndAcquireTargetID(object_id_t* const uint8_t* tcData, size_t tcDataLen) { if (SerializeAdapter::deSerialize(objectIdToSet, &tcData, &tcDataLen, - SerializeIF::Endianness::BIG) != HasReturnvaluesIF::RETURN_OK) { + SerializeIF::Endianness::BIG) != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Service20ParameterManagement::checkAndAcquireTargetID: " << "Invalid data." << std::endl; @@ -58,7 +58,7 @@ ReturnValue_t Service20ParameterManagement::checkAndAcquireTargetID(object_id_t* #endif return CommandingServiceBase::INVALID_TC; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service20ParameterManagement::checkInterfaceAndAcquireMessageQueue( @@ -83,7 +83,7 @@ ReturnValue_t Service20ParameterManagement::checkInterfaceAndAcquireMessageQueue return CommandingServiceBase::INVALID_OBJECT; } *messageQueueToSet = possibleTarget->getCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service20ParameterManagement::prepareCommand(CommandMessage* message, @@ -98,7 +98,7 @@ ReturnValue_t Service20ParameterManagement::prepareCommand(CommandMessage* messa return prepareLoadCommand(message, tcData, tcDataLen); } break; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -111,7 +111,7 @@ ReturnValue_t Service20ParameterManagement::prepareDumpCommand(CommandMessage* m tcDataLen -= sizeof(object_id_t); ParameterId_t parameterId; if (SerializeAdapter::deSerialize(¶meterId, &tcData, &tcDataLen, - SerializeIF::Endianness::BIG) != HasReturnvaluesIF::RETURN_OK) { + SerializeIF::Endianness::BIG) != returnvalue::OK) { return CommandingServiceBase::INVALID_TC; } /* The length should have been decremented to 0 by this point */ @@ -120,7 +120,7 @@ ReturnValue_t Service20ParameterManagement::prepareDumpCommand(CommandMessage* m } ParameterMessage::setParameterDumpCommand(message, parameterId); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service20ParameterManagement::prepareLoadCommand(CommandMessage* message, @@ -138,7 +138,7 @@ ReturnValue_t Service20ParameterManagement::prepareLoadCommand(CommandMessage* m return CommandingServiceBase::INVALID_TC; } ReturnValue_t result = IPCStore->getFreeElement(&storeAddress, parameterDataLen, &storePointer); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -151,14 +151,14 @@ ReturnValue_t Service20ParameterManagement::prepareLoadCommand(CommandMessage* m 4. Number of columns */ ParameterLoadCommand command(storePointer, parameterDataLen); result = command.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } ParameterMessage::setParameterLoadCommand(message, command.getParameterId(), storeAddress, command.getPtc(), command.getPfc(), command.getRows(), command.getColumns()); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service20ParameterManagement::handleReply(const CommandMessage* reply, @@ -170,15 +170,15 @@ ReturnValue_t Service20ParameterManagement::handleReply(const CommandMessage* re switch (replyId) { case ParameterMessage::REPLY_PARAMETER_DUMP: { ConstAccessorPair parameterData = IPCStore->getData(ParameterMessage::getStoreId(reply)); - if (parameterData.first != HasReturnvaluesIF::RETURN_OK) { - return HasReturnvaluesIF::RETURN_FAILED; + if (parameterData.first != returnvalue::OK) { + return returnvalue::FAILED; } ParameterId_t parameterId = ParameterMessage::getParameterId(reply); ParameterDumpReply parameterReply(objectId, parameterId, parameterData.second.data(), parameterData.second.size()); sendTmPacket(static_cast(Subservice::PARAMETER_DUMP_REPLY), ¶meterReply); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } default: return CommandingServiceBase::INVALID_REPLY; diff --git a/src/fsfw/pus/Service2DeviceAccess.cpp b/src/fsfw/pus/Service2DeviceAccess.cpp index 3430271e..a1bf8121 100644 --- a/src/fsfw/pus/Service2DeviceAccess.cpp +++ b/src/fsfw/pus/Service2DeviceAccess.cpp @@ -23,7 +23,7 @@ ReturnValue_t Service2DeviceAccess::isValidSubservice(uint8_t subservice) { switch (static_cast(subservice)) { case Subservice::COMMAND_RAW_COMMANDING: case Subservice::COMMAND_TOGGLE_WIRETAPPING: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Invalid Subservice" << std::endl; @@ -51,7 +51,7 @@ ReturnValue_t Service2DeviceAccess::checkInterfaceAndAcquireMessageQueue( return CommandingServiceBase::INVALID_OBJECT; } *messageQueueToSet = possibleTarget->getCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service2DeviceAccess::prepareCommand(CommandMessage* message, uint8_t subservice, @@ -65,7 +65,7 @@ ReturnValue_t Service2DeviceAccess::prepareCommand(CommandMessage* message, uint return prepareWiretappingCommand(message, tcData, tcDataLen); } break; default: - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -99,7 +99,7 @@ ReturnValue_t Service2DeviceAccess::handleReply(const CommandMessage* reply, object_id_t objectId, bool* isStep) { switch (reply->getCommand()) { case CommandMessage::REPLY_COMMAND_OK: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; case CommandMessage::REPLY_REJECTED: return reply->getReplyRejectedReason(); default: @@ -136,7 +136,7 @@ void Service2DeviceAccess::sendWiretappingTm(CommandMessage* reply, uint8_t subs const uint8_t* data = nullptr; size_t size = 0; ReturnValue_t result = IPCStore->getData(storeAddress, &data, &size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Service2DeviceAccess::sendWiretappingTm: Data Lost in " "handleUnrequestedReply with failure ID " diff --git a/src/fsfw/pus/Service3Housekeeping.cpp b/src/fsfw/pus/Service3Housekeeping.cpp index 07574783..1a1c87ff 100644 --- a/src/fsfw/pus/Service3Housekeeping.cpp +++ b/src/fsfw/pus/Service3Housekeeping.cpp @@ -22,7 +22,7 @@ ReturnValue_t Service3Housekeeping::isValidSubservice(uint8_t subservice) { case Subservice::GENERATE_ONE_DIAGNOSTICS_REPORT: case Subservice::MODIFY_PARAMETER_REPORT_COLLECTION_INTERVAL: case Subservice::MODIFY_DIAGNOSTICS_REPORT_COLLECTION_INTERVAL: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; // Telemetry or invalid subservice. case Subservice::HK_DEFINITIONS_REPORT: case Subservice::DIAGNOSTICS_DEFINITION_REPORT: @@ -38,7 +38,7 @@ ReturnValue_t Service3Housekeeping::getMessageQueueAndObject(uint8_t subservice, size_t tcDataLen, MessageQueueId_t* id, object_id_t* objectId) { ReturnValue_t result = checkAndAcquireTargetID(objectId, tcData, tcDataLen); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } return checkInterfaceAndAcquireMessageQueue(id, objectId); @@ -48,10 +48,10 @@ ReturnValue_t Service3Housekeeping::checkAndAcquireTargetID(object_id_t* objectI const uint8_t* tcData, size_t tcDataLen) { if (SerializeAdapter::deSerialize(objectIdToSet, &tcData, &tcDataLen, - SerializeIF::Endianness::BIG) != HasReturnvaluesIF::RETURN_OK) { + SerializeIF::Endianness::BIG) != returnvalue::OK) { return CommandingServiceBase::INVALID_TC; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service3Housekeeping::checkInterfaceAndAcquireMessageQueue( @@ -63,7 +63,7 @@ ReturnValue_t Service3Housekeeping::checkInterfaceAndAcquireMessageQueue( return CommandingServiceBase::INVALID_OBJECT; } *messageQueueToSet = possibleTarget->getCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service3Housekeeping::prepareCommand(CommandMessage* message, uint8_t subservice, @@ -100,9 +100,9 @@ ReturnValue_t Service3Housekeeping::prepareCommand(CommandMessage* message, uint return CommandingServiceBase::INVALID_TC; default: // should never happen, subservice was already checked. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service3Housekeeping::prepareReportingTogglingCommand( @@ -116,7 +116,7 @@ ReturnValue_t Service3Housekeeping::prepareReportingTogglingCommand( sid_t targetSid = buildSid(objectId, &tcData, &tcDataLen); HousekeepingMessage::setToggleReportingCommand(command, targetSid, enableReporting, isDiagnostics); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service3Housekeeping::prepareStructureReportingCommand(CommandMessage* command, @@ -131,7 +131,7 @@ ReturnValue_t Service3Housekeeping::prepareStructureReportingCommand(CommandMess sid_t targetSid = buildSid(objectId, &tcData, &tcDataLen); HousekeepingMessage::setStructureReportingCommand(command, targetSid, isDiagnostics); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service3Housekeeping::prepareOneShotReportCommand(CommandMessage* command, @@ -146,7 +146,7 @@ ReturnValue_t Service3Housekeeping::prepareOneShotReportCommand(CommandMessage* sid_t targetSid = buildSid(objectId, &tcData, &tcDataLen); HousekeepingMessage::setOneShotReportCommand(command, targetSid, isDiagnostics); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service3Housekeeping::prepareCollectionIntervalModificationCommand( @@ -163,7 +163,7 @@ ReturnValue_t Service3Housekeeping::prepareCollectionIntervalModificationCommand SerializeIF::Endianness::BIG); HousekeepingMessage::setCollectionIntervalModificationCommand( command, targetSid, newCollectionInterval, isDiagnostics); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply, @@ -174,7 +174,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply, switch (command) { case (HousekeepingMessage::HK_REPORT): { ReturnValue_t result = generateHkReply(reply, static_cast(Subservice::HK_REPORT)); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return CommandingServiceBase::EXECUTION_COMPLETE; @@ -183,7 +183,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply, case (HousekeepingMessage::DIAGNOSTICS_REPORT): { ReturnValue_t result = generateHkReply(reply, static_cast(Subservice::DIAGNOSTICS_REPORT)); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return CommandingServiceBase::EXECUTION_COMPLETE; @@ -205,7 +205,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply, case (HousekeepingMessage::HK_REQUEST_FAILURE): { failureParameter1 = objectId; - ReturnValue_t error = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t error = returnvalue::FAILED; HousekeepingMessage::getHkRequestFailureReply(reply, &error); failureParameter2 = error; return CommandingServiceBase::EXECUTION_COMPLETE; @@ -223,11 +223,11 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply, #endif return CommandingServiceBase::INVALID_REPLY; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void Service3Housekeeping::handleUnrequestedReply(CommandMessage* reply) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; Command_t command = reply->getCommand(); switch (command) { @@ -264,7 +264,7 @@ void Service3Housekeeping::handleUnrequestedReply(CommandMessage* reply) { } } - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { /* Configuration error */ #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "Service3Housekeeping::handleUnrequestedReply: Could not generate reply!" @@ -285,7 +285,7 @@ ReturnValue_t Service3Housekeeping::generateHkReply(const CommandMessage* hkMess sid_t sid = HousekeepingMessage::getHkDataReply(hkMessage, &storeId); auto resultPair = IPCStore->getData(storeId); - if (resultPair.first != HasReturnvaluesIF::RETURN_OK) { + if (resultPair.first != returnvalue::OK) { return resultPair.first; } diff --git a/src/fsfw/pus/Service5EventReporting.cpp b/src/fsfw/pus/Service5EventReporting.cpp index 987217dc..d267c803 100644 --- a/src/fsfw/pus/Service5EventReporting.cpp +++ b/src/fsfw/pus/Service5EventReporting.cpp @@ -21,17 +21,17 @@ Service5EventReporting::~Service5EventReporting() { ReturnValue_t Service5EventReporting::performService() { EventMessage message; - ReturnValue_t status = RETURN_OK; + ReturnValue_t status = returnvalue::OK; for (uint8_t counter = 0; counter < maxNumberReportsPerCycle; counter++) { // Receive messages even if reporting is disabled for now. status = eventQueue->receiveMessage(&message); if (status == MessageQueueIF::EMPTY) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } if (enableEventReport) { status = generateEventReport(message); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { return status; } } @@ -39,7 +39,7 @@ ReturnValue_t Service5EventReporting::performService() { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "Service5EventReporting::generateEventReport: Too many events" << std::endl; #endif - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service5EventReporting::generateEventReport(EventMessage message) { @@ -54,7 +54,7 @@ ReturnValue_t Service5EventReporting::generateEventReport(EventMessage message) #endif ReturnValue_t result = tmPacket.sendPacket(requestQueue->getDefaultDestination(), requestQueue->getId()); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "Service5EventReporting::generateEventReport: " "Could not send TM packet" @@ -72,11 +72,11 @@ ReturnValue_t Service5EventReporting::handleRequest(uint8_t subservice) { switch (subservice) { case Subservice::ENABLE: { enableEventReport = true; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case Subservice::DISABLE: { enableEventReport = false; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } default: return AcceptsTelecommandsIF::INVALID_SUBSERVICE; @@ -88,11 +88,11 @@ ReturnValue_t Service5EventReporting::handleRequest(uint8_t subservice) { ReturnValue_t Service5EventReporting::initialize() { auto* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); if (manager == nullptr) { - return RETURN_FAILED; + return returnvalue::FAILED; } // register Service 5 as listener for events ReturnValue_t result = manager->registerListener(eventQueue->getId(), true); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return PusServiceBase::initialize(); diff --git a/src/fsfw/pus/Service8FunctionManagement.cpp b/src/fsfw/pus/Service8FunctionManagement.cpp index be8d9058..4f552ec8 100644 --- a/src/fsfw/pus/Service8FunctionManagement.cpp +++ b/src/fsfw/pus/Service8FunctionManagement.cpp @@ -20,7 +20,7 @@ Service8FunctionManagement::~Service8FunctionManagement() {} ReturnValue_t Service8FunctionManagement::isValidSubservice(uint8_t subservice) { switch (static_cast(subservice)) { case Subservice::COMMAND_DIRECT_COMMANDING: - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: return AcceptsTelecommandsIF::INVALID_SUBSERVICE; } @@ -48,7 +48,7 @@ ReturnValue_t Service8FunctionManagement::checkInterfaceAndAcquireMessageQueue( return CommandingServiceBase::INVALID_OBJECT; } *messageQueueToSet = possibleTarget->getCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Service8FunctionManagement::prepareCommand(CommandMessage* message, @@ -62,7 +62,7 @@ ReturnValue_t Service8FunctionManagement::prepareDirectCommand(CommandMessage* m const uint8_t* tcData, size_t tcDataLen) { if (message == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (tcDataLen < sizeof(object_id_t) + sizeof(ActionId_t)) { #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -91,7 +91,7 @@ ReturnValue_t Service8FunctionManagement::handleReply(const CommandMessage* repl CommandMessage* optionalNextCommand, object_id_t objectId, bool* isStep) { Command_t replyId = reply->getCommand(); - ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; ActionId_t actionId = ActionMessage::getActionId(reply); ReturnValue_t returnCode = ActionMessage::getReturnCode(reply); @@ -103,7 +103,7 @@ ReturnValue_t Service8FunctionManagement::handleReply(const CommandMessage* repl } case ActionMessage::STEP_SUCCESS: { *isStep = true; - result = HasReturnvaluesIF::RETURN_OK; + result = returnvalue::OK; break; } case ActionMessage::DATA_REPLY: { @@ -131,7 +131,7 @@ ReturnValue_t Service8FunctionManagement::handleDataReply(const CommandMessage* size_t size = 0; const uint8_t* buffer = nullptr; ReturnValue_t result = IPCStore->getData(storeId, &buffer, &size); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "Service 8: Could not retrieve data for data reply" << std::endl; #endif @@ -141,7 +141,7 @@ ReturnValue_t Service8FunctionManagement::handleDataReply(const CommandMessage* result = sendTmPacket(static_cast(Subservice::REPLY_DIRECT_COMMANDING_DATA), &dataReply); auto deletionResult = IPCStore->deleteData(storeId); - if (deletionResult != HasReturnvaluesIF::RETURN_OK) { + if (deletionResult != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "Service8FunctionManagement::handleReply: Deletion" << " of data in pool failed." << std::endl; diff --git a/src/fsfw/pus/Service9TimeManagement.cpp b/src/fsfw/pus/Service9TimeManagement.cpp index 86eef93a..ea852f28 100644 --- a/src/fsfw/pus/Service9TimeManagement.cpp +++ b/src/fsfw/pus/Service9TimeManagement.cpp @@ -11,7 +11,7 @@ Service9TimeManagement::Service9TimeManagement(object_id_t objectId, uint16_t ap Service9TimeManagement::~Service9TimeManagement() {} -ReturnValue_t Service9TimeManagement::performService() { return RETURN_OK; } +ReturnValue_t Service9TimeManagement::performService() { return returnvalue::OK; } ReturnValue_t Service9TimeManagement::handleRequest(uint8_t subservice) { switch (subservice) { @@ -28,7 +28,7 @@ ReturnValue_t Service9TimeManagement::setTime() { TimePacket timePacket(currentPacket.getApplicationData(), currentPacket.getApplicationDataSize()); ReturnValue_t result = CCSDSTime::convertFromCcsds(&timeToSet, timePacket.getTime(), timePacket.getTimeSize()); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { triggerEvent(CLOCK_SET_FAILURE, result, 0); return result; } @@ -37,13 +37,13 @@ ReturnValue_t Service9TimeManagement::setTime() { Clock::getUptime(&formerUptime); result = Clock::setClock(&timeToSet); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { uint32_t newUptime; Clock::getUptime(&newUptime); triggerEvent(CLOCK_SET, newUptime, formerUptime); - return RETURN_OK; + return returnvalue::OK; } else { triggerEvent(CLOCK_SET_FAILURE, result, 0); - return RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/pus/servicepackets/Service1Packets.h b/src/fsfw/pus/servicepackets/Service1Packets.h index df70f670..1878f722 100644 --- a/src/fsfw/pus/servicepackets/Service1Packets.h +++ b/src/fsfw/pus/servicepackets/Service1Packets.h @@ -42,26 +42,26 @@ class FailureReport : public SerializeIF { //!< [EXPORT] : [SUBSERVICE] 2, 4, 6 SerializeIF::Endianness streamEndianness) const override { ReturnValue_t result = SerializeAdapter::serialize(&packetId, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&packetSequenceControl, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (failureSubtype == tc_verification::PROGRESS_FAILURE) { result = SerializeAdapter::serialize(&stepNumber, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } result = SerializeAdapter::serialize(&errorCode, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&errorParameter1, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -91,7 +91,7 @@ class FailureReport : public SerializeIF { //!< [EXPORT] : [SUBSERVICE] 2, 4, 6 */ ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, SerializeIF::Endianness streamEndianness) override { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } private: @@ -122,17 +122,17 @@ class SuccessReport : public SerializeIF { //!< [EXPORT] : [SUBSERVICE] 1, 3, 5 SerializeIF::Endianness streamEndianness) const override { ReturnValue_t result = SerializeAdapter::serialize(&packetId, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&packetSequenceControl, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (subtype == tc_verification::PROGRESS_SUCCESS) { result = SerializeAdapter::serialize(&stepNumber, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -151,7 +151,7 @@ class SuccessReport : public SerializeIF { //!< [EXPORT] : [SUBSERVICE] 1, 3, 5 ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, SerializeIF::Endianness streamEndianness) override { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } private: diff --git a/src/fsfw/pus/servicepackets/Service5Packets.h b/src/fsfw/pus/servicepackets/Service5Packets.h index 9ff2e4d4..05d92674 100644 --- a/src/fsfw/pus/servicepackets/Service5Packets.h +++ b/src/fsfw/pus/servicepackets/Service5Packets.h @@ -28,19 +28,19 @@ class EventReport : public SerializeIF { //!< [EXPORT] : [SUBSERVICE] 1, 2, 3, SerializeIF::Endianness streamEndianness) const override { ReturnValue_t result = SerializeAdapter::serialize(&reportId, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&objectId, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(¶meter1, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(¶meter2, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return result; @@ -57,7 +57,7 @@ class EventReport : public SerializeIF { //!< [EXPORT] : [SUBSERVICE] 1, 2, 3, virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, SerializeIF::Endianness streamEndianness) override { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } private: diff --git a/src/fsfw/returnvalues/HasReturnvaluesIF.h b/src/fsfw/returnvalues/HasReturnvaluesIF.h index 20c10e0b..45574056 100644 --- a/src/fsfw/returnvalues/HasReturnvaluesIF.h +++ b/src/fsfw/returnvalues/HasReturnvaluesIF.h @@ -8,35 +8,25 @@ #include "FwClassIds.h" #define MAKE_RETURN_CODE(number) ((INTERFACE_ID << 8) + (number)) + typedef uint16_t ReturnValue_t; -namespace result { -static constexpr ReturnValue_t OK = 0; -static constexpr ReturnValue_t FAILED = 1; +namespace returnvalue { + static const ReturnValue_t OK = 0; + static const ReturnValue_t FAILED = 1; -static constexpr ReturnValue_t makeCode(uint8_t classId, uint8_t number) { +/** + * It is discouraged to use the input parameters 0,0 and 0,1 as this + * will generate the RETURN_OK and returnvalue::FAILED returnvalues. + * @param interfaceId + * @param number + * @return + */ +static constexpr ReturnValue_t makeCode( + uint8_t classId, uint8_t number) { return (static_cast(classId) << 8) + number; } -} // namespace result -class HasReturnvaluesIF { - public: - static const ReturnValue_t RETURN_OK = result::OK; - static const ReturnValue_t RETURN_FAILED = result::FAILED; - - virtual ~HasReturnvaluesIF() = default; - - /** - * It is discouraged to use the input parameters 0,0 and 0,1 as this - * will generate the RETURN_OK and RETURN_FAILED returnvalues. - * @param interfaceId - * @param number - * @return - */ - [[deprecated("Use result::makeCode instead")]] static constexpr ReturnValue_t makeReturnCode( - uint8_t classId, uint8_t number) { - return result::makeCode(classId, number); - } -}; +} #endif /* FSFW_RETURNVALUES_HASRETURNVALUESIF_H_ */ diff --git a/src/fsfw/rmap/RmapDeviceCommunicationIF.cpp b/src/fsfw/rmap/RmapDeviceCommunicationIF.cpp index cf5d49ea..70a5e7a6 100644 --- a/src/fsfw/rmap/RmapDeviceCommunicationIF.cpp +++ b/src/fsfw/rmap/RmapDeviceCommunicationIF.cpp @@ -26,7 +26,7 @@ ReturnValue_t RmapDeviceCommunicationIF::readReceivedMessage(CookieIF *cookie, u ReturnValue_t RmapDeviceCommunicationIF::setAddress(CookieIF *cookie, uint32_t address) { ((RMAPCookie *)cookie)->setAddress(address); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } uint32_t RmapDeviceCommunicationIF::getAddress(CookieIF *cookie) { @@ -35,7 +35,7 @@ uint32_t RmapDeviceCommunicationIF::getAddress(CookieIF *cookie) { ReturnValue_t RmapDeviceCommunicationIF::setParameter(CookieIF *cookie, uint32_t parameter) { // TODO Empty? - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } uint32_t RmapDeviceCommunicationIF::getParameter(CookieIF *cookie) { return 0; } diff --git a/src/fsfw/serialize/SerialArrayListAdapter.h b/src/fsfw/serialize/SerialArrayListAdapter.h index d7c99aae..fa87ddbe 100644 --- a/src/fsfw/serialize/SerialArrayListAdapter.h +++ b/src/fsfw/serialize/SerialArrayListAdapter.h @@ -26,7 +26,7 @@ class SerialArrayListAdapter : public SerializeIF { ReturnValue_t result = SerializeAdapter::serialize(&list->size, buffer, size, maxSize, streamEndianness); count_t i = 0; - while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) { + while ((result == returnvalue::OK) && (i < list->size)) { result = SerializeAdapter::serialize(&list->entries[i], buffer, size, maxSize, streamEndianness); ++i; @@ -56,7 +56,7 @@ class SerialArrayListAdapter : public SerializeIF { size_t* size, Endianness streamEndianness) { count_t tempSize = 0; ReturnValue_t result = SerializeAdapter::deSerialize(&tempSize, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (tempSize > list->maxSize()) { @@ -65,7 +65,7 @@ class SerialArrayListAdapter : public SerializeIF { list->size = tempSize; count_t i = 0; - while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) { + while ((result == returnvalue::OK) && (i < list->size)) { result = SerializeAdapter::deSerialize(&list->front()[i], buffer, size, streamEndianness); ++i; } diff --git a/src/fsfw/serialize/SerialBufferAdapter.cpp b/src/fsfw/serialize/SerialBufferAdapter.cpp index 83129982..81919f37 100644 --- a/src/fsfw/serialize/SerialBufferAdapter.cpp +++ b/src/fsfw/serialize/SerialBufferAdapter.cpp @@ -30,7 +30,7 @@ ReturnValue_t SerialBufferAdapter::serialize(uint8_t** buffer, size_t* if (serializeLength) { ReturnValue_t result = SerializeAdapter::serialize(&bufferLength, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -46,11 +46,11 @@ ReturnValue_t SerialBufferAdapter::serialize(uint8_t** buffer, size_t* // set if non-const buffer is set. std::memcpy(*buffer, this->buffer, bufferLength); } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *size += bufferLength; (*buffer) += bufferLength; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } template @@ -66,14 +66,14 @@ template ReturnValue_t SerialBufferAdapter::deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { if (this->buffer == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (serializeLength) { count_t lengthField = 0; ReturnValue_t result = SerializeAdapter::deSerialize(&lengthField, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (lengthField > bufferLength) { @@ -86,7 +86,7 @@ ReturnValue_t SerialBufferAdapter::deSerialize(const uint8_t** buffer, *size -= bufferLength; std::memcpy(this->buffer, *buffer, bufferLength); (*buffer) += bufferLength; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return STREAM_TOO_SHORT; } diff --git a/src/fsfw/serialize/SerialLinkedListAdapter.h b/src/fsfw/serialize/SerialLinkedListAdapter.h index 4975c0a5..6c2fb7df 100644 --- a/src/fsfw/serialize/SerialLinkedListAdapter.h +++ b/src/fsfw/serialize/SerialLinkedListAdapter.h @@ -51,7 +51,7 @@ class SerialLinkedListAdapter : public SinglyLinkedList, public SerializeIF { count_t mySize = SinglyLinkedList::getSize(); ReturnValue_t result = SerializeAdapter::serialize(&mySize, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -60,8 +60,8 @@ class SerialLinkedListAdapter : public SinglyLinkedList, public SerializeIF { static ReturnValue_t serialize(const LinkedElement* element, uint8_t** buffer, size_t* size, size_t maxSize, Endianness streamEndianness) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - while ((result == HasReturnvaluesIF::RETURN_OK) and (element != nullptr)) { + ReturnValue_t result = returnvalue::OK; + while ((result == returnvalue::OK) and (element != nullptr)) { result = element->value->serialize(buffer, size, maxSize, streamEndianness); element = element->getNext(); } @@ -92,8 +92,8 @@ class SerialLinkedListAdapter : public SinglyLinkedList, public SerializeIF { static ReturnValue_t deSerialize(LinkedElement* element, const uint8_t** buffer, size_t* size, Endianness streamEndianness) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - while ((result == HasReturnvaluesIF::RETURN_OK) and (element != nullptr)) { + ReturnValue_t result = returnvalue::OK; + while ((result == returnvalue::OK) and (element != nullptr)) { result = element->value->deSerialize(buffer, size, streamEndianness); element = element->getNext(); } diff --git a/src/fsfw/serialize/SerializeAdapter.h b/src/fsfw/serialize/SerializeAdapter.h index 5feda889..31259b0f 100644 --- a/src/fsfw/serialize/SerializeAdapter.h +++ b/src/fsfw/serialize/SerializeAdapter.h @@ -39,7 +39,7 @@ class SerializeAdapter { * SerializeIF::Endianness * @return * - @c BUFFER_TOO_SHORT The given buffer in is too short - * - @c RETURN_FAILED Generic Error + * - @c returnvalue::FAILED Generic Error * - @c RETURN_OK Successful serialization */ template @@ -64,14 +64,14 @@ class SerializeAdapter { * SerializeIF::Endianness * @return * - @c BUFFER_TOO_SHORT The given buffer in is too short - * - @c RETURN_FAILED Generic Error + * - @c returnvalue::FAILED Generic Error * - @c RETURN_OK Successful serialization */ template static ReturnValue_t serialize(const T *object, uint8_t *const buffer, size_t *serSize, size_t maxSize, SerializeIF::Endianness streamEndianness) { if (object == nullptr or buffer == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } InternalSerializeAdapter::value> adapter; uint8_t **tempPtr = const_cast(&buffer); @@ -113,7 +113,7 @@ class SerializeAdapter { * @return * - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object * - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected - * - @c RETURN_FAILED Generic Error + * - @c returnvalue::FAILED Generic Error * - @c RETURN_OK Successful deserialization */ template @@ -136,14 +136,14 @@ class SerializeAdapter { * @return * - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object * - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected - * - @c RETURN_FAILED Generic Error + * - @c returnvalue::FAILED Generic Error * - @c RETURN_OK Successful deserialization */ template static ReturnValue_t deSerialize(T *object, const uint8_t *buffer, size_t *deserSize, SerializeIF::Endianness streamEndianness) { if (object == nullptr or buffer == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } InternalSerializeAdapter::value> adapter; const uint8_t **tempPtr = &buffer; @@ -200,7 +200,7 @@ class SerializeAdapter { std::memcpy(*buffer, &tmp, sizeof(T)); *size += sizeof(T); (*buffer) += sizeof(T); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return SerializeIF::BUFFER_TOO_SHORT; } @@ -226,7 +226,7 @@ class SerializeAdapter { } *buffer += sizeof(T); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } else { return SerializeIF::STREAM_TOO_SHORT; } diff --git a/src/fsfw/serialize/SerializeIF.h b/src/fsfw/serialize/SerializeIF.h index f20bf21f..a02b5f9e 100644 --- a/src/fsfw/serialize/SerializeIF.h +++ b/src/fsfw/serialize/SerializeIF.h @@ -56,7 +56,7 @@ class SerializeIF { * SerializeIF::Endianness * @return * - @c BUFFER_TOO_SHORT The given buffer in is too short - * - @c RETURN_FAILED Generic error + * - @c returnvalue::FAILED Generic error * - @c RETURN_OK Successful serialization */ [[nodiscard]] virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize, @@ -92,7 +92,7 @@ class SerializeIF { * @return * - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object * - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected - * - @c RETURN_FAILED Generic Error + * - @c returnvalue::FAILED Generic Error * - @c RETURN_OK Successful deserialization */ virtual ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size, diff --git a/src/fsfw/storagemanager/ConstStorageAccessor.cpp b/src/fsfw/storagemanager/ConstStorageAccessor.cpp index df2fc750..f64334f7 100644 --- a/src/fsfw/storagemanager/ConstStorageAccessor.cpp +++ b/src/fsfw/storagemanager/ConstStorageAccessor.cpp @@ -58,16 +58,16 @@ ReturnValue_t ConstStorageAccessor::getDataCopy(uint8_t* pointer, size_t maxSize #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "StorageAccessor: Not initialized!" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (size_ > maxSize) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "StorageAccessor: Supplied buffer not large enough" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } std::copy(constDataPointer, constDataPointer + size_, pointer); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void ConstStorageAccessor::release() { deleteData = false; } diff --git a/src/fsfw/storagemanager/LocalPool.cpp b/src/fsfw/storagemanager/LocalPool.cpp index cee1d407..b0376d2c 100644 --- a/src/fsfw/storagemanager/LocalPool.cpp +++ b/src/fsfw/storagemanager/LocalPool.cpp @@ -34,7 +34,7 @@ LocalPool::~LocalPool(void) {} ReturnValue_t LocalPool::addData(store_address_t* storageId, const uint8_t* data, size_t size, bool ignoreFault) { ReturnValue_t status = reserveSpace(size, storageId, ignoreFault); - if (status == RETURN_OK) { + if (status == returnvalue::OK) { write(*storageId, data, size); } return status; @@ -67,7 +67,7 @@ ConstAccessorPair LocalPool::getData(store_address_t storeId) { ReturnValue_t LocalPool::getFreeElement(store_address_t* storageId, const size_t size, uint8_t** pData, bool ignoreFault) { ReturnValue_t status = reserveSpace(size, storageId, ignoreFault); - if (status == RETURN_OK) { + if (status == returnvalue::OK) { *pData = &store[storageId->poolIndex][getRawPosition(*storageId)]; } else { *pData = nullptr; @@ -90,7 +90,7 @@ ReturnValue_t LocalPool::modifyData(store_address_t storeId, StorageAccessor& st } ReturnValue_t LocalPool::modifyData(store_address_t storeId, uint8_t** packetPtr, size_t* size) { - ReturnValue_t status = RETURN_FAILED; + ReturnValue_t status = returnvalue::FAILED; if (storeId.poolIndex >= NUMBER_OF_SUBPOOLS) { return ILLEGAL_STORAGE_ID; } @@ -102,7 +102,7 @@ ReturnValue_t LocalPool::modifyData(store_address_t storeId, uint8_t** packetPtr size_type packetPosition = getRawPosition(storeId); *packetPtr = &store[storeId.poolIndex][packetPosition]; *size = sizeLists[storeId.poolIndex][storeId.packetIndex]; - status = RETURN_OK; + status = returnvalue::OK; } else { status = DATA_DOES_NOT_EXIST; } @@ -117,7 +117,7 @@ ReturnValue_t LocalPool::deleteData(store_address_t storeId) { #endif #endif - ReturnValue_t status = RETURN_OK; + ReturnValue_t status = returnvalue::OK; size_type pageSize = getSubpoolElementSize(storeId.poolIndex); if ((pageSize != 0) and (storeId.packetIndex < numberOfElements[storeId.poolIndex])) { uint16_t packetPosition = getRawPosition(storeId); @@ -166,7 +166,7 @@ ReturnValue_t LocalPool::deleteData(uint8_t* ptr, size_t size, store_address_t* ReturnValue_t LocalPool::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } internalErrorReporter = @@ -186,7 +186,7 @@ ReturnValue_t LocalPool::initialize() { return StorageManagerIF::POOL_TOO_LARGE; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void LocalPool::clearStore() { @@ -202,7 +202,7 @@ void LocalPool::clearStore() { ReturnValue_t LocalPool::reserveSpace(const size_t size, store_address_t* storeId, bool ignoreFault) { ReturnValue_t status = getSubPoolIndex(size, &storeId->poolIndex); - if (status != RETURN_OK) { + if (status != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "LocalPool( " << std::hex << getObjectId() << std::dec << " )::reserveSpace: Packet too large." << std::endl; @@ -210,15 +210,15 @@ ReturnValue_t LocalPool::reserveSpace(const size_t size, store_address_t* storeI return status; } status = findEmpty(storeId->poolIndex, &storeId->packetIndex); - while (status != RETURN_OK && spillsToHigherPools) { + while (status != returnvalue::OK && spillsToHigherPools) { status = getSubPoolIndex(size, &storeId->poolIndex, storeId->poolIndex + 1); - if (status != RETURN_OK) { + if (status != returnvalue::OK) { // We don't find any fitting pool anymore. break; } status = findEmpty(storeId->poolIndex, &storeId->packetIndex); } - if (status == RETURN_OK) { + if (status == returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 2 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::debug << "Reserve: Pool: " << std::dec << storeId->poolIndex @@ -265,7 +265,7 @@ ReturnValue_t LocalPool::getSubPoolIndex(size_t packetSize, uint16_t* subpoolInd #endif if (elementSizes[n] >= packetSize) { *subpoolIndex = n; - return RETURN_OK; + return returnvalue::OK; } } return DATA_TOO_LARGE; @@ -280,7 +280,7 @@ ReturnValue_t LocalPool::findEmpty(n_pool_elem_t poolIndex, uint16_t* element) { for (uint16_t foundElement = 0; foundElement < numberOfElements[poolIndex]; foundElement++) { if (sizeLists[poolIndex][foundElement] == STORAGE_FREE) { *element = foundElement; - status = RETURN_OK; + status = returnvalue::OK; break; } } diff --git a/src/fsfw/storagemanager/StorageAccessor.cpp b/src/fsfw/storagemanager/StorageAccessor.cpp index b8096c1e..8a96dcec 100644 --- a/src/fsfw/storagemanager/StorageAccessor.cpp +++ b/src/fsfw/storagemanager/StorageAccessor.cpp @@ -26,7 +26,7 @@ ReturnValue_t StorageAccessor::getDataCopy(uint8_t* pointer, size_t maxSize) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "StorageAccessor: Not initialized!" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (size_ > maxSize) { #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -34,10 +34,10 @@ ReturnValue_t StorageAccessor::getDataCopy(uint8_t* pointer, size_t maxSize) { "enough" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } std::copy(dataPointer, dataPointer + size_, pointer); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } uint8_t* StorageAccessor::data() { @@ -54,7 +54,7 @@ ReturnValue_t StorageAccessor::write(uint8_t* data, size_t size, uint16_t offset #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "StorageAccessor: Not initialized!" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (offset + size > size_) { #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -62,10 +62,10 @@ ReturnValue_t StorageAccessor::write(uint8_t* data, size_t size, uint16_t offset "entry!" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } std::copy(data, data + size, dataPointer + offset); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void StorageAccessor::assignConstPointer() { constDataPointer = dataPointer; } diff --git a/src/fsfw/storagemanager/StorageManagerIF.h b/src/fsfw/storagemanager/StorageManagerIF.h index 375fc7cc..24ef2e45 100644 --- a/src/fsfw/storagemanager/StorageManagerIF.h +++ b/src/fsfw/storagemanager/StorageManagerIF.h @@ -25,7 +25,7 @@ using ConstAccessorPair = std::pair; * @author Bastian Baetz * @date 18.09.2012 */ -class StorageManagerIF : public HasReturnvaluesIF { +class StorageManagerIF { public: using size_type = size_t; using max_subpools_t = uint8_t; @@ -64,7 +64,7 @@ class StorageManagerIF : public HasReturnvaluesIF { * @param data The data to be stored in the StorageManager. * @param size The amount of data to be stored. * @return Returns @li RETURN_OK if data was added. - * @li RETURN_FAILED if data could not be added. + * @li returnvalue::FAILED if data could not be added. * storageId is unchanged then. */ virtual ReturnValue_t addData(store_address_t* storageId, const uint8_t* data, size_t size, @@ -74,7 +74,7 @@ class StorageManagerIF : public HasReturnvaluesIF { * identified by packet_id. * @param packet_id The identifier of the memory region to be freed. * @return @li RETURN_OK on success. - * @li RETURN_FAILED if deletion did not work + * @li returnvalue::FAILED if deletion did not work * (e.g. an illegal packet_id was passed). */ virtual ReturnValue_t deleteData(store_address_t packet_id) = 0; @@ -117,7 +117,7 @@ class StorageManagerIF : public HasReturnvaluesIF { * position * @param size The exact size of the stored data is returned here. * @return @li RETURN_OK on success. - * @li RETURN_FAILED if fetching data did not work + * @li returnvalue::FAILED if fetching data did not work * (e.g. an illegal packet_id was passed). */ virtual ReturnValue_t getData(store_address_t packet_id, const uint8_t** packet_ptr, @@ -157,7 +157,7 @@ class StorageManagerIF : public HasReturnvaluesIF { * @param size The size of the space to be reserved. * @param p_data A pointer to the element data is returned here. * @return Returns @li RETURN_OK if data was added. - * @li RETURN_FAILED if data could not be added. + * @li returnvalue::FAILED if data could not be added. * storageId is unchanged then. */ virtual ReturnValue_t getFreeElement(store_address_t* storageId, const size_t size, diff --git a/src/fsfw/subsystem/Subsystem.cpp b/src/fsfw/subsystem/Subsystem.cpp index 27e6ae8e..9495323d 100644 --- a/src/fsfw/subsystem/Subsystem.cpp +++ b/src/fsfw/subsystem/Subsystem.cpp @@ -39,12 +39,12 @@ ReturnValue_t Subsystem::checkSequence(HybridIterator iter, return TABLE_DOES_NOT_EXIST; } else { ReturnValue_t result = checkTable(getTable(iter->getTableId())); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } } } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t Subsystem::checkSequence(Mode_t sequence) { @@ -55,9 +55,9 @@ ReturnValue_t Subsystem::checkSequence(Mode_t sequence) { return checkSequence(iter, getFallbackSequence(sequence)); } -bool Subsystem::existsModeSequence(Mode_t id) { return modeSequences.exists(id) == RETURN_OK; } +bool Subsystem::existsModeSequence(Mode_t id) { return modeSequences.exists(id) == returnvalue::OK; } -bool Subsystem::existsModeTable(Mode_t id) { return modeTables.exists(id) == RETURN_OK; } +bool Subsystem::existsModeTable(Mode_t id) { return modeTables.exists(id) == returnvalue::OK; } HybridIterator Subsystem::getCurrentTable() { return getTable(currentSequenceIterator->getTableId()); @@ -67,7 +67,7 @@ void Subsystem::performChildOperation() { if (isInTransition) { if (commandsOutstanding <= 0) { // all children of the current table were commanded and replied if (currentSequenceIterator.value == nullptr) { // we're through with this sequence - if (checkStateAgainstTable(currentTargetTable, targetSubmode) == RETURN_OK) { + if (checkStateAgainstTable(currentTargetTable, targetSubmode) == returnvalue::OK) { setMode(targetMode, targetSubmode); isInTransition = false; return; @@ -82,7 +82,7 @@ void Subsystem::performChildOperation() { } } if (currentSequenceIterator->checkSuccess()) { - if (checkStateAgainstTable(getCurrentTable(), targetSubmode) != RETURN_OK) { + if (checkStateAgainstTable(getCurrentTable(), targetSubmode) != returnvalue::OK) { transitionFailed(TABLE_CHECK_FAILED, currentSequenceIterator->getTableId()); return; } @@ -111,7 +111,7 @@ void Subsystem::performChildOperation() { childrenChangedHealth = false; startTransition(mode, submode); } else if (childrenChangedMode) { - if (checkStateAgainstTable(currentTargetTable, submode) != RETURN_OK) { + if (checkStateAgainstTable(currentTargetTable, submode) != returnvalue::OK) { triggerEvent(CANT_KEEP_MODE, mode, submode); cantKeepMode(); } @@ -154,15 +154,15 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage *message) { size_t sizeRead; ReturnValue_t result = IPCStore->getData(ModeSequenceMessage::getStoreAddress(message), &pointer, &sizeRead); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { Mode_t fallbackId; size_t size = sizeRead; result = SerializeAdapter::deSerialize(&fallbackId, &pointer, &size, SerializeIF::Endianness::BIG); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { result = SerialArrayListAdapter::deSerialize(&sequence, &pointer, &size, SerializeIF::Endianness::BIG); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { result = addSequence(&sequence, ModeSequenceMessage::getSequenceId(message), fallbackId); } @@ -177,11 +177,11 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage *message) { size_t sizeRead; ReturnValue_t result = IPCStore->getData(ModeSequenceMessage::getStoreAddress(message), &pointer, &sizeRead); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { size_t size = sizeRead; result = SerialArrayListAdapter::deSerialize(&table, &pointer, &size, SerializeIF::Endianness::BIG); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { result = addTable(&table, ModeSequenceMessage::getSequenceId(message)); } IPCStore->deleteData(ModeSequenceMessage::getStoreAddress(message)); @@ -228,7 +228,7 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage *message) { Mode_t sequence = ModeSequenceMessage::getSequenceId(message); SequenceInfo *sequenceInfo = NULL; result = modeSequences.find(sequence, &sequenceInfo); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { replyToCommand(result, 0); } @@ -255,7 +255,7 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage *message) { Mode_t table = ModeSequenceMessage::getSequenceId(message); EntryPointer *entry = nullptr; result = modeTables.find(table, &entry); - if (result != RETURN_OK or entry == nullptr) { + if (result != returnvalue::OK or entry == nullptr) { replyToCommand(result, 0); if (entry == nullptr) { return result; @@ -292,13 +292,13 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage *message) { commandQueue->reply(&reply); } break; default: - return RETURN_FAILED; + return returnvalue::FAILED; } - return RETURN_OK; + return returnvalue::OK; } void Subsystem::replyToCommand(ReturnValue_t status, uint32_t parameter) { - if (status == RETURN_OK) { + if (status == returnvalue::OK) { CommandMessage reply(CommandMessage::REPLY_COMMAND_OK, 0, 0); commandQueue->reply(&reply); } else { @@ -322,7 +322,7 @@ ReturnValue_t Subsystem::addSequence(ArrayList *sequence, Mode_t if (!preInit) { result = checkSequence(HybridIterator(sequence->front(), sequence->back()), fallbackSequence); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -336,19 +336,19 @@ ReturnValue_t Subsystem::addSequence(ArrayList *sequence, Mode_t result = modeSequences.insert(id, info); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (inStore) { #if FSFW_USE_MODESTORE == 1 result = modeStore->storeArray(sequence, &(modeSequences.find(id)->entries.firstLinkedElement)); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { modeSequences.erase(id); } #else modeSequences.erase(id); - return RETURN_FAILED; + return returnvalue::FAILED; #endif } @@ -367,7 +367,7 @@ ReturnValue_t Subsystem::addTable(ArrayList *table, Mode_t id, bo // are not added yet. Tables added before are checked by initialize() if (!preInit) { result = checkTable(HybridIterator(table->front(), table->back())); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -379,19 +379,19 @@ ReturnValue_t Subsystem::addTable(ArrayList *table, Mode_t id, bo result = modeTables.insert(id, pointer); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (inStore) { #if FSFW_USE_MODESTORE == 1 result = modeStore->storeArray(table, &(modeTables.find(id)->firstLinkedElement)); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { modeTables.erase(id); } #else modeTables.erase(id); - return RETURN_FAILED; + return returnvalue::FAILED; #endif } return result; @@ -405,7 +405,7 @@ ReturnValue_t Subsystem::deleteSequence(Mode_t id) { SequenceInfo *sequenceInfo; ReturnValue_t result; result = modeSequences.find(id, &sequenceInfo); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (!sequenceInfo->entries.islinked) { @@ -416,7 +416,7 @@ ReturnValue_t Subsystem::deleteSequence(Mode_t id) { modeStore->deleteList(sequenceInfo->entries.firstLinkedElement); #endif modeSequences.erase(id); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t Subsystem::deleteTable(Mode_t id) { @@ -427,7 +427,7 @@ ReturnValue_t Subsystem::deleteTable(Mode_t id) { EntryPointer *pointer; ReturnValue_t result; result = modeTables.find(id, &pointer); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (!pointer->islinked) { @@ -438,26 +438,26 @@ ReturnValue_t Subsystem::deleteTable(Mode_t id) { modeStore->deleteList(pointer->firstLinkedElement); #endif modeSequences.erase(id); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t Subsystem::initialize() { ReturnValue_t result = SubsystemBase::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); if (IPCStore == NULL) { - return RETURN_FAILED; + return returnvalue::FAILED; } #if FSFW_USE_MODESTORE == 1 modeStore = ObjectManager::instance()->get(objects::MODE_STORE); if (modeStore == nullptr) { - return RETURN_FAILED; + return returnvalue::FAILED; } #endif @@ -469,7 +469,7 @@ ReturnValue_t Subsystem::initialize() { mode = initialMode; submode = initSubmode; - return RETURN_OK; + return returnvalue::OK; } MessageQueueId_t Subsystem::getSequenceCommandQueue() const { @@ -553,7 +553,7 @@ void Subsystem::transitionFailed(ReturnValue_t failureCode, uint32_t parameter) // so we come here at the next fail modeHelper.setForced(true); ReturnValue_t result; - if ((result = checkSequence(getFallbackSequence(mode))) != RETURN_OK) { + if ((result = checkSequence(getFallbackSequence(mode))) != returnvalue::OK) { triggerEvent(FALLBACK_FAILED, result, getFallbackSequence(mode)); // keep still and allow arbitrary mode commands to recover isInTransition = false; @@ -579,7 +579,7 @@ void Subsystem::sendSerializablesAsCommandMessage(Command_t command, SerializeIF size_t size = 0; result = IPCStore->getFreeElement(&address, maxSize, &storeBuffer); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { replyToCommand(result, 0); return; } @@ -588,21 +588,21 @@ void Subsystem::sendSerializablesAsCommandMessage(Command_t command, SerializeIF } CommandMessage reply; ModeSequenceMessage::setModeSequenceMessage(&reply, command, address); - if (commandQueue->reply(&reply) != RETURN_OK) { + if (commandQueue->reply(&reply) != returnvalue::OK) { IPCStore->deleteData(address); } } ReturnValue_t Subsystem::checkObjectConnections() { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; for (FixedMap::Iterator iter = modeSequences.begin(); iter != modeSequences.end(); iter++) { result = checkSequence(iter.value->first); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } } - return RETURN_OK; + return returnvalue::OK; } void Subsystem::setInitialMode(Mode_t mode, Submode_t submode) { @@ -612,7 +612,7 @@ void Subsystem::setInitialMode(Mode_t mode, Submode_t submode) { void Subsystem::cantKeepMode() { ReturnValue_t result; - if ((result = checkSequence(getFallbackSequence(mode))) != RETURN_OK) { + if ((result = checkSequence(getFallbackSequence(mode))) != returnvalue::OK) { triggerEvent(FALLBACK_FAILED, result, getFallbackSequence(mode)); return; } diff --git a/src/fsfw/subsystem/SubsystemBase.cpp b/src/fsfw/subsystem/SubsystemBase.cpp index 104db3c3..17bbdf46 100644 --- a/src/fsfw/subsystem/SubsystemBase.cpp +++ b/src/fsfw/subsystem/SubsystemBase.cpp @@ -42,7 +42,7 @@ ReturnValue_t SubsystemBase::registerChild(object_id_t objectId) { if (not resultPair.second) { return COULD_NOT_INSERT_CHILD; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t SubsystemBase::checkStateAgainstTable(HybridIterator tableIter, @@ -53,11 +53,11 @@ ReturnValue_t SubsystemBase::checkStateAgainstTable(HybridIteratorgetObject(); if ((childIter = childrenMap.find(object)) == childrenMap.end()) { - return RETURN_FAILED; + return returnvalue::FAILED; } if (childIter->second.mode != tableIter.value->getMode()) { - return RETURN_FAILED; + return returnvalue::FAILED; } Submode_t submodeToCheckAgainst = tableIter.value->getSubmode(); @@ -66,10 +66,10 @@ ReturnValue_t SubsystemBase::checkStateAgainstTable(HybridIteratorsecond.submode != submodeToCheckAgainst) { - return RETURN_FAILED; + return returnvalue::FAILED; } } - return RETURN_OK; + return returnvalue::OK; } void SubsystemBase::executeTable(HybridIterator tableIter, Submode_t targetSubmode) { @@ -122,7 +122,7 @@ void SubsystemBase::executeTable(HybridIterator tableIter, Submod // mode is forced to reach lower levels } ReturnValue_t result = commandQueue->sendMessage(iter->second.commandQueue, &command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { ++commandsOutstanding; } } @@ -136,7 +136,7 @@ ReturnValue_t SubsystemBase::updateChildMode(MessageQueueId_t queue, Mode_t mode if (iter->second.commandQueue == queue) { iter->second.mode = mode; iter->second.submode = submode; - return RETURN_OK; + return returnvalue::OK; } } return CHILD_NOT_FOUND; @@ -146,7 +146,7 @@ ReturnValue_t SubsystemBase::updateChildChangedHealth(MessageQueueId_t queue, bo for (auto iter = childrenMap.begin(); iter != childrenMap.end(); iter++) { if (iter->second.commandQueue == queue) { iter->second.healthChanged = changedHealth; - return RETURN_OK; + return returnvalue::OK; } } return CHILD_NOT_FOUND; @@ -158,14 +158,14 @@ ReturnValue_t SubsystemBase::initialize() { MessageQueueId_t parentQueue = MessageQueueIF::NO_QUEUE; ReturnValue_t result = SystemObject::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (parentId != objects::NO_OBJECT) { SubsystemBase* parent = ObjectManager::instance()->get(parentId); if (parent == nullptr) { - return RETURN_FAILED; + return returnvalue::FAILED; } parentQueue = parent->getCommandQueue(); @@ -174,17 +174,17 @@ ReturnValue_t SubsystemBase::initialize() { result = healthHelper.initialize(parentQueue); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = modeHelper.initialize(parentQueue); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t SubsystemBase::performOperation(uint8_t opCode) { @@ -194,7 +194,7 @@ ReturnValue_t SubsystemBase::performOperation(uint8_t opCode) { performChildOperation(); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t SubsystemBase::handleModeReply(CommandMessage* message) { @@ -203,14 +203,14 @@ ReturnValue_t SubsystemBase::handleModeReply(CommandMessage* message) { updateChildMode(message->getSender(), ModeMessage::getMode(message), ModeMessage::getSubmode(message)); childrenChangedMode = true; - return RETURN_OK; + return returnvalue::OK; case ModeMessage::REPLY_MODE_REPLY: case ModeMessage::REPLY_WRONG_MODE_REPLY: updateChildMode(message->getSender(), ModeMessage::getMode(message), ModeMessage::getSubmode(message)); childrenChangedMode = true; commandsOutstanding--; - return RETURN_OK; + return returnvalue::OK; case ModeMessage::REPLY_CANT_REACH_MODE: commandsOutstanding--; { @@ -220,7 +220,7 @@ ReturnValue_t SubsystemBase::handleModeReply(CommandMessage* message) { } } } - return RETURN_OK; + return returnvalue::OK; // case ModeMessage::CMD_MODE_COMMAND: // handleCommandedMode(message); // return RETURN_OK; @@ -232,7 +232,7 @@ ReturnValue_t SubsystemBase::handleModeReply(CommandMessage* message) { // commandAllChildren(message); // return RETURN_OK; default: - return RETURN_FAILED; + return returnvalue::FAILED; } } @@ -242,7 +242,7 @@ ReturnValue_t SubsystemBase::checkTable(HybridIterator tableIter) return TABLE_CONTAINS_INVALID_OBJECT_ID; } } - return RETURN_OK; + return returnvalue::OK; } void SubsystemBase::replyToCommand(CommandMessage* message) { commandQueue->reply(message); } @@ -284,25 +284,25 @@ void SubsystemBase::checkCommandQueue() { ReturnValue_t result; CommandMessage command; - for (result = commandQueue->receiveMessage(&command); result == RETURN_OK; + for (result = commandQueue->receiveMessage(&command); result == returnvalue::OK; result = commandQueue->receiveMessage(&command)) { result = healthHelper.handleHealthCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = modeHelper.handleModeCommand(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = handleModeReply(&command); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { continue; } result = handleCommandMessage(&command); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { CommandMessage reply; reply.setReplyRejected(CommandMessage::UNKNOWN_COMMAND, command.getCommand()); replyToCommand(&reply); @@ -315,7 +315,7 @@ ReturnValue_t SubsystemBase::setHealth(HealthState health) { case HEALTHY: case EXTERNAL_CONTROL: healthHelper.setHealth(health); - return RETURN_OK; + return returnvalue::OK; default: return INVALID_HEALTH_STATE; } diff --git a/src/fsfw/subsystem/SubsystemBase.h b/src/fsfw/subsystem/SubsystemBase.h index 52f9891e..ad341b80 100644 --- a/src/fsfw/subsystem/SubsystemBase.h +++ b/src/fsfw/subsystem/SubsystemBase.h @@ -20,7 +20,6 @@ class SubsystemBase : public SystemObject, public HasModesIF, public HasHealthIF, - public HasReturnvaluesIF, public ExecutableObjectIF { public: static const uint8_t INTERFACE_ID = CLASS_ID::SUBSYSTEM_BASE; diff --git a/src/fsfw/subsystem/modes/ModeDefinitions.h b/src/fsfw/subsystem/modes/ModeDefinitions.h index 9a6b8e31..d22bcd95 100644 --- a/src/fsfw/subsystem/modes/ModeDefinitions.h +++ b/src/fsfw/subsystem/modes/ModeDefinitions.h @@ -21,17 +21,17 @@ class ModeListEntry : public SerializeIF, public LinkedElement { result = SerializeAdapter::serialize(&value1, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&value2, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&value3, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -50,17 +50,17 @@ class ModeListEntry : public SerializeIF, public LinkedElement { result = SerializeAdapter::deSerialize(&value1, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&value2, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&value3, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&value4, buffer, size, streamEndianness); diff --git a/src/fsfw/subsystem/modes/ModeStore.cpp b/src/fsfw/subsystem/modes/ModeStore.cpp index c70b5e21..2fb16d31 100644 --- a/src/fsfw/subsystem/modes/ModeStore.cpp +++ b/src/fsfw/subsystem/modes/ModeStore.cpp @@ -54,28 +54,28 @@ ReturnValue_t ModeStore::storeArray(ArrayList* sequence, } pointer->setNext(NULL); OSAL::unlockMutex(mutex); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t ModeStore::deleteList(ModeListEntry* sequence) { ReturnValue_t result = isValidEntry(sequence); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } OSAL::lockMutex(mutex, OSAL::NO_TIMEOUT); deleteListNoLock(sequence); OSAL::unlockMutex(mutex); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t ModeStore::readList(ModeListEntry* sequence, ArrayList* into) { ReturnValue_t result = isValidEntry(sequence); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } OSAL::lockMutex(mutex, OSAL::NO_TIMEOUT); result = into->insert(*sequence->value); - while ((result == HasReturnvaluesIF::RETURN_OK) && (sequence->getNext() != NULL)) { + while ((result == returnvalue::OK) && (sequence->getNext() != NULL)) { result = into->insert(*sequence->value); sequence = sequence->getNext()->value; } @@ -117,7 +117,7 @@ ReturnValue_t ModeStore::isValidEntry(ModeListEntry* sequence) { if ((sequence < store.front()) || (sequence > store.back()) || sequence->getNext() == emptySlot) { return INVALID_ENTRY; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } #endif diff --git a/src/fsfw/tasks/ExecutableObjectIF.h b/src/fsfw/tasks/ExecutableObjectIF.h index 753a124f..60f38259 100644 --- a/src/fsfw/tasks/ExecutableObjectIF.h +++ b/src/fsfw/tasks/ExecutableObjectIF.h @@ -45,7 +45,7 @@ class ExecutableObjectIF { * called so the execution frequency can't be cached in initialize() * @return */ - virtual ReturnValue_t initializeAfterTaskCreation() { return HasReturnvaluesIF::RETURN_OK; } + virtual ReturnValue_t initializeAfterTaskCreation() { return returnvalue::OK; } }; #endif /* FRAMEWORK_TASKS_EXECUTABLEOBJECTIF_H_ */ diff --git a/src/fsfw/tasks/FixedSlotSequence.cpp b/src/fsfw/tasks/FixedSlotSequence.cpp index 9305b441..e538c9fc 100644 --- a/src/fsfw/tasks/FixedSlotSequence.cpp +++ b/src/fsfw/tasks/FixedSlotSequence.cpp @@ -98,7 +98,7 @@ ReturnValue_t FixedSlotSequence::checkSequence() const { if (customChecker != nullptr) { ReturnValue_t result = customChecker(slotList, customCheckArgs); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { // Continue for now but print error output. #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "FixedSlotSequence::checkSequence:" @@ -132,9 +132,9 @@ ReturnValue_t FixedSlotSequence::checkSequence() const { // << slotList.size() << std::endl; #endif if (errorCount > 0) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t FixedSlotSequence::intializeSequenceAfterTaskCreation() const { @@ -144,7 +144,7 @@ ReturnValue_t FixedSlotSequence::intializeSequenceAfterTaskCreation() const { // Ensure that each unique object is initialized once. if (uniqueObjects.find(slot.executableObject) == uniqueObjects.end()) { ReturnValue_t result = slot.executableObject->initializeAfterTaskCreation(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { count++; } uniqueObjects.emplace(slot.executableObject); @@ -156,9 +156,9 @@ ReturnValue_t FixedSlotSequence::intializeSequenceAfterTaskCreation() const { "Counted " << count << " failed initializations!" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void FixedSlotSequence::addCustomCheck(CustomCheckFunc customChecker_, void* checkerArgs_) { diff --git a/src/fsfw/tasks/FixedTimeslotTaskBase.cpp b/src/fsfw/tasks/FixedTimeslotTaskBase.cpp index 5d12d565..3327deae 100644 --- a/src/fsfw/tasks/FixedTimeslotTaskBase.cpp +++ b/src/fsfw/tasks/FixedTimeslotTaskBase.cpp @@ -20,8 +20,8 @@ ReturnValue_t FixedTimeslotTaskBase::addSlot(object_id_t execId, ExecutableObjec #else sif::printError("Component 0x%08x not found, not adding it to PST\n"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } pollingSeqTable.addSlot(execId, slotTimeMs, executionStep, execObj, this); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/tasks/FixedTimeslotTaskIF.h b/src/fsfw/tasks/FixedTimeslotTaskIF.h index c7b90ec3..916af639 100644 --- a/src/fsfw/tasks/FixedTimeslotTaskIF.h +++ b/src/fsfw/tasks/FixedTimeslotTaskIF.h @@ -15,7 +15,7 @@ class FixedTimeslotTaskIF : public PeriodicTaskIF { ~FixedTimeslotTaskIF() override = default; static constexpr ReturnValue_t SLOT_LIST_EMPTY = - result::makeCode(CLASS_ID::FIXED_SLOT_TASK_IF, 0); + returnvalue::makeCode(CLASS_ID::FIXED_SLOT_TASK_IF, 0); /** * Add an object with a slot time and the execution step to the task. @@ -51,11 +51,11 @@ class FixedTimeslotTaskIF : public PeriodicTaskIF { virtual ReturnValue_t checkSequence() = 0; ReturnValue_t addComponent(object_id_t object, uint8_t opCode) override { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t addComponent(ExecutableObjectIF* object, uint8_t opCode) override { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } }; diff --git a/src/fsfw/tasks/PeriodicTaskBase.cpp b/src/fsfw/tasks/PeriodicTaskBase.cpp index ce925a45..3ae8afe7 100644 --- a/src/fsfw/tasks/PeriodicTaskBase.cpp +++ b/src/fsfw/tasks/PeriodicTaskBase.cpp @@ -29,13 +29,13 @@ ReturnValue_t PeriodicTaskBase::addComponent(ExecutableObjectIF* object) { ReturnValue_t PeriodicTaskBase::initObjsAfterTaskCreation() { std::set uniqueObjects; - ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t status = returnvalue::OK; uint32_t count = 0; for (const auto& obj : objectList) { // Ensure that each unique object is initialized once. if (uniqueObjects.find(obj.first) == uniqueObjects.end()) { ReturnValue_t result = obj.first->initializeAfterTaskCreation(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { count++; status = result; } @@ -62,10 +62,10 @@ ReturnValue_t PeriodicTaskBase::addComponent(ExecutableObjectIF* object, uint8_t "PeriodicTask::addComponent: Invalid object. Make sure it " "implements ExecutableObjectIF!\n"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } objectList.push_back({object, opCode}); object->setTaskIF(this); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/tasks/PeriodicTaskIF.h b/src/fsfw/tasks/PeriodicTaskIF.h index 03b709ab..04415533 100644 --- a/src/fsfw/tasks/PeriodicTaskIF.h +++ b/src/fsfw/tasks/PeriodicTaskIF.h @@ -29,7 +29,7 @@ class PeriodicTaskIF { * The objects are executed in the order added. The object needs to implement * ExecutableObjectIF * @param object Id of the object to add. - * @return RETURN_OK on success, RETURN_FAILED if the object could not be added. + * @return RETURN_OK on success, returnvalue::FAILED if the object could not be added. */ virtual ReturnValue_t addComponent(object_id_t object, uint8_t opCode) = 0; virtual ReturnValue_t addComponent(object_id_t object) { return addComponent(object, 0); }; @@ -38,7 +38,7 @@ class PeriodicTaskIF { * Adds an object to the list of objects to be executed. * The objects are executed in the order added. * @param object pointer to the object to add. - * @return RETURN_OK on success, RETURN_FAILED if the object could not be added. + * @return RETURN_OK on success, returnvalue::FAILED if the object could not be added. */ virtual ReturnValue_t addComponent(ExecutableObjectIF* object, uint8_t opCode) = 0; virtual ReturnValue_t addComponent(ExecutableObjectIF* object) { return addComponent(object, 0); } diff --git a/src/fsfw/tcdistribution/CCSDSDistributor.cpp b/src/fsfw/tcdistribution/CCSDSDistributor.cpp index 628dd8d0..6202ca78 100644 --- a/src/fsfw/tcdistribution/CCSDSDistributor.cpp +++ b/src/fsfw/tcdistribution/CCSDSDistributor.cpp @@ -26,7 +26,7 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() { const uint8_t* packet = nullptr; size_t size = 0; ReturnValue_t result = this->tcStore->getData(currentMessage.getStorageId(), &packet, &size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "CCSDSDistributor::selectDestination: Getting data from" @@ -59,20 +59,20 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() { MessageQueueId_t CCSDSDistributor::getRequestQueue() { return tcQueue->getId(); } ReturnValue_t CCSDSDistributor::registerApplication(AcceptsTelecommandsIF* application) { - ReturnValue_t returnValue = RETURN_OK; + ReturnValue_t returnValue = returnvalue::OK; auto insertPair = this->queueMap.emplace(application->getIdentifier(), application->getRequestQueue()); if (not insertPair.second) { - returnValue = RETURN_FAILED; + returnValue = returnvalue::FAILED; } return returnValue; } ReturnValue_t CCSDSDistributor::registerApplication(uint16_t apid, MessageQueueId_t id) { - ReturnValue_t returnValue = RETURN_OK; + ReturnValue_t returnValue = returnvalue::OK; auto insertPair = this->queueMap.emplace(apid, id); if (not insertPair.second) { - returnValue = RETURN_FAILED; + returnValue = returnvalue::FAILED; } return returnValue; } @@ -94,14 +94,14 @@ ReturnValue_t CCSDSDistributor::initialize() { " TC store!\n"); #endif #endif - status = RETURN_FAILED; + status = returnvalue::FAILED; } return status; } ReturnValue_t CCSDSDistributor::callbackAfterSending(ReturnValue_t queueStatus) { - if (queueStatus != RETURN_OK) { + if (queueStatus != returnvalue::OK) { tcStore->deleteData(currentMessage.getStorageId()); } - return RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/tcdistribution/CCSDSDistributorIF.h b/src/fsfw/tcdistribution/CCSDSDistributorIF.h index d1c88118..a57379ea 100644 --- a/src/fsfw/tcdistribution/CCSDSDistributorIF.h +++ b/src/fsfw/tcdistribution/CCSDSDistributorIF.h @@ -18,7 +18,7 @@ class CCSDSDistributorIF { * at the distributor. * @param application A pointer to the Application to register. * @return - @c RETURN_OK on success, - * - @c RETURN_FAILED on failure. + * - @c returnvalue::FAILED on failure. */ virtual ReturnValue_t registerApplication(AcceptsTelecommandsIF* application) = 0; /** @@ -28,7 +28,7 @@ class CCSDSDistributorIF { * @param id The MessageQueueId of the message queue to send the * TC Packets to. * @return - @c RETURN_OK on success, - * - @c RETURN_FAILED on failure. + * - @c returnvalue::FAILED on failure. */ virtual ReturnValue_t registerApplication(uint16_t apid, MessageQueueId_t id) = 0; /** diff --git a/src/fsfw/tcdistribution/CFDPDistributor.cpp b/src/fsfw/tcdistribution/CFDPDistributor.cpp index d8be1543..20edc0f4 100644 --- a/src/fsfw/tcdistribution/CFDPDistributor.cpp +++ b/src/fsfw/tcdistribution/CFDPDistributor.cpp @@ -13,7 +13,7 @@ CFDPDistributor::CFDPDistributor(uint16_t setApid, object_id_t setObjectId, : TcDistributor(setObjectId), apid(setApid), checker(setApid), - tcStatus(RETURN_FAILED), + tcStatus(returnvalue::FAILED), packetSource(setPacketSource) {} CFDPDistributor::~CFDPDistributor() {} @@ -36,7 +36,7 @@ CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() { this->currentPacket->setStoreAddress(this->currentMessage.getStorageId()); if (currentPacket->getWholeData() != nullptr) { tcStatus = checker.checkPacket(currentPacket); - if (tcStatus != HasReturnvaluesIF::RETURN_OK) { + if (tcStatus != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::debug << "CFDPDistributor::handlePacket: Packet format invalid, code " @@ -63,7 +63,7 @@ CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() { #endif } - if (tcStatus != RETURN_OK) { + if (tcStatus != returnvalue::OK) { return this->queueMap.end(); } else { return queueMapIt; @@ -95,7 +95,7 @@ ReturnValue_t CFDPDistributor::registerHandler(AcceptsTelecommandsIF* handler) { #endif return SERVICE_ID_ALREADY_EXISTS; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } MessageQueueId_t CFDPDistributor::getRequestQueue() { return tcQueue->getId(); } @@ -110,7 +110,7 @@ MessageQueueId_t CFDPDistributor::getRequestQueue() { return tcQueue->getId(); } // // A failed packet is deleted immediately after reporting, // // otherwise it will block memory. // currentPacket->deletePacket(); -// return RETURN_FAILED; +// return returnvalue::FAILED; // } else { // this->verifyChannel.sendSuccessReport(tc_verification::ACCEPTANCE_SUCCESS, // currentPacket); @@ -137,7 +137,7 @@ ReturnValue_t CFDPDistributor::initialize() { sif::printError("CFDPDistributor::initialize: Packet source invalid\n"); sif::printError("Make sure it exists and implements CCSDSDistributorIF\n"); #endif - return RETURN_FAILED; + return returnvalue::FAILED; } return ccsdsDistributor->registerApplication(this); } diff --git a/src/fsfw/tcdistribution/CFDPDistributorIF.h b/src/fsfw/tcdistribution/CFDPDistributorIF.h index 3c1836f1..57cf9fde 100644 --- a/src/fsfw/tcdistribution/CFDPDistributorIF.h +++ b/src/fsfw/tcdistribution/CFDPDistributorIF.h @@ -18,7 +18,7 @@ class CFDPDistributorIF { * With this method, Handlers can register themselves at the CFDP Distributor. * @param handler A pointer to the registering Handler. * @return - @c RETURN_OK on success, - * - @c RETURN_FAILED on failure. + * - @c returnvalue::FAILED on failure. */ virtual ReturnValue_t registerHandler(AcceptsTelecommandsIF* handler) = 0; }; diff --git a/src/fsfw/tcdistribution/PUSDistributor.cpp b/src/fsfw/tcdistribution/PUSDistributor.cpp index dad002a1..a32a210f 100644 --- a/src/fsfw/tcdistribution/PUSDistributor.cpp +++ b/src/fsfw/tcdistribution/PUSDistributor.cpp @@ -12,7 +12,7 @@ PUSDistributor::PUSDistributor(uint16_t setApid, object_id_t setObjectId, : TcDistributor(setObjectId), checker(setApid), verifyChannel(), - tcStatus(RETURN_FAILED), + tcStatus(returnvalue::FAILED), packetSource(setPacketSource) {} PUSDistributor::~PUSDistributor() = default; @@ -30,7 +30,7 @@ PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() { this->currentPacket->setStoreAddress(this->currentMessage.getStorageId(), currentPacket); if (currentPacket->getWholeData() != nullptr) { tcStatus = checker.checkPacket(currentPacket); - if (tcStatus != HasReturnvaluesIF::RETURN_OK) { + if (tcStatus != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 const char* keyword = "unnamed error"; if (tcStatus == TcPacketCheckPUS::INCORRECT_CHECKSUM) { @@ -70,7 +70,7 @@ PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() { #endif } - if (tcStatus != RETURN_OK) { + if (tcStatus != returnvalue::OK) { return this->queueMap.end(); } else { return queueMapIt; @@ -100,25 +100,25 @@ ReturnValue_t PUSDistributor::registerService(AcceptsTelecommandsIF* service) { #endif return SERVICE_ID_ALREADY_EXISTS; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } MessageQueueId_t PUSDistributor::getRequestQueue() { return tcQueue->getId(); } ReturnValue_t PUSDistributor::callbackAfterSending(ReturnValue_t queueStatus) { - if (queueStatus != RETURN_OK) { + if (queueStatus != returnvalue::OK) { tcStatus = queueStatus; } - if (tcStatus != RETURN_OK) { + if (tcStatus != returnvalue::OK) { this->verifyChannel.sendFailureReport(tc_verification::ACCEPTANCE_FAILURE, currentPacket, tcStatus); // A failed packet is deleted immediately after reporting, // otherwise it will block memory. currentPacket->deletePacket(); - return RETURN_FAILED; + return returnvalue::FAILED; } else { this->verifyChannel.sendSuccessReport(tc_verification::ACCEPTANCE_SUCCESS, currentPacket); - return RETURN_OK; + return returnvalue::OK; } } @@ -140,7 +140,7 @@ ReturnValue_t PUSDistributor::initialize() { sif::printError("PUSDistributor::initialize: Packet source invalid\n"); sif::printError("Make sure it exists and implements CCSDSDistributorIF\n"); #endif - return RETURN_FAILED; + return returnvalue::FAILED; } return ccsdsDistributor->registerApplication(this); } diff --git a/src/fsfw/tcdistribution/PUSDistributorIF.h b/src/fsfw/tcdistribution/PUSDistributorIF.h index da6db283..85619fee 100644 --- a/src/fsfw/tcdistribution/PUSDistributorIF.h +++ b/src/fsfw/tcdistribution/PUSDistributorIF.h @@ -18,7 +18,7 @@ class PUSDistributorIF { * With this method, Services can register themselves at the PUS Distributor. * @param service A pointer to the registering Service. * @return - @c RETURN_OK on success, - * - @c RETURN_FAILED on failure. + * - @c returnvalue::FAILED on failure. */ virtual ReturnValue_t registerService(AcceptsTelecommandsIF* service) = 0; }; diff --git a/src/fsfw/tcdistribution/TcDistributor.cpp b/src/fsfw/tcdistribution/TcDistributor.cpp index a650546c..d7fbd0f8 100644 --- a/src/fsfw/tcdistribution/TcDistributor.cpp +++ b/src/fsfw/tcdistribution/TcDistributor.cpp @@ -11,13 +11,13 @@ TcDistributor::TcDistributor(object_id_t objectId) : SystemObject(objectId) { TcDistributor::~TcDistributor() { QueueFactory::instance()->deleteMessageQueue(tcQueue); } ReturnValue_t TcDistributor::performOperation(uint8_t opCode) { - ReturnValue_t status = RETURN_OK; - for (status = tcQueue->receiveMessage(¤tMessage); status == RETURN_OK; + ReturnValue_t status = returnvalue::OK; + for (status = tcQueue->receiveMessage(¤tMessage); status == returnvalue::OK; status = tcQueue->receiveMessage(¤tMessage)) { status = handlePacket(); } if (status == MessageQueueIF::EMPTY) { - return RETURN_OK; + return returnvalue::OK; } else { return status; } @@ -25,7 +25,7 @@ ReturnValue_t TcDistributor::performOperation(uint8_t opCode) { ReturnValue_t TcDistributor::handlePacket() { TcMqMapIter queueMapIt = this->selectDestination(); - ReturnValue_t returnValue = RETURN_FAILED; + ReturnValue_t returnValue = returnvalue::FAILED; if (queueMapIt != this->queueMap.end()) { returnValue = this->tcQueue->sendMessage(queueMapIt->second, &this->currentMessage); } @@ -43,4 +43,4 @@ void TcDistributor::print() { #endif } -ReturnValue_t TcDistributor::callbackAfterSending(ReturnValue_t queueStatus) { return RETURN_OK; } +ReturnValue_t TcDistributor::callbackAfterSending(ReturnValue_t queueStatus) { return returnvalue::OK; } diff --git a/src/fsfw/tcdistribution/TcDistributor.h b/src/fsfw/tcdistribution/TcDistributor.h index 1b783ff4..7c7e539c 100644 --- a/src/fsfw/tcdistribution/TcDistributor.h +++ b/src/fsfw/tcdistribution/TcDistributor.h @@ -27,7 +27,7 @@ * implementations. * @ingroup tc_distribution */ -class TcDistributor : public SystemObject, public ExecutableObjectIF, public HasReturnvaluesIF { +class TcDistributor : public SystemObject, public ExecutableObjectIF { public: using TcMessageQueueMap = std::map; using TcMqMapIter = std::map::iterator; @@ -93,7 +93,7 @@ class TcDistributor : public SystemObject, public ExecutableObjectIF, public Has /** * The handlePacket method calls the child class's selectDestination method * and forwards the packet to its destination, if found. - * @return The message queue return value or @c RETURN_FAILED, in case no + * @return The message queue return value or @c returnvalue::FAILED, in case no * destination was found. */ ReturnValue_t handlePacket(); @@ -105,7 +105,7 @@ class TcDistributor : public SystemObject, public ExecutableObjectIF, public Has * @param queueStatus The status of the message queue after an attempt * to send the TC. * @return - @c RETURN_OK on success - * - @c RETURN_FAILED on failure + * - @c returnvalue::FAILED on failure */ virtual ReturnValue_t callbackAfterSending(ReturnValue_t queueStatus); diff --git a/src/fsfw/tcdistribution/TcPacketCheckCFDP.cpp b/src/fsfw/tcdistribution/TcPacketCheckCFDP.cpp index d1eb43bc..012c2d1a 100644 --- a/src/fsfw/tcdistribution/TcPacketCheckCFDP.cpp +++ b/src/fsfw/tcdistribution/TcPacketCheckCFDP.cpp @@ -4,6 +4,6 @@ TcPacketCheckCFDP::TcPacketCheckCFDP(uint16_t setApid) : apid(setApid) {} -ReturnValue_t TcPacketCheckCFDP::checkPacket(SpacePacketBase* currentPacket) { return RETURN_OK; } +ReturnValue_t TcPacketCheckCFDP::checkPacket(SpacePacketBase* currentPacket) { return returnvalue::OK; } uint16_t TcPacketCheckCFDP::getApid() const { return apid; } diff --git a/src/fsfw/tcdistribution/TcPacketCheckCFDP.h b/src/fsfw/tcdistribution/TcPacketCheckCFDP.h index 3fe281d1..8946c7a7 100644 --- a/src/fsfw/tcdistribution/TcPacketCheckCFDP.h +++ b/src/fsfw/tcdistribution/TcPacketCheckCFDP.h @@ -10,7 +10,7 @@ class CFDPPacketStored; * This class performs a formal packet check for incoming CFDP Packets. * @ingroup tc_distribution */ -class TcPacketCheckCFDP : public TcPacketCheckIF, public HasReturnvaluesIF { +class TcPacketCheckCFDP : public TcPacketCheckIF { protected: /** * The packet id each correct packet should have. diff --git a/src/fsfw/tcdistribution/TcPacketCheckPUS.cpp b/src/fsfw/tcdistribution/TcPacketCheckPUS.cpp index 83844337..8ae29ae1 100644 --- a/src/fsfw/tcdistribution/TcPacketCheckPUS.cpp +++ b/src/fsfw/tcdistribution/TcPacketCheckPUS.cpp @@ -14,7 +14,7 @@ ReturnValue_t TcPacketCheckPUS::checkPacket(SpacePacketBase* currentPacket) { TcPacketStoredBase* storedPacket = dynamic_cast(currentPacket); TcPacketPusBase* tcPacketBase = dynamic_cast(currentPacket); if (tcPacketBase == nullptr or storedPacket == nullptr) { - return RETURN_FAILED; + return returnvalue::FAILED; } uint16_t calculated_crc = CRC::crc16ccitt(tcPacketBase->getWholeData(), tcPacketBase->getFullSize()); @@ -38,7 +38,7 @@ ReturnValue_t TcPacketCheckPUS::checkPacket(SpacePacketBase* currentPacket) { if (condition) { return INCORRECT_SECONDARY_HEADER; } - return RETURN_OK; + return returnvalue::OK; } uint16_t TcPacketCheckPUS::getApid() const { return apid; } diff --git a/src/fsfw/tcdistribution/TcPacketCheckPUS.h b/src/fsfw/tcdistribution/TcPacketCheckPUS.h index e3eca1a4..5b02bbc0 100644 --- a/src/fsfw/tcdistribution/TcPacketCheckPUS.h +++ b/src/fsfw/tcdistribution/TcPacketCheckPUS.h @@ -13,7 +13,7 @@ class TcPacketStoredBase; * Currently, it only checks if the APID and CRC are correct. * @ingroup tc_distribution */ -class TcPacketCheckPUS : public TcPacketCheckIF, public HasReturnvaluesIF { +class TcPacketCheckPUS : public TcPacketCheckIF { protected: /** * Describes the version number a packet must have to pass. diff --git a/src/fsfw/thermal/AbstractTemperatureSensor.cpp b/src/fsfw/thermal/AbstractTemperatureSensor.cpp index 68cd3aca..fc182bf1 100644 --- a/src/fsfw/thermal/AbstractTemperatureSensor.cpp +++ b/src/fsfw/thermal/AbstractTemperatureSensor.cpp @@ -24,11 +24,11 @@ MessageQueueId_t AbstractTemperatureSensor::getCommandQueue() const { ReturnValue_t AbstractTemperatureSensor::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = healthHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = parameterHelper.initialize(); @@ -38,24 +38,24 @@ ReturnValue_t AbstractTemperatureSensor::initialize() { ReturnValue_t AbstractTemperatureSensor::performOperation(uint8_t opCode) { handleCommandQueue(); doChildOperation(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t AbstractTemperatureSensor::performHealthOp() { handleCommandQueue(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void AbstractTemperatureSensor::handleCommandQueue() { CommandMessage command; ReturnValue_t result = commandQueue->receiveMessage(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { result = healthHelper.handleHealthCommand(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return; } result = parameterHelper.handleParameterMessage(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return; } command.setToUnknownCommand(); @@ -65,7 +65,7 @@ void AbstractTemperatureSensor::handleCommandQueue() { ReturnValue_t AbstractTemperatureSensor::setHealth(HealthState health) { healthHelper.setHealth(health); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } HasHealthIF::HealthState AbstractTemperatureSensor::getHealth() { return healthHelper.getHealth(); } diff --git a/src/fsfw/thermal/Heater.cpp b/src/fsfw/thermal/Heater.cpp index 4f0f8060..2ad988bd 100644 --- a/src/fsfw/thermal/Heater.cpp +++ b/src/fsfw/thermal/Heater.cpp @@ -21,14 +21,14 @@ ReturnValue_t Heater::set() { passive = false; // wait for clear before doing anything if (internalState == STATE_WAIT) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } if (healthHelper.healthTable->isHealthy(getObjectId())) { doAction(SET); if ((internalState == STATE_OFF) || (internalState == STATE_PASSIVE)) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } else { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } else { if (healthHelper.healthTable->isFaulty(getObjectId())) { @@ -37,7 +37,7 @@ ReturnValue_t Heater::set() { doAction(CLEAR); } } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -186,7 +186,7 @@ ReturnValue_t Heater::performOperation(uint8_t opCode) { wasOn = false; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void Heater::setSwitch(uint8_t number, ReturnValue_t state, uint32_t* uptimeOfSwitching) { @@ -220,54 +220,54 @@ MessageQueueId_t Heater::getCommandQueue() const { return commandQueue->getId(); ReturnValue_t Heater::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } EventManagerIF* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); if (manager == NULL) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } result = manager->registerListener(eventQueue->getId()); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } ConfirmsFailuresIF* pcdu = ObjectManager::instance()->get( DeviceHandlerFailureIsolation::powerConfirmationId); if (pcdu == NULL) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } pcduQueueId = pcdu->getEventReceptionQueue(); result = manager->subscribeToAllEventsFrom(eventQueue->getId(), getObjectId()); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = parameterHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = healthHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void Heater::handleQueue() { CommandMessage command; ReturnValue_t result = commandQueue->receiveMessage(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { result = healthHelper.handleHealthCommand(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return; } result = parameterHelper.handleParameterMessage(&command); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { return; } } @@ -286,13 +286,13 @@ ReturnValue_t Heater::getParameter(uint8_t domainId, uint8_t uniqueId, default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void Heater::handleEventQueue() { EventMessage event; for (ReturnValue_t result = eventQueue->receiveMessage(&event); - result == HasReturnvaluesIF::RETURN_OK; result = eventQueue->receiveMessage(&event)) { + result == returnvalue::OK; result = eventQueue->receiveMessage(&event)) { switch (event.getMessageId()) { case EventMessage::EVENT_MESSAGE: switch (event.getEvent()) { diff --git a/src/fsfw/thermal/RedundantHeater.cpp b/src/fsfw/thermal/RedundantHeater.cpp index 431d9900..24b70c89 100644 --- a/src/fsfw/thermal/RedundantHeater.cpp +++ b/src/fsfw/thermal/RedundantHeater.cpp @@ -14,7 +14,7 @@ void RedundantHeater::performOperation(uint8_t opCode) { void RedundantHeater::set(bool on, bool both, bool passive) { if (on) { ReturnValue_t result = heater0.set(); - if (result != HasReturnvaluesIF::RETURN_OK || both) { + if (result != returnvalue::OK || both) { heater1.set(); } else { heater1.clear(passive); diff --git a/src/fsfw/thermal/TemperatureSensor.h b/src/fsfw/thermal/TemperatureSensor.h index 591fd7d9..4cb2a083 100644 --- a/src/fsfw/thermal/TemperatureSensor.h +++ b/src/fsfw/thermal/TemperatureSensor.h @@ -117,7 +117,7 @@ class TemperatureSensor : public AbstractTemperatureSensor { void doChildOperation() { ReturnValue_t result = inputTemperature->read(MutexIF::TimeoutType::WAITING, 20); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } @@ -209,7 +209,7 @@ class TemperatureSensor : public AbstractTemperatureSensor { default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } virtual void resetOldState() { sensorMonitor.setToUnchecked(); } diff --git a/src/fsfw/thermal/ThermalComponent.cpp b/src/fsfw/thermal/ThermalComponent.cpp index 000f2e19..e0077af2 100644 --- a/src/fsfw/thermal/ThermalComponent.cpp +++ b/src/fsfw/thermal/ThermalComponent.cpp @@ -21,18 +21,18 @@ ReturnValue_t ThermalComponent::setTargetState(int8_t newState) { targetState.setReadWriteMode(pool_rwm_t::VAR_READ_WRITE); targetState.read(); if ((targetState == STATE_REQUEST_OPERATIONAL) and (newState != STATE_REQUEST_IGNORE)) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } switch (newState) { case STATE_REQUEST_NON_OPERATIONAL: targetState = newState; targetState.setValid(true); targetState.commit(PoolVariableIF::VALID); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; default: return ThermalComponentCore::setTargetState(newState); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t ThermalComponent::setLimits(const uint8_t* data, size_t size) { @@ -48,7 +48,7 @@ ReturnValue_t ThermalComponent::setLimits(const uint8_t* data, size_t size) { SerializeIF::Endianness::BIG); SerializeAdapter::deSerialize(&nopParameters.upperNopLimit, &data, &readSize, SerializeIF::Endianness::BIG); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ThermalComponentIF::State ThermalComponent::getState(float temperature, @@ -155,5 +155,5 @@ ReturnValue_t ThermalComponent::getParameter(uint8_t domainId, uint8_t uniqueId, default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/thermal/ThermalComponentCore.cpp b/src/fsfw/thermal/ThermalComponentCore.cpp index 887c30f2..ef47f49f 100644 --- a/src/fsfw/thermal/ThermalComponentCore.cpp +++ b/src/fsfw/thermal/ThermalComponentCore.cpp @@ -18,7 +18,7 @@ ThermalComponentCore::ThermalComponentCore(object_id_t reportingObjectId, uint8_ // Set thermal state once, then leave to operator. targetState.setReadWriteMode(PoolVariableIF::VAR_WRITE); ReturnValue_t result = targetState.read(); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { targetState = initialTargetState; targetState.setValid(true); targetState.commit(); @@ -91,7 +91,7 @@ ReturnValue_t ThermalComponentCore::setTargetState(int8_t newState) { targetState.setReadWriteMode(pool_rwm_t::VAR_READ_WRITE); targetState.read(); if ((targetState == STATE_REQUEST_OPERATIONAL) and (newState != STATE_REQUEST_IGNORE)) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } switch (newState) { @@ -106,7 +106,7 @@ ReturnValue_t ThermalComponentCore::setTargetState(int8_t newState) { } targetState.setValid(true); targetState.commit(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void ThermalComponentCore::setOutputInvalid() { @@ -267,5 +267,5 @@ ReturnValue_t ThermalComponentCore::getParameter(uint8_t domainId, uint8_t uniqu default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/thermal/ThermalModule.cpp b/src/fsfw/thermal/ThermalModule.cpp index 976bbe45..6f62a02b 100644 --- a/src/fsfw/thermal/ThermalModule.cpp +++ b/src/fsfw/thermal/ThermalModule.cpp @@ -233,7 +233,7 @@ bool ThermalModule::calculateModuleHeaterRequestAndSetModuleStatus(Strategy stra void ThermalModule::setHeating(bool on) { ReturnValue_t result = targetState.read(); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { if (on) { targetState.value = STATE_REQUEST_HEATING; } else { diff --git a/src/fsfw/thermal/ThermalMonitorReporter.cpp b/src/fsfw/thermal/ThermalMonitorReporter.cpp index dc64280e..2e6796a6 100644 --- a/src/fsfw/thermal/ThermalMonitorReporter.cpp +++ b/src/fsfw/thermal/ThermalMonitorReporter.cpp @@ -46,20 +46,20 @@ ReturnValue_t ThermalMonitorReporter::translateState(ThermalComponentIF::State s if (componentIsOperational) { return monitorStateIs(ThermalComponentIF::BELOW_OPERATIONAL_LIMIT, sample, lowerLimit); } else { - return monitorStateIs(HasReturnvaluesIF::RETURN_OK, sample, 0.0); + return monitorStateIs(returnvalue::OK, sample, 0.0); } case ThermalComponentIF::OPERATIONAL: - return monitorStateIs(HasReturnvaluesIF::RETURN_OK, sample, 0.0); + return monitorStateIs(returnvalue::OK, sample, 0.0); case ThermalComponentIF::NON_OPERATIONAL_HIGH: if (componentIsOperational) { return monitorStateIs(ThermalComponentIF::ABOVE_OPERATIONAL_LIMIT, sample, upperLimit); } else { - return monitorStateIs(HasReturnvaluesIF::RETURN_OK, sample, 0.0); + return monitorStateIs(returnvalue::OK, sample, 0.0); } case ThermalComponentIF::OUT_OF_RANGE_HIGH: return monitorStateIs(MonitoringIF::ABOVE_HIGH_LIMIT, sample, upperLimit); default: // Never reached, all states covered. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/src/fsfw/timemanager/CCSDSTime.cpp b/src/fsfw/timemanager/CCSDSTime.cpp index 1f84dd03..5e035d67 100644 --- a/src/fsfw/timemanager/CCSDSTime.cpp +++ b/src/fsfw/timemanager/CCSDSTime.cpp @@ -8,7 +8,7 @@ ReturnValue_t CCSDSTime::convertToCcsds(Ccs_seconds* to, const Clock::TimeOfDay_t* from) { ReturnValue_t result = checkTimeOfDay(from); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -22,12 +22,12 @@ ReturnValue_t CCSDSTime::convertToCcsds(Ccs_seconds* to, const Clock::TimeOfDay_ to->minute = from->minute; to->second = from->second; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertToCcsds(Ccs_mseconds* to, const Clock::TimeOfDay_t* from) { ReturnValue_t result = checkTimeOfDay(from); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -43,7 +43,7 @@ ReturnValue_t CCSDSTime::convertToCcsds(Ccs_mseconds* to, const Clock::TimeOfDay to->secondEminus2 = from->usecond / 10000; to->secondEminus4 = (from->usecond % 10000) / 100; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertFromCcsds(Clock::TimeOfDay_t* to, const uint8_t* from, @@ -53,8 +53,8 @@ ReturnValue_t CCSDSTime::convertFromCcsds(Clock::TimeOfDay_t* to, const uint8_t* return LENGTH_MISMATCH; } result = convertFromASCII(to, from, length); // Try to parse it as ASCII - if (result == RETURN_OK) { - return RETURN_OK; + if (result == returnvalue::OK) { + return returnvalue::OK; } // Seems to be no ascii, try the other formats @@ -84,7 +84,7 @@ ReturnValue_t CCSDSTime::convertFromCDS(Clock::TimeOfDay_t* to, const uint8_t* f uint8_t length) { timeval time; ReturnValue_t result = convertFromCDS(&time, from, NULL, length); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return Clock::convertTimevalToTimeOfDay(&time, to); @@ -102,7 +102,7 @@ ReturnValue_t CCSDSTime::convertFromCCS(Clock::TimeOfDay_t* to, const uint8_t* f ReturnValue_t result = checkCcs(from, maxLength); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } // At this point we made sure that this is a valid ccs time @@ -118,7 +118,7 @@ ReturnValue_t CCSDSTime::convertFromCCS(Clock::TimeOfDay_t* to, const uint8_t* f uint8_t tempDay = 0; uint8_t tempMonth = 0; result = convertDaysOfYear(tempDayOfYear, to->year, &tempMonth, &tempDay); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } to->month = tempMonth; @@ -144,13 +144,13 @@ ReturnValue_t CCSDSTime::convertFromCCS(Clock::TimeOfDay_t* to, const uint8_t* f to->usecond += temp->secondEminus4 * 100; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* from, uint8_t length) { if (length < 19) { - return RETURN_FAILED; + return returnvalue::FAILED; } // Newlib nano can't parse uint8, see SCNu8 documentation and https://sourceware.org/newlib/README // Suggestion: use uint16 all the time. This should work on all systems. @@ -174,7 +174,7 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* to->minute = minute; to->second = second; to->usecond = (second - floor(second)) * 1000000; - return RETURN_OK; + return returnvalue::OK; } // try Code B (yyyy-ddd) @@ -187,8 +187,8 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* uint8_t tempDay; ReturnValue_t result = CCSDSTime::convertDaysOfYear( day, year, reinterpret_cast(&month), reinterpret_cast(&tempDay)); - if (result != RETURN_OK) { - return RETURN_FAILED; + if (result != returnvalue::OK) { + return returnvalue::FAILED; } to->year = year; to->month = month; @@ -197,7 +197,7 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* to->minute = minute; to->second = second; to->usecond = (second - floor(second)) * 1000000; - return RETURN_OK; + return returnvalue::OK; } // Warning: Compiler/Linker fails ambiguously if library does not implement // C99 I/O @@ -220,7 +220,7 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* to->minute = minute; to->second = second; to->usecond = (second - floor(second)) * 1000000; - return RETURN_OK; + return returnvalue::OK; } // try Code B (yyyy-ddd) @@ -229,8 +229,8 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* if (count == 5) { uint8_t tempDay; ReturnValue_t result = CCSDSTime::convertDaysOfYear(day, year, &month, &tempDay); - if (result != RETURN_OK) { - return RETURN_FAILED; + if (result != returnvalue::OK) { + return returnvalue::FAILED; } to->year = year; to->month = month; @@ -239,7 +239,7 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* to->minute = minute; to->second = second; to->usecond = (second - floor(second)) * 1000000; - return RETURN_OK; + return returnvalue::OK; } #endif @@ -284,7 +284,7 @@ ReturnValue_t CCSDSTime::checkCcs(const uint8_t* time, uint8_t length) { return INVALID_TIME_FORMAT; } } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertDaysOfYear(uint16_t dayofYear, uint16_t year, uint8_t* month, @@ -301,21 +301,21 @@ ReturnValue_t CCSDSTime::convertDaysOfYear(uint16_t dayofYear, uint16_t year, ui *month = 1; if (dayofYear <= 31) { *day = dayofYear; - return RETURN_OK; + return returnvalue::OK; } *month += 1; dayofYear -= 31; if (isLeapYear(year)) { if (dayofYear <= 29) { *day = dayofYear; - return RETURN_OK; + return returnvalue::OK; } *month += 1; dayofYear -= 29; } else { if (dayofYear <= 28) { *day = dayofYear; - return RETURN_OK; + return returnvalue::OK; } *month += 1; dayofYear -= 28; @@ -323,7 +323,7 @@ ReturnValue_t CCSDSTime::convertDaysOfYear(uint16_t dayofYear, uint16_t year, ui while (*month <= 12) { if (dayofYear <= 31) { *day = dayofYear; - return RETURN_OK; + return returnvalue::OK; } *month += 1; dayofYear -= 31; @@ -334,7 +334,7 @@ ReturnValue_t CCSDSTime::convertDaysOfYear(uint16_t dayofYear, uint16_t year, ui if (dayofYear <= 30) { *day = dayofYear; - return RETURN_OK; + return returnvalue::OK; } *month += 1; dayofYear -= 30; @@ -369,7 +369,7 @@ ReturnValue_t CCSDSTime::convertToCcsds(CDS_short* to, const timeval* from) { to->msDay_h = (msDay & 0xFF0000) >> 16; to->msDay_l = (msDay & 0xFF00) >> 8; to->msDay_ll = (msDay & 0xFF); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertToCcsds(OBT_FLP* to, const timeval* from) { @@ -387,7 +387,7 @@ ReturnValue_t CCSDSTime::convertToCcsds(OBT_FLP* to, const timeval* from) { to->subsecondsMSB = (temp >> 8) & 0xff; to->subsecondsLSB = temp & 0xff; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertFromCcsds(timeval* to, const uint8_t* from, size_t* foundLength, @@ -396,7 +396,7 @@ ReturnValue_t CCSDSTime::convertFromCcsds(timeval* to, const uint8_t* from, size Clock::TimeOfDay_t timeOfDay; /* Try to parse it as ASCII */ ReturnValue_t result = convertFromASCII(&timeOfDay, from, maxLength); - if (result == RETURN_OK) { + if (result == returnvalue::OK) { return Clock::convertTimeOfDayToTimeval(&timeOfDay, to); } } @@ -423,7 +423,7 @@ ReturnValue_t CCSDSTime::convertFromCUC(timeval* to, const uint8_t* from, size_t uint8_t pField = *from; from++; ReturnValue_t result = convertFromCUC(to, pField, from, foundLength, maxLength - 1); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { if (foundLength != nullptr) { *foundLength += 1; } @@ -482,7 +482,7 @@ ReturnValue_t CCSDSTime::checkTimeOfDay(const Clock::TimeOfDay_t* time) { return INVALID_TIME_FORMAT; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const uint8_t* from, size_t* foundLength, @@ -545,12 +545,12 @@ ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const uint8_t* from, size_t // Not very useful. to->tv_usec += (picosecs / 1000); } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const CCSDSTime::CDS_short* from) { if (to == nullptr or from == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } uint16_t days = (from->dayMSB << 8) + from->dayLSB; if (days <= DAYS_CCSDS_TO_UNIX_EPOCH) { @@ -562,16 +562,16 @@ ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const CCSDSTime::CDS_short* (from->msDay_hh << 24) + (from->msDay_h << 16) + (from->msDay_l << 8) + from->msDay_ll; to->tv_sec += (msDay / 1000); to->tv_usec = (msDay % 1000) * 1000; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t CCSDSTime::convertFromCDS(Clock::TimeOfDay_t* to, const CCSDSTime::CDS_short* from) { if (to == nullptr or from == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } timeval tempTimeval; ReturnValue_t result = convertFromCDS(&tempTimeval, from); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return Clock::convertTimevalToTimeOfDay(&tempTimeval, to); @@ -605,7 +605,7 @@ ReturnValue_t CCSDSTime::convertFromCUC(timeval* to, uint8_t pField, const uint8 to->tv_sec -= (DAYS_CCSDS_TO_UNIX_EPOCH * SECONDS_PER_DAY); } to->tv_usec = subsecondsToMicroseconds(subSeconds); - return RETURN_OK; + return returnvalue::OK; } uint32_t CCSDSTime::subsecondsToMicroseconds(uint16_t subseconds) { @@ -617,7 +617,7 @@ ReturnValue_t CCSDSTime::convertFromCCS(timeval* to, const uint8_t* from, size_t size_t maxLength) { Clock::TimeOfDay_t tempTime; ReturnValue_t result = convertFromCCS(&tempTime, from, foundLength, maxLength); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } diff --git a/src/fsfw/timemanager/CCSDSTime.h b/src/fsfw/timemanager/CCSDSTime.h index 2a2316af..c0db1d6e 100644 --- a/src/fsfw/timemanager/CCSDSTime.h +++ b/src/fsfw/timemanager/CCSDSTime.h @@ -20,7 +20,7 @@ bool operator==(const timeval &lhs, const timeval &rhs); * * Still work in progress */ -class CCSDSTime : public HasReturnvaluesIF { +class CCSDSTime { public: /** * The Time code identifications, bits 4-6 in the P-Field diff --git a/src/fsfw/timemanager/Clock.h b/src/fsfw/timemanager/Clock.h index 75c898e5..6df6e12b 100644 --- a/src/fsfw/timemanager/Clock.h +++ b/src/fsfw/timemanager/Clock.h @@ -137,7 +137,7 @@ class Clock { * @param[out] tt timeval, corresponding to Terrestial Time * @return * - @c RETURN_OK on success - * - @c RETURN_FAILED if leapSeconds are not set + * - @c returnvalue::FAILED if leapSeconds are not set */ static ReturnValue_t convertUTCToTT(timeval utc, timeval *tt); @@ -158,7 +158,7 @@ class Clock { * @param[out] leapSeconds_ * @return * - @c RETURN_OK on success. - * - @c RETURN_FAILED on error + * - @c returnvalue::FAILED on error */ static ReturnValue_t getLeapSeconds(uint16_t *leapSeconds_); @@ -167,7 +167,7 @@ class Clock { * Function to check and create the Mutex for the clock * @return * - @c RETURN_OK on success. - * - Otherwise @c RETURN_FAILED if not able to create one + * - Otherwise @c returnvalue::FAILED if not able to create one */ static ReturnValue_t checkOrCreateClockMutex(); diff --git a/src/fsfw/timemanager/ClockCommon.cpp b/src/fsfw/timemanager/ClockCommon.cpp index ca8b12a4..45755f35 100644 --- a/src/fsfw/timemanager/ClockCommon.cpp +++ b/src/fsfw/timemanager/ClockCommon.cpp @@ -10,7 +10,7 @@ bool Clock::leapSecondsSet = false; ReturnValue_t Clock::convertUTCToTT(timeval utc, timeval* tt) { uint16_t leapSeconds; ReturnValue_t result = getLeapSeconds(&leapSeconds); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } timeval leapSeconds_timeval = {0, 0}; @@ -23,33 +23,33 @@ ReturnValue_t Clock::convertUTCToTT(timeval utc, timeval* tt) { *tt = utc + leapSeconds_timeval + UTCtoTAI1972 + TAItoTT; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::setLeapSeconds(const uint16_t leapSeconds_) { - if (checkOrCreateClockMutex() != HasReturnvaluesIF::RETURN_OK) { - return HasReturnvaluesIF::RETURN_FAILED; + if (checkOrCreateClockMutex() != returnvalue::OK) { + return returnvalue::FAILED; } MutexGuard helper(timeMutex); leapSeconds = leapSeconds_; leapSecondsSet = true; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::getLeapSeconds(uint16_t* leapSeconds_) { if (not leapSecondsSet) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - if (checkOrCreateClockMutex() != HasReturnvaluesIF::RETURN_OK) { - return HasReturnvaluesIF::RETURN_FAILED; + if (checkOrCreateClockMutex() != returnvalue::OK) { + return returnvalue::FAILED; } MutexGuard helper(timeMutex); *leapSeconds_ = leapSeconds; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::convertTimevalToTimeOfDay(const timeval* from, TimeOfDay_t* to) { @@ -58,7 +58,7 @@ ReturnValue_t Clock::convertTimevalToTimeOfDay(const timeval* from, TimeOfDay_t* // in the Windows CRT is incompatible with the C standard but this should not be an issue for // this implementation ReturnValue_t result = checkOrCreateClockMutex(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } MutexGuard helper(timeMutex); @@ -72,19 +72,19 @@ ReturnValue_t Clock::convertTimevalToTimeOfDay(const timeval* from, TimeOfDay_t* to->minute = timeInfo->tm_min; to->second = timeInfo->tm_sec; to->usecond = from->tv_usec; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t Clock::checkOrCreateClockMutex() { if (timeMutex == nullptr) { MutexFactory* mutexFactory = MutexFactory::instance(); if (mutexFactory == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } timeMutex = mutexFactory->createMutex(); if (timeMutex == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/timemanager/TimeStamper.cpp b/src/fsfw/timemanager/TimeStamper.cpp index 9b4ad3d3..99cbdd70 100644 --- a/src/fsfw/timemanager/TimeStamper.cpp +++ b/src/fsfw/timemanager/TimeStamper.cpp @@ -8,14 +8,14 @@ TimeStamper::TimeStamper(object_id_t objectId) : SystemObject(objectId) {} ReturnValue_t TimeStamper::addTimeStamp(uint8_t* buffer, const uint8_t maxSize) { if (maxSize < TimeStamperIF::MISSION_TIMESTAMP_SIZE) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } timeval now; Clock::getClock_timeval(&now); CCSDSTime::CDS_short cds; ReturnValue_t result = CCSDSTime::convertToCcsds(&cds, &now); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } std::memcpy(buffer, &cds, sizeof(cds)); diff --git a/src/fsfw/tmstorage/TmStoreMessage.cpp b/src/fsfw/tmstorage/TmStoreMessage.cpp index a6bab6c5..6165df6d 100644 --- a/src/fsfw/tmstorage/TmStoreMessage.cpp +++ b/src/fsfw/tmstorage/TmStoreMessage.cpp @@ -9,13 +9,13 @@ TmStoreMessage::TmStoreMessage() {} ReturnValue_t TmStoreMessage::setEnableStoringMessage(CommandMessage* cmd, bool setEnabled) { cmd->setCommand(ENABLE_STORING); cmd->setParameter(setEnabled); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TmStoreMessage::setDeleteContentMessage(CommandMessage* cmd, ApidSsc upTo) { cmd->setCommand(DELETE_STORE_CONTENT); cmd->setParameter((upTo.apid << 16) + upTo.ssc); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TmStoreMessage::setDownlinkContentMessage(CommandMessage* cmd, ApidSsc fromPacket, @@ -23,7 +23,7 @@ ReturnValue_t TmStoreMessage::setDownlinkContentMessage(CommandMessage* cmd, Api cmd->setCommand(DOWNLINK_STORE_CONTENT); cmd->setParameter((fromPacket.apid << 16) + fromPacket.ssc); cmd->setParameter2((toPacket.apid << 16) + toPacket.ssc); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ApidSsc TmStoreMessage::getPacketId1(CommandMessage* cmd) { @@ -86,7 +86,7 @@ bool TmStoreMessage::getAddToSelection(CommandMessage* cmd) { return (bool)cmd-> ReturnValue_t TmStoreMessage::setReportSelectionDefinitionMessage(CommandMessage* cmd) { cmd->setCommand(REPORT_SELECTION_DEFINITION); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TmStoreMessage::setSelectionDefinitionReportMessage(CommandMessage* cmd, @@ -97,7 +97,7 @@ void TmStoreMessage::setSelectionDefinitionReportMessage(CommandMessage* cmd, ReturnValue_t TmStoreMessage::setReportStoreCatalogueMessage(CommandMessage* cmd) { cmd->setCommand(REPORT_STORE_CATALOGUE); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TmStoreMessage::setStoreCatalogueReportMessage(CommandMessage* cmd, object_id_t objectId, @@ -127,18 +127,18 @@ ReturnValue_t TmStoreMessage::setDeleteBlocksMessage(CommandMessage* cmd, uint32 cmd->setCommand(DELETE_STORE_CONTENT_BLOCKS); cmd->setParameter(addressLow); cmd->setParameter2(addressHigh); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TmStoreMessage::setDownlinkBlocksMessage(CommandMessage* cmd, uint32_t addressLow, uint32_t addressHigh) { cmd->setCommand(DOWNLINK_STORE_CONTENT_BLOCKS); cmd->setParameter(addressLow); cmd->setParameter2(addressHigh); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TmStoreMessage::setIndexRequestMessage(CommandMessage* cmd) { cmd->setCommand(REPORT_INDEX_REQUEST); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TmStoreMessage::setIndexReportMessage(CommandMessage* cmd, store_address_t storeId) { diff --git a/src/fsfw/tmstorage/TmStorePackets.h b/src/fsfw/tmstorage/TmStorePackets.h index d54b7b52..8a2dfaf3 100644 --- a/src/fsfw/tmstorage/TmStorePackets.h +++ b/src/fsfw/tmstorage/TmStorePackets.h @@ -32,7 +32,7 @@ class ApidSsc : public SerializeIF { Endianness streamEndianness) const { ReturnValue_t result = SerializeAdapter::serialize(&apid, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SerializeAdapter::serialize(&ssc, buffer, size, maxSize, streamEndianness); @@ -42,7 +42,7 @@ class ApidSsc : public SerializeIF { ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { ReturnValue_t result = SerializeAdapter::deSerialize(&apid, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return SerializeAdapter::deSerialize(&ssc, buffer, size, streamEndianness); @@ -87,7 +87,7 @@ class TmPacketInformation : public SerializeIF { const uint8_t* pField = NULL; uint32_t size = 0; ReturnValue_t result = packet->getPacketTimeRaw(&pField, &size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } if (*pField == CCSDSTime::P_FIELD_CDS_SHORT && size <= TimeStamperIF::MISSION_TIMESTAMP_SIZE) { @@ -97,13 +97,13 @@ class TmPacketInformation : public SerializeIF { } timeval time = {0, 0}; result = packet->getPacketTime(&time); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } CCSDSTime::CDS_short cdsFormat; result = CCSDSTime::convertToCcsds(&cdsFormat, &time); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return; } memcpy(rawTimestamp, &cdsFormat, sizeof(cdsFormat)); @@ -196,24 +196,24 @@ class TmPacketInformation : public SerializeIF { Endianness streamEndianness) const { ReturnValue_t result = SerializeAdapter::serialize(&apid, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&sourceSequenceCount, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&serviceType, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&serviceSubtype, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::serialize(&subCounter, buffer, size, maxSize, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } SerialBufferAdapter adapter(rawTimestamp, sizeof(rawTimestamp)); @@ -234,23 +234,23 @@ class TmPacketInformation : public SerializeIF { ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) { ReturnValue_t result = SerializeAdapter::deSerialize(&apid, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&sourceSequenceCount, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&serviceType, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&serviceSubtype, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = SerializeAdapter::deSerialize(&subCounter, buffer, size, streamEndianness); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } SerialBufferAdapter adapter(rawTimestamp, sizeof(rawTimestamp)); diff --git a/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h b/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h index 364feb4e..a1fc77e8 100644 --- a/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h +++ b/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h @@ -23,7 +23,7 @@ class RedirectableDataPointerIF { * @param args Any additional user arguments required to set the data pointer * @return * - RETURN_OK if the pointer was set successfully - * - RETURN_FAILED on general error of if the maximum size is too small + * - returnvalue::FAILED on general error of if the maximum size is too small */ virtual ReturnValue_t setData(uint8_t* dataPtr, size_t maxSize, void* args = nullptr) = 0; diff --git a/src/fsfw/tmtcpacket/SpacePacketBase.cpp b/src/fsfw/tmtcpacket/SpacePacketBase.cpp index 756d7e50..e02417d8 100644 --- a/src/fsfw/tmtcpacket/SpacePacketBase.cpp +++ b/src/fsfw/tmtcpacket/SpacePacketBase.cpp @@ -25,7 +25,7 @@ ReturnValue_t SpacePacketBase::initSpacePacketHeader(bool isTelecommand, bool ha sif::printWarning("SpacePacketBase::initSpacePacketHeader: Data pointer is invalid!\n"); #endif #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } // reset header to zero: memset(data, 0, sizeof(this->data->header)); @@ -37,7 +37,7 @@ ReturnValue_t SpacePacketBase::initSpacePacketHeader(bool isTelecommand, bool ha // Always initialize as standalone packets. data->header.sequence_control_h = 0b11000000; setPacketSequenceCount(sequenceCount); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } bool SpacePacketBase::isTelecommand(void) { @@ -111,8 +111,8 @@ uint8_t* SpacePacketBase::getPacketData() { return &(data->packet_data); } ReturnValue_t SpacePacketBase::setData(uint8_t* pData, size_t maxSize, void* args) { if (maxSize < 6) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } this->data = reinterpret_cast(const_cast(pData)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.cpp b/src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.cpp index 9a410b40..6e0f7b22 100644 --- a/src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.cpp +++ b/src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.cpp @@ -16,7 +16,7 @@ CFDPPacketStored::CFDPPacketStored(const uint8_t* data, size_t size) : CFDPPacke } if (this->checkAndSetStore()) { ReturnValue_t status = store->addData(&storeAddress, data, size); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { this->setData(nullptr, -1); } const uint8_t* storePtr = nullptr; @@ -41,11 +41,11 @@ void CFDPPacketStored::setStoreAddress(store_address_t setAddress) { this->storeAddress = setAddress; const uint8_t* tempData = nullptr; size_t tempSize; - ReturnValue_t status = StorageManagerIF::RETURN_FAILED; + ReturnValue_t status = returnvalue::FAILED; if (this->checkAndSetStore()) { status = this->store->getData(this->storeAddress, &tempData, &tempSize); } - if (status == StorageManagerIF::RETURN_OK) { + if (status == returnvalue::OK) { this->setData(const_cast(tempData), tempSize); } else { // To circumvent size checks @@ -59,11 +59,11 @@ store_address_t CFDPPacketStored::getStoreAddress() { return this->storeAddress; CFDPPacketStored::~CFDPPacketStored() {} ReturnValue_t CFDPPacketStored::getData(const uint8_t** dataPtr, size_t* dataSize) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } // ReturnValue_t CFDPPacketStored::setData(const uint8_t *data) { -// return HasReturnvaluesIF::RETURN_OK; +// return returnvalue::OK; // } bool CFDPPacketStored::checkAndSetStore() { @@ -82,8 +82,8 @@ bool CFDPPacketStored::checkAndSetStore() { bool CFDPPacketStored::isSizeCorrect() { const uint8_t* temp_data = nullptr; size_t temp_size; - ReturnValue_t status = this->store->getData(this->storeAddress, &temp_data, &temp_size); - if (status == StorageManagerIF::RETURN_OK) { + ReturnValue_t status = store->getData(this->storeAddress, &temp_data, &temp_size); + if (status == returnvalue::OK) { if (this->getFullSize() == temp_size) { return true; } diff --git a/src/fsfw/tmtcpacket/packetmatcher/PacketMatchTree.cpp b/src/fsfw/tmtcpacket/packetmatcher/PacketMatchTree.cpp index 6b900030..e4688590 100644 --- a/src/fsfw/tmtcpacket/packetmatcher/PacketMatchTree.cpp +++ b/src/fsfw/tmtcpacket/packetmatcher/PacketMatchTree.cpp @@ -41,7 +41,7 @@ ReturnValue_t PacketMatchTree::addMatch(uint16_t apid, uint8_t type, uint8_t sub findOrInsertMatch(this->begin(), &testPacket, &lastTest); if (result == NEW_NODE_CREATED) { rollback = lastTest; - } else if (result != RETURN_OK) { + } else if (result != returnvalue::OK) { return result; } if (type == 0) { @@ -50,7 +50,7 @@ ReturnValue_t PacketMatchTree::addMatch(uint16_t apid, uint8_t type, uint8_t sub if (lastTest.left() != this->end()) { removeElementAndAllChildren(lastTest.left()); } - return RETURN_OK; + return returnvalue::OK; } // Type insertion required. result = @@ -59,7 +59,7 @@ ReturnValue_t PacketMatchTree::addMatch(uint16_t apid, uint8_t type, uint8_t sub if (rollback == this->end()) { rollback = lastTest; } - } else if (result != RETURN_OK) { + } else if (result != returnvalue::OK) { if (rollback != this->end()) { removeElementAndAllChildren(rollback); } @@ -70,20 +70,20 @@ ReturnValue_t PacketMatchTree::addMatch(uint16_t apid, uint8_t type, uint8_t sub // See above removeElementAndAllChildren(lastTest.left()); } - return RETURN_OK; + return returnvalue::OK; } // Subtype insertion required. result = findOrInsertMatch(lastTest.left(), &testPacket, &lastTest); if (result == NEW_NODE_CREATED) { - return RETURN_OK; - } else if (result != RETURN_OK) { + return returnvalue::OK; + } else if (result != returnvalue::OK) { if (rollback != this->end()) { removeElementAndAllChildren(rollback); } return result; } - return RETURN_OK; + return returnvalue::OK; } template @@ -96,7 +96,7 @@ ReturnValue_t PacketMatchTree::findOrInsertMatch(iterator startAt, VALUE_T test, attachToBranch = OR; *lastTest = iter; if (isMatch) { - return RETURN_OK; + return returnvalue::OK; } else { // Go down OR branch. iter = iter.right(); @@ -116,7 +116,7 @@ ReturnValue_t PacketMatchTree::findOrInsertMatch(iterator startAt, VALUE_T test, *lastTest = insert(attachToBranch, *lastTest, newNode); if (*lastTest == end()) { // This actaully never fails, so creating a dedicated returncode seems an overshoot. - return RETURN_FAILED; + return returnvalue::FAILED; } return NEW_NODE_CREATED; } diff --git a/src/fsfw/tmtcpacket/packetmatcher/PacketMatchTree.h b/src/fsfw/tmtcpacket/packetmatcher/PacketMatchTree.h index 0cbd4494..e8727d71 100644 --- a/src/fsfw/tmtcpacket/packetmatcher/PacketMatchTree.h +++ b/src/fsfw/tmtcpacket/packetmatcher/PacketMatchTree.h @@ -6,7 +6,7 @@ #include "fsfw/storagemanager/LocalPool.h" #include "fsfw/tmtcpacket/pus/tm/TmPacketMinimal.h" -class PacketMatchTree : public MatchTree, public HasReturnvaluesIF { +class PacketMatchTree : public MatchTree { public: PacketMatchTree(Node* root); PacketMatchTree(iterator root); diff --git a/src/fsfw/tmtcpacket/pus/tc/TcPacketPus.cpp b/src/fsfw/tmtcpacket/pus/tc/TcPacketPus.cpp index f5ebe38c..7120e62f 100644 --- a/src/fsfw/tmtcpacket/pus/tc/TcPacketPus.cpp +++ b/src/fsfw/tmtcpacket/pus/tc/TcPacketPus.cpp @@ -86,14 +86,14 @@ size_t TcPacketPus::calculateFullPacketLength(size_t appDataLen) const { ReturnValue_t TcPacketPus::setData(uint8_t *dataPtr, size_t maxSize, void *args) { ReturnValue_t result = SpacePacketBase::setData(dataPtr, maxSize); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (maxSize < sizeof(TcPacketPointer)) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } // This function is const-correct, but it was decided to keep the pointer non-const // for convenience. Therefore, cast away constness here and then cast to packet type. tcData = reinterpret_cast(const_cast(dataPtr)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredBase.cpp b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredBase.cpp index 22918526..b7443b01 100644 --- a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredBase.cpp +++ b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredBase.cpp @@ -17,7 +17,7 @@ TcPacketStoredBase::~TcPacketStoredBase() = default; ReturnValue_t TcPacketStoredBase::getData(const uint8_t** dataPtr, size_t* dataSize) { auto result = TcPacketStoredBase::STORE->getData(storeAddress, dataPtr, dataSize); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "TcPacketStoredBase: Could not get data" << std::endl; #else @@ -47,12 +47,12 @@ void TcPacketStoredBase::setStoreAddress(store_address_t setAddress, this->storeAddress = setAddress; const uint8_t* tempData = nullptr; size_t tempSize; - ReturnValue_t status = StorageManagerIF::RETURN_FAILED; + ReturnValue_t status = returnvalue::FAILED; if (this->checkAndSetStore()) { status = TcPacketStoredBase::STORE->getData(this->storeAddress, &tempData, &tempSize); } - if (status == StorageManagerIF::RETURN_OK) { + if (status == returnvalue::OK) { packet->setData(const_cast(tempData), tempSize); } else { packet->setData(nullptr, -1); diff --git a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredPus.cpp b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredPus.cpp index 643c2ecc..d25486e5 100644 --- a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredPus.cpp +++ b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredPus.cpp @@ -15,7 +15,7 @@ TcPacketStoredPus::TcPacketStoredPus(uint16_t apid, uint8_t service, uint8_t sub uint8_t* pData = nullptr; ReturnValue_t returnValue = this->STORE->getFreeElement(&this->storeAddress, (TC_PACKET_MIN_SIZE + size), &pData); - if (returnValue != this->STORE->RETURN_OK) { + if (returnValue != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "TcPacketStoredBase: Could not get free element from store!" << std::endl; #endif @@ -45,7 +45,7 @@ TcPacketStoredPus::TcPacketStoredPus(const uint8_t* data, size_t size) : TcPacke } if (this->checkAndSetStore()) { ReturnValue_t status = STORE->addData(&storeAddress, data, size); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { this->setData(nullptr, size); } const uint8_t* storePtr = nullptr; @@ -69,7 +69,7 @@ bool TcPacketStoredPus::isSizeCorrect() { const uint8_t* temp_data = nullptr; size_t temp_size; ReturnValue_t status = this->STORE->getData(this->storeAddress, &temp_data, &temp_size); - if (status == StorageManagerIF::RETURN_OK) { + if (status == returnvalue::OK) { if (this->getFullSize() == temp_size) { return true; } diff --git a/src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.cpp b/src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.cpp index 388a4098..80f28878 100644 --- a/src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.cpp +++ b/src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.cpp @@ -19,14 +19,14 @@ uint8_t TmPacketMinimal::getPacketSubcounter() { return tm_data->data_field.subc ReturnValue_t TmPacketMinimal::getPacketTime(timeval* timestamp) { if (timestampInterpreter == NULL) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return timestampInterpreter->getPacketTime(this, timestamp); } ReturnValue_t TmPacketMinimal::getPacketTimeRaw(const uint8_t** timePtr, uint32_t* size) { if (timestampInterpreter == NULL) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } return timestampInterpreter->getPacketTimeRaw(this, timePtr, size); } diff --git a/src/fsfw/tmtcpacket/pus/tm/TmPacketPusA.cpp b/src/fsfw/tmtcpacket/pus/tm/TmPacketPusA.cpp index e8f71717..be9cc39d 100644 --- a/src/fsfw/tmtcpacket/pus/tm/TmPacketPusA.cpp +++ b/src/fsfw/tmtcpacket/pus/tm/TmPacketPusA.cpp @@ -30,11 +30,11 @@ uint16_t TmPacketPusA::getSourceDataSize() { ReturnValue_t TmPacketPusA::setData(uint8_t* p_Data, size_t maxSize, void* args) { ReturnValue_t result = SpacePacketBase::setData(p_Data, maxSize); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } tmData = reinterpret_cast(const_cast(p_Data)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t TmPacketPusA::getPacketMinimumSize() const { return TM_PACKET_MIN_SIZE; } diff --git a/src/fsfw/tmtcpacket/pus/tm/TmPacketPusC.cpp b/src/fsfw/tmtcpacket/pus/tm/TmPacketPusC.cpp index ab690414..00c889e3 100644 --- a/src/fsfw/tmtcpacket/pus/tm/TmPacketPusC.cpp +++ b/src/fsfw/tmtcpacket/pus/tm/TmPacketPusC.cpp @@ -30,14 +30,14 @@ uint16_t TmPacketPusC::getSourceDataSize() { ReturnValue_t TmPacketPusC::setData(uint8_t* p_Data, size_t maxSize, void* args) { ReturnValue_t result = SpacePacketBase::setData(p_Data, maxSize); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (maxSize < sizeof(TmPacketPointerPusC)) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } tmData = reinterpret_cast(const_cast(p_Data)); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } size_t TmPacketPusC::getPacketMinimumSize() const { return TM_PACKET_MIN_SIZE; } @@ -51,7 +51,7 @@ ReturnValue_t TmPacketPusC::initializeTmPacket(uint16_t apid, uint8_t service, u uint8_t timeRefField) { // Set primary header: ReturnValue_t result = initSpacePacketHeader(false, true, apid); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } // Set data Field Header: @@ -72,7 +72,7 @@ ReturnValue_t TmPacketPusC::initializeTmPacket(uint16_t apid, uint8_t service, u if (TmPacketBase::checkAndSetStamper()) { timeStamper->addTimeStamp(tmData->dataField.time, sizeof(tmData->dataField.time)); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TmPacketPusC::setSourceDataSize(uint16_t size) { diff --git a/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredBase.cpp b/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredBase.cpp index 4d37bf46..44e25e16 100644 --- a/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredBase.cpp +++ b/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredBase.cpp @@ -33,7 +33,7 @@ void TmPacketStoredBase::setStoreAddress(store_address_t setAddress) { return; } ReturnValue_t status = store->getData(storeAddress, &tempData, &tempSize); - if (status == StorageManagerIF::RETURN_OK) { + if (status == returnvalue::OK) { setData(const_cast(tempData), tempSize); } else { setData(nullptr, -1); @@ -58,11 +58,11 @@ ReturnValue_t TmPacketStoredBase::sendPacket(MessageQueueId_t destination, MessageQueueId_t sentFrom, bool doErrorReporting) { if (getAllTmData() == nullptr) { // SHOULDDO: More decent code. - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } TmTcMessage tmMessage(getStoreAddress()); ReturnValue_t result = MessageQueueSenderIF::sendMessage(destination, &tmMessage, sentFrom); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { deletePacket(); if (doErrorReporting) { checkAndReportLostTm(); @@ -71,7 +71,7 @@ ReturnValue_t TmPacketStoredBase::sendPacket(MessageQueueId_t destination, } // SHOULDDO: In many cases, some counter is incremented for successfully sent packets. The check // is often not done, but just incremented. - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TmPacketStoredBase::checkAndReportLostTm() { diff --git a/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredPusA.cpp b/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredPusA.cpp index 37ba63f3..4d9da5a9 100644 --- a/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredPusA.cpp +++ b/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredPusA.cpp @@ -20,7 +20,7 @@ TmPacketStoredPusA::TmPacketStoredPusA(uint16_t apid, uint8_t service, uint8_t s size_t sizeToReserve = getPacketMinimumSize() + size + headerSize; ReturnValue_t returnValue = store->getFreeElement(&storeAddress, sizeToReserve, &pData); - if (returnValue != store->RETURN_OK) { + if (returnValue != returnvalue::OK) { handleStoreFailure("A", returnValue, sizeToReserve); return; } @@ -49,7 +49,7 @@ TmPacketStoredPusA::TmPacketStoredPusA(uint16_t apid, uint8_t service, uint8_t s uint8_t *pData = nullptr; size_t sizeToReserve = getPacketMinimumSize() + sourceDataSize; ReturnValue_t returnValue = store->getFreeElement(&storeAddress, sizeToReserve, &pData); - if (returnValue != store->RETURN_OK) { + if (returnValue != returnvalue::OK) { handleStoreFailure("A", returnValue, sizeToReserve); return; } diff --git a/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredPusC.cpp b/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredPusC.cpp index 9c170aa3..55a5637a 100644 --- a/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredPusC.cpp +++ b/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredPusC.cpp @@ -22,7 +22,7 @@ TmPacketStoredPusC::TmPacketStoredPusC(uint16_t apid, uint8_t service, uint8_t s size_t sizeToReserve = getPacketMinimumSize() + size + headerSize; ReturnValue_t returnValue = store->getFreeElement(&storeAddress, sizeToReserve, &pData); - if (returnValue != store->RETURN_OK) { + if (returnValue != returnvalue::OK) { handleStoreFailure("C", returnValue, sizeToReserve); return; } @@ -52,7 +52,7 @@ TmPacketStoredPusC::TmPacketStoredPusC(uint16_t apid, uint8_t service, uint8_t s uint8_t *pData = nullptr; size_t sizeToReserve = getPacketMinimumSize() + sourceDataSize; ReturnValue_t returnValue = store->getFreeElement(&storeAddress, sizeToReserve, &pData); - if (returnValue != store->RETURN_OK) { + if (returnValue != returnvalue::OK) { handleStoreFailure("C", returnValue, sizeToReserve); return; } diff --git a/src/fsfw/tmtcservices/CommandingServiceBase.cpp b/src/fsfw/tmtcservices/CommandingServiceBase.cpp index bbdf8d2a..4cecf53b 100644 --- a/src/fsfw/tmtcservices/CommandingServiceBase.cpp +++ b/src/fsfw/tmtcservices/CommandingServiceBase.cpp @@ -42,7 +42,7 @@ ReturnValue_t CommandingServiceBase::performOperation(uint8_t opCode) { handleRequestQueue(); checkTimeout(); doPeriodicOperation(); - return RETURN_OK; + return returnvalue::OK; } uint16_t CommandingServiceBase::getIdentifier() { return service; } @@ -51,7 +51,7 @@ MessageQueueId_t CommandingServiceBase::getRequestQueue() { return requestQueue- ReturnValue_t CommandingServiceBase::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -90,15 +90,15 @@ ReturnValue_t CommandingServiceBase::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - return RETURN_OK; + return returnvalue::OK; } void CommandingServiceBase::handleCommandQueue() { CommandMessage reply; - ReturnValue_t result = RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; while (true) { result = commandQueue->receiveMessage(&reply); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { handleCommandMessage(&reply); continue; } else if (result == MessageQueueIF::EMPTY) { @@ -138,18 +138,18 @@ void CommandingServiceBase::handleCommandMessage(CommandMessage* reply) { iter->second.objectId, &isStep); /* If the child implementation does not implement special handling for - * rejected replies (RETURN_FAILED or INVALID_REPLY is returned), a + * rejected replies (returnvalue::FAILED or INVALID_REPLY is returned), a * failure verification will be generated with the reason as the * return code and the initial command as failure parameter 1 */ if ((reply->getCommand() == CommandMessage::REPLY_REJECTED) and - (result == RETURN_FAILED or result == INVALID_REPLY)) { + (result == returnvalue::FAILED or result == INVALID_REPLY)) { result = reply->getReplyRejectedReason(); failureParameter1 = iter->second.command; } switch (result) { case EXECUTION_COMPLETE: - case RETURN_OK: + case returnvalue::OK: case NO_STEP_MESSAGE: // handle result of reply handler implemented by developer. handleReplyHandlerResult(result, iter, &nextCommand, reply, isStep); @@ -185,12 +185,12 @@ 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 - ReturnValue_t sendResult = RETURN_OK; + ReturnValue_t sendResult = returnvalue::OK; if (nextCommand->getCommand() != CommandMessage::CMD_NONE) { sendResult = commandQueue->sendMessage(reply->getSender(), nextCommand); } - if (sendResult == RETURN_OK) { + if (sendResult == returnvalue::OK) { if (isStep and result != NO_STEP_MESSAGE) { verificationReporter.sendSuccessReport( tc_verification::PROGRESS_SUCCESS, iter->second.tcInfo.ackFlags, @@ -229,19 +229,19 @@ void CommandingServiceBase::handleRequestQueue() { TcPacketStoredPus packet; MessageQueueId_t queue; object_id_t objectId; - for (result = requestQueue->receiveMessage(&message); result == RETURN_OK; + for (result = requestQueue->receiveMessage(&message); result == returnvalue::OK; result = requestQueue->receiveMessage(&message)) { address = message.getStorageId(); packet.setStoreAddress(address, &packet); - if ((packet.getSubService() == 0) or (isValidSubservice(packet.getSubService()) != RETURN_OK)) { + if ((packet.getSubService() == 0) or (isValidSubservice(packet.getSubService()) != returnvalue::OK)) { rejectPacket(tc_verification::START_FAILURE, &packet, INVALID_SUBSERVICE); continue; } result = getMessageQueueAndObject(packet.getSubService(), packet.getApplicationData(), packet.getApplicationDataSize(), &queue, &objectId); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { rejectPacket(tc_verification::START_FAILURE, &packet, result); continue; } @@ -252,14 +252,14 @@ void CommandingServiceBase::handleRequestQueue() { if (iter != commandMap.end()) { result = iter->second.fifo.insert(address); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { rejectPacket(tc_verification::START_FAILURE, &packet, OBJECT_BUSY); } } else { CommandInfo newInfo; // Info will be set by startExecution if neccessary newInfo.objectId = objectId; result = commandMap.insert(queue, newInfo, &iter); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { rejectPacket(tc_verification::START_FAILURE, &packet, BUSY); } else { startExecution(&packet, iter); @@ -280,7 +280,7 @@ ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice, const uint #endif ReturnValue_t result = tmPacketStored.sendPacket(requestQueue->getDefaultDestination(), requestQueue->getId()); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { this->tmPacketCounter++; } return result; @@ -302,7 +302,7 @@ ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice, object_id_ #endif ReturnValue_t result = tmPacketStored.sendPacket(requestQueue->getDefaultDestination(), requestQueue->getId()); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { this->tmPacketCounter++; } return result; @@ -319,14 +319,14 @@ ReturnValue_t CommandingServiceBase::sendTmPacket(uint8_t subservice, SerializeI #endif ReturnValue_t result = tmPacketStored.sendPacket(requestQueue->getDefaultDestination(), requestQueue->getId()); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { this->tmPacketCounter++; } return result; } void CommandingServiceBase::startExecution(TcPacketStoredPus* storedPacket, CommandMapIter iter) { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; CommandMessage command; // TcPacketPusBase* tcPacketBase = storedPacket->getPacketBase(); if (storedPacket == nullptr) { @@ -337,13 +337,13 @@ void CommandingServiceBase::startExecution(TcPacketStoredPus* storedPacket, Comm storedPacket->getApplicationDataSize(), &iter->second.state, iter->second.objectId); - ReturnValue_t sendResult = RETURN_OK; + ReturnValue_t sendResult = returnvalue::OK; switch (result) { - case RETURN_OK: + case returnvalue::OK: if (command.getCommand() != CommandMessage::CMD_NONE) { sendResult = commandQueue->sendMessage(iter.value->first, &command); } - if (sendResult == RETURN_OK) { + if (sendResult == returnvalue::OK) { Clock::getUptime(&iter->second.uptimeOfStart); iter->second.step = 0; iter->second.subservice = storedPacket->getSubService(); @@ -363,7 +363,7 @@ void CommandingServiceBase::startExecution(TcPacketStoredPus* storedPacket, Comm // Fire-and-forget command. sendResult = commandQueue->sendMessage(iter.value->first, &command); } - if (sendResult == RETURN_OK) { + if (sendResult == returnvalue::OK) { verificationReporter.sendSuccessReport(tc_verification::START_SUCCESS, storedPacket->getPacketBase()); acceptPacket(tc_verification::COMPLETION_SUCCESS, storedPacket); @@ -395,7 +395,7 @@ void CommandingServiceBase::acceptPacket(uint8_t reportId, TcPacketStoredPus* pa void CommandingServiceBase::checkAndExecuteFifo(CommandMapIter& iter) { store_address_t address; - if (iter->second.fifo.retrieve(&address) != RETURN_OK) { + if (iter->second.fifo.retrieve(&address) != returnvalue::OK) { commandMap.erase(&iter); } else { TcPacketStoredPus newPacket(address); diff --git a/src/fsfw/tmtcservices/CommandingServiceBase.h b/src/fsfw/tmtcservices/CommandingServiceBase.h index 4dcad024..73b42259 100644 --- a/src/fsfw/tmtcservices/CommandingServiceBase.h +++ b/src/fsfw/tmtcservices/CommandingServiceBase.h @@ -36,8 +36,7 @@ void setStaticFrameworkObjectIds(); */ class CommandingServiceBase : public SystemObject, public AcceptsTelecommandsIF, - public ExecutableObjectIF, - public HasReturnvaluesIF { + public ExecutableObjectIF { friend void(Factory::setStaticFrameworkObjectIds)(); public: @@ -145,7 +144,7 @@ class CommandingServiceBase : public SystemObject, * @param objectId Object ID is extracted and stored here * @return * - @c RETURN_OK Cotinue message handling - * - @c RETURN_FAILED Reject the packet and generates a start failure + * - @c returnvalue::FAILED Reject the packet and generates a start failure * verification */ virtual ReturnValue_t getMessageQueueAndObject(uint8_t subservice, const uint8_t* tcData, @@ -193,7 +192,7 @@ class CommandingServiceBase : public SystemObject, * - @c RETURN_OK, @c EXECUTION_COMPLETE or @c NO_STEP_MESSAGE to * generate TC verification success * - @c INVALID_REPLY Calls handleUnrequestedReply - * - Anything else triggers a TC verification failure. If RETURN_FAILED or + * - Anything else triggers a TC verification failure. If returnvalue::FAILED or * INVALID_REPLY is returned and the command ID is * CommandMessage::REPLY_REJECTED, a failure verification message with * the reason as the error parameter and the initial command as @@ -232,14 +231,14 @@ class CommandingServiceBase : public SystemObject, virtual ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize, Endianness streamEndianness) const override { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; }; virtual size_t getSerializedSize() const override { return 0; }; virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, Endianness streamEndianness) override { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; }; }; diff --git a/src/fsfw/tmtcservices/PusServiceBase.cpp b/src/fsfw/tmtcservices/PusServiceBase.cpp index 3af2b82c..0ee358b0 100644 --- a/src/fsfw/tmtcservices/PusServiceBase.cpp +++ b/src/fsfw/tmtcservices/PusServiceBase.cpp @@ -21,21 +21,21 @@ PusServiceBase::~PusServiceBase() { QueueFactory::instance()->deleteMessageQueue ReturnValue_t PusServiceBase::performOperation(uint8_t opCode) { handleRequestQueue(); ReturnValue_t result = this->performService(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "PusService " << (uint16_t)this->serviceId << ": performService returned with " << (int16_t)result << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } - return RETURN_OK; + return returnvalue::OK; } void PusServiceBase::setTaskIF(PeriodicTaskIF* taskHandle) { this->taskHandle = taskHandle; } void PusServiceBase::handleRequestQueue() { TmTcMessage message; - ReturnValue_t result = RETURN_FAILED; + ReturnValue_t result = returnvalue::FAILED; for (uint8_t count = 0; count < PUS_SERVICE_MAX_RECEPTION; count++) { ReturnValue_t status = this->requestQueue->receiveMessage(&message); // if(status != MessageQueueIF::EMPTY) { @@ -48,7 +48,7 @@ void PusServiceBase::handleRequestQueue() { #endif // } - if (status == RETURN_OK) { + if (status == returnvalue::OK) { this->currentPacket.setStoreAddress(message.getStorageId(), ¤tPacket); // info << "Service " << (uint16_t) this->serviceId << // ": new packet!" << std::endl; @@ -57,7 +57,7 @@ void PusServiceBase::handleRequestQueue() { // debug << "Service " << (uint16_t)this->serviceId << // ": handleRequest returned: " << (int)return_code << std::endl; - if (result == RETURN_OK) { + if (result == returnvalue::OK) { this->verifyReporter.sendSuccessReport(tc_verification::COMPLETION_SUCCESS, &this->currentPacket); } else { @@ -69,7 +69,7 @@ void PusServiceBase::handleRequestQueue() { errorParameter1 = 0; errorParameter2 = 0; } else if (status == MessageQueueIF::EMPTY) { - status = RETURN_OK; + status = returnvalue::OK; // debug << "PusService " << (uint16_t)this->serviceId << // ": no new packet." << std::endl; break; @@ -89,7 +89,7 @@ MessageQueueId_t PusServiceBase::getRequestQueue() { return this->requestQueue-> ReturnValue_t PusServiceBase::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } AcceptsTelemetryIF* destService = @@ -105,12 +105,12 @@ ReturnValue_t PusServiceBase::initialize() { } this->requestQueue->setDefaultDestination(destService->getReportReceptionQueue()); distributor->registerService(this); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t PusServiceBase::initializeAfterTaskCreation() { // If task parameters, for example task frequency are required, this // function should be overriden and the system object task IF can // be used to get those parameters. - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw/tmtcservices/PusServiceBase.h b/src/fsfw/tmtcservices/PusServiceBase.h index 9db1bef0..6271f267 100644 --- a/src/fsfw/tmtcservices/PusServiceBase.h +++ b/src/fsfw/tmtcservices/PusServiceBase.h @@ -35,8 +35,7 @@ void setStaticFrameworkObjectIds(); */ class PusServiceBase : public ExecutableObjectIF, public AcceptsTelecommandsIF, - public SystemObject, - public HasReturnvaluesIF { + public SystemObject { friend void(Factory::setStaticFrameworkObjectIds)(); public: @@ -94,7 +93,7 @@ class PusServiceBase : public ExecutableObjectIF, * the TC requests afterwards. * performService is always executed afterwards. * @return @c RETURN_OK if the periodic performService was successful. - * @c RETURN_FAILED else. + * @c returnvalue::FAILED else. */ ReturnValue_t performOperation(uint8_t opCode) override; virtual uint16_t getIdentifier() override; diff --git a/src/fsfw/tmtcservices/SpacePacketParser.cpp b/src/fsfw/tmtcservices/SpacePacketParser.cpp index 4c10ae9e..b8364138 100644 --- a/src/fsfw/tmtcservices/SpacePacketParser.cpp +++ b/src/fsfw/tmtcservices/SpacePacketParser.cpp @@ -22,7 +22,7 @@ ReturnValue_t SpacePacketParser::parseSpacePackets(const uint8_t** buffer, const #else sif::printWarning("SpacePacketParser::parseSpacePackets: Frame invalid\n"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } const uint8_t* bufPtr = *buffer; @@ -30,7 +30,7 @@ ReturnValue_t SpacePacketParser::parseSpacePackets(const uint8_t** buffer, const uint16_t lengthField = bufPtr[idx + 4] << 8 | bufPtr[idx + 5]; size_t packetSize = lengthField + 7; startIndex = idx; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; if (lengthField == 0) { // Skip whole header for now foundSize = 6; diff --git a/src/fsfw/tmtcservices/TmTcBridge.cpp b/src/fsfw/tmtcservices/TmTcBridge.cpp index 8ea67119..0d50ebe2 100644 --- a/src/fsfw/tmtcservices/TmTcBridge.cpp +++ b/src/fsfw/tmtcservices/TmTcBridge.cpp @@ -23,28 +23,28 @@ TmTcBridge::~TmTcBridge() { QueueFactory::instance()->deleteMessageQueue(tmTcRec ReturnValue_t TmTcBridge::setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerCycle) { if (sentPacketsPerCycle <= LIMIT_STORED_DATA_SENT_PER_CYCLE) { this->sentPacketsPerCycle = sentPacketsPerCycle; - return RETURN_OK; + return returnvalue::OK; } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "TmTcBridge::setNumberOfSentPacketsPerCycle: Number of " << "packets sent per cycle exceeds limits. " << "Keeping default value." << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } } ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(uint8_t maxNumberOfPacketsStored) { if (maxNumberOfPacketsStored <= LIMIT_DOWNLINK_PACKETS_STORED) { this->maxNumberOfPacketsStored = maxNumberOfPacketsStored; - return RETURN_OK; + return returnvalue::OK; } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "TmTcBridge::setMaxNumberOfPacketsStored: Number of " << "packets stored exceeds limits. " << "Keeping default value." << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } } @@ -79,20 +79,20 @@ ReturnValue_t TmTcBridge::initialize() { tmFifo = new DynamicFIFO(maxNumberOfPacketsStored); tmTcReceptionQueue->setDefaultDestination(tcDistributor->getRequestQueue()); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t TmTcBridge::performOperation(uint8_t operationCode) { ReturnValue_t result; result = handleTc(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::debug << "TmTcBridge::performOperation: " << "Error handling TCs" << std::endl; #endif } result = handleTm(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::debug << "TmTcBridge::performOperation: " << "Error handling TMs" << std::endl; @@ -101,12 +101,12 @@ ReturnValue_t TmTcBridge::performOperation(uint8_t operationCode) { return result; } -ReturnValue_t TmTcBridge::handleTc() { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t TmTcBridge::handleTc() { return returnvalue::OK; } ReturnValue_t TmTcBridge::handleTm() { - ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t status = returnvalue::OK; ReturnValue_t result = handleTmQueue(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TmTcBridge::handleTm: Error handling TM queue with error code 0x" << std::hex << result << std::dec << "!" << std::endl; @@ -116,7 +116,7 @@ ReturnValue_t TmTcBridge::handleTm() { if (tmStored and communicationLinkUp and (packetSentCounter < sentPacketsPerCycle)) { result = handleStoredTm(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TmTcBridge::handleTm: Error handling stored TMs!" << std::endl; #endif @@ -131,9 +131,9 @@ ReturnValue_t TmTcBridge::handleTmQueue() { TmTcMessage message; const uint8_t* data = nullptr; size_t size = 0; - ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t status = returnvalue::OK; for (ReturnValue_t result = tmTcReceptionQueue->receiveMessage(&message); - result == HasReturnvaluesIF::RETURN_OK; + result == returnvalue::OK; result = tmTcReceptionQueue->receiveMessage(&message)) { #if FSFW_VERBOSE_LEVEL >= 3 #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -149,13 +149,13 @@ ReturnValue_t TmTcBridge::handleTmQueue() { } result = tmStore->getData(message.getStorageId(), &data, &size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; continue; } result = sendTm(data, size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } else { tmStore->deleteData(message.getStorageId()); @@ -168,7 +168,7 @@ ReturnValue_t TmTcBridge::handleTmQueue() { ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage* message) { store_address_t storeId = 0; if (tmFifo == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (tmFifo->full()) { @@ -185,18 +185,18 @@ ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage* message) { tmFifo->retrieve(&storeId); tmStore->deleteData(storeId); } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } storeId = message->getStorageId(); tmFifo->insert(storeId); tmStored = true; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t TmTcBridge::handleStoredTm() { - ReturnValue_t status = RETURN_OK; + ReturnValue_t status = returnvalue::OK; while (not tmFifo->empty() and packetSentCounter < sentPacketsPerCycle) { #if FSFW_CPP_OSTREAM_ENABLED == 1 // sif::info << "TMTC Bridge: Sending stored TM data. There are " @@ -208,12 +208,12 @@ ReturnValue_t TmTcBridge::handleStoredTm() { size_t size = 0; tmFifo->retrieve(&storeId); ReturnValue_t result = tmStore->getData(storeId, &data, &size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } result = sendTm(data, size); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TMTC Bridge: Could not send stored downlink data" << std::endl; #endif diff --git a/src/fsfw/tmtcservices/TmTcBridge.h b/src/fsfw/tmtcservices/TmTcBridge.h index 237f1f3e..3ebdac95 100644 --- a/src/fsfw/tmtcservices/TmTcBridge.h +++ b/src/fsfw/tmtcservices/TmTcBridge.h @@ -13,7 +13,6 @@ class TmTcBridge : public AcceptsTelemetryIF, public AcceptsTelecommandsIF, public ExecutableObjectIF, - public HasReturnvaluesIF, public SystemObject { public: static constexpr uint8_t TMTC_RECEPTION_QUEUE_DEPTH = 20; @@ -32,7 +31,7 @@ class TmTcBridge : public AcceptsTelemetryIF, * value must be smaller than MAX_STORED_DATA_SENT_PER_CYCLE * @param sentPacketsPerCycle * @return -@c RETURN_OK if value was set successfully - * -@c RETURN_FAILED otherwise, stored value stays the same + * -@c returnvalue::FAILED otherwise, stored value stays the same */ ReturnValue_t setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerCycle); @@ -41,7 +40,7 @@ class TmTcBridge : public AcceptsTelemetryIF, * value must be smaller than MAX_DOWNLINK_PACKETS_STORED * @param sentPacketsPerCycle * @return -@c RETURN_OK if value was set successfully - * -@c RETURN_FAILED otherwise, stored value stays the same + * -@c returnvalue::FAILED otherwise, stored value stays the same */ ReturnValue_t setMaxNumberOfPacketsStored(uint8_t maxNumberOfPacketsStored); diff --git a/src/fsfw/tmtcservices/VerificationReporter.cpp b/src/fsfw/tmtcservices/VerificationReporter.cpp index 9d06adc4..f833b445 100644 --- a/src/fsfw/tmtcservices/VerificationReporter.cpp +++ b/src/fsfw/tmtcservices/VerificationReporter.cpp @@ -25,7 +25,7 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id, TcPacketPusB currentPacket->getPacketId(), currentPacket->getPacketSequenceControl(), 0, set_step); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "VerificationReporter::sendSuccessReport: Error writing " << "to queue. Code: " << std::hex << status << std::dec << std::endl; @@ -42,7 +42,7 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id, uint8_t ackF PusVerificationMessage message(set_report_id, ackFlags, tcPacketId, tcSequenceControl, 0, set_step); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "VerificationReporter::sendSuccessReport: Error writing " << "to queue. Code: " << std::hex << status << std::dec << std::endl; @@ -63,7 +63,7 @@ void VerificationReporter::sendFailureReport(uint8_t report_id, TcPacketPusBase* report_id, currentPacket->getAcknowledgeFlags(), currentPacket->getPacketId(), currentPacket->getPacketSequenceControl(), error_code, step, parameter1, parameter2); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "VerificationReporter::sendFailureReport: Error writing " << "to queue. Code: " << std::hex << "0x" << status << std::dec << std::endl; @@ -81,7 +81,7 @@ void VerificationReporter::sendFailureReport(uint8_t report_id, uint8_t ackFlags PusVerificationMessage message(report_id, ackFlags, tcPacketId, tcSequenceControl, error_code, step, parameter1, parameter2); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); - if (status != HasReturnvaluesIF::RETURN_OK) { + if (status != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "VerificationReporter::sendFailureReport: Error writing " << "to queue. Code: " << std::hex << "0x" << status << std::dec << std::endl; diff --git a/src/fsfw_hal/common/gpio/GpioCookie.cpp b/src/fsfw_hal/common/gpio/GpioCookie.cpp index 4c4b4d14..f75ba4e8 100644 --- a/src/fsfw_hal/common/gpio/GpioCookie.cpp +++ b/src/fsfw_hal/common/gpio/GpioCookie.cpp @@ -11,7 +11,7 @@ ReturnValue_t GpioCookie::addGpio(gpioId_t gpioId, GpioBase* gpioConfig) { #else sif::printWarning("GpioCookie::addGpio: gpioConfig is nullpointer\n"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } auto gpioMapIter = gpioMap.find(gpioId); if (gpioMapIter == gpioMap.end()) { @@ -25,9 +25,9 @@ ReturnValue_t GpioCookie::addGpio(gpioId_t gpioId, GpioBase* gpioConfig) { sif::printWarning("GpioCookie::addGpio: Failed to add GPIO %d to GPIO map\n", gpioId); #endif #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -36,7 +36,7 @@ ReturnValue_t GpioCookie::addGpio(gpioId_t gpioId, GpioBase* gpioConfig) { sif::printWarning("GpioCookie::addGpio: GPIO already exists in GPIO map\n"); #endif #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } GpioMap GpioCookie::getGpioMap() const { return gpioMap; } diff --git a/src/fsfw_hal/common/gpio/GpioIF.h b/src/fsfw_hal/common/gpio/GpioIF.h index 5cca1481..feb356f4 100644 --- a/src/fsfw_hal/common/gpio/GpioIF.h +++ b/src/fsfw_hal/common/gpio/GpioIF.h @@ -13,7 +13,7 @@ class GpioCookie; * over GPIOs. * @author J. Meier */ -class GpioIF : public HasReturnvaluesIF { +class GpioIF { public: virtual ~GpioIF(){}; @@ -29,7 +29,7 @@ class GpioIF : public HasReturnvaluesIF { * functionality to pull a certain GPIO to high logic level. * * @param gpioId A unique number which specifies the GPIO to drive. - * @return Returns RETURN_OK for success. This should never return RETURN_FAILED. + * @return Returns RETURN_OK for success. This should never return returnvalue::FAILED. */ virtual ReturnValue_t pullHigh(gpioId_t gpioId) = 0; diff --git a/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.cpp b/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.cpp index 94e1331c..1ffc60f1 100644 --- a/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.cpp +++ b/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.cpp @@ -70,9 +70,9 @@ ReturnValue_t GyroHandlerL3GD20H::buildTransitionDeviceCommand(DeviceCommandId_t "GyroL3GD20Handler::buildTransitionDeviceCommand: " "Unknown internal state!\n"); #endif - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroHandlerL3GD20H::buildNormalDeviceCommand(DeviceCommandId_t *id) { @@ -135,7 +135,7 @@ ReturnValue_t GyroHandlerL3GD20H::buildCommandFromCommand(DeviceCommandId_t devi default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroHandlerL3GD20H::scanForReply(const uint8_t *start, size_t len, @@ -144,12 +144,12 @@ ReturnValue_t GyroHandlerL3GD20H::scanForReply(const uint8_t *start, size_t len, *foundId = this->getPendingCommand(); *foundLen = this->rawPacketLen; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroHandlerL3GD20H::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; switch (id) { case (L3GD20H::CONFIGURE_CTRL_REGS): { commandExecuted = true; @@ -207,7 +207,7 @@ ReturnValue_t GyroHandlerL3GD20H::interpretDeviceReply(DeviceCommandId_t id, } PoolReadGuard readSet(&dataset); - if (readSet.getReadResult() == HasReturnvaluesIF::RETURN_OK) { + if (readSet.getReadResult() == returnvalue::OK) { if (std::abs(angVelocX) < this->absLimitX) { dataset.angVelocX = angVelocX; dataset.angVelocX.setValid(true); @@ -252,7 +252,7 @@ ReturnValue_t GyroHandlerL3GD20H::initializeLocalDataPool(localpool::DataPool &l localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Y, new PoolEntry({0.0})); localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Z, new PoolEntry({0.0})); localDataPoolMap.emplace(L3GD20H::TEMPERATURE, new PoolEntry({0.0})); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void GyroHandlerL3GD20H::fillCommandAndReplyMap() { diff --git a/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp b/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp index 5ddc3245..b4d64dbc 100644 --- a/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp +++ b/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp @@ -82,7 +82,7 @@ ReturnValue_t MgmLIS3MDLHandler::buildTransitionDeviceCommand(DeviceCommandId_t #else sif::printWarning("GyroHandler::buildTransitionDeviceCommand: Unknown internal state!\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } } return buildCommandFromCommand(*id, NULL, 0); @@ -137,7 +137,7 @@ ReturnValue_t MgmLIS3MDLHandler::buildCommandFromCommand(DeviceCommandId_t devic rawPacket = commandBuffer; rawPacketLen = MGMLIS3MDL::NR_OF_DATA_AND_CFG_REGISTERS + 1; - return RETURN_OK; + return returnvalue::OK; } case (MGMLIS3MDL::READ_TEMPERATURE): { std::memset(commandBuffer, 0, 3); @@ -145,7 +145,7 @@ ReturnValue_t MgmLIS3MDLHandler::buildCommandFromCommand(DeviceCommandId_t devic rawPacket = commandBuffer; rawPacketLen = 3; - return RETURN_OK; + return returnvalue::OK; } case (MGMLIS3MDL::IDENTIFY_DEVICE): { return identifyDevice(); @@ -155,7 +155,7 @@ ReturnValue_t MgmLIS3MDLHandler::buildCommandFromCommand(DeviceCommandId_t devic } case (MGMLIS3MDL::SETUP_MGM): { setupMgm(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } case (MGMLIS3MDL::ACCURACY_OP_MODE_SET): { return setOperatingMode(commandData, commandDataLen); @@ -163,7 +163,7 @@ ReturnValue_t MgmLIS3MDLHandler::buildCommandFromCommand(DeviceCommandId_t devic default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t MgmLIS3MDLHandler::identifyDevice() { @@ -174,7 +174,7 @@ ReturnValue_t MgmLIS3MDLHandler::identifyDevice() { rawPacket = commandBuffer; rawPacketLen = size; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t MgmLIS3MDLHandler::scanForReply(const uint8_t *start, size_t len, @@ -234,7 +234,7 @@ ReturnValue_t MgmLIS3MDLHandler::scanForReply(const uint8_t *start, size_t len, /* Data with SPI Interface always has this answer */ if (start[0] == 0b11111111) { - return RETURN_OK; + return returnvalue::OK; } else { return DeviceHandlerIF::INVALID_DATA; } @@ -285,7 +285,7 @@ ReturnValue_t MgmLIS3MDLHandler::interpretDeviceReply(DeviceCommandId_t id, cons } PoolReadGuard readHelper(&dataset); - if (readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) { + if (readHelper.getReadResult() == returnvalue::OK) { if (std::abs(mgmX) > absLimitX or std::abs(mgmY) > absLimitY or std::abs(mgmZ) > absLimitZ) { dataset.fieldStrengths.setValid(false); @@ -320,7 +320,7 @@ ReturnValue_t MgmLIS3MDLHandler::interpretDeviceReply(DeviceCommandId_t id, cons } ReturnValue_t result = dataset.read(); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { dataset.temperature = tempValue; dataset.commit(); } @@ -331,7 +331,7 @@ ReturnValue_t MgmLIS3MDLHandler::interpretDeviceReply(DeviceCommandId_t id, cons return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY; } } - return RETURN_OK; + return returnvalue::OK; } MGMLIS3MDL::Sensitivies MgmLIS3MDLHandler::getSensitivity(uint8_t ctrlRegister2) { @@ -394,7 +394,7 @@ ReturnValue_t MgmLIS3MDLHandler::enableTemperatureSensor(const uint8_t *commandD rawPacket = commandBuffer; rawPacketLen = size; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t MgmLIS3MDLHandler::setOperatingMode(const uint8_t *commandData, @@ -451,7 +451,7 @@ ReturnValue_t MgmLIS3MDLHandler::prepareCtrlRegisterWrite() { rawPacketLen = MGMLIS3MDL::NR_OF_CTRL_REGISTERS + 1; // We dont have to check if this is working because we just did i - return RETURN_OK; + return returnvalue::OK; } void MgmLIS3MDLHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) { @@ -467,7 +467,7 @@ ReturnValue_t MgmLIS3MDLHandler::initializeLocalDataPool(localpool::DataPool &lo localDataPoolMap.emplace(MGMLIS3MDL::FIELD_STRENGTHS, &mgmXYZ); localDataPoolMap.emplace(MGMLIS3MDL::TEMPERATURE_CELCIUS, &temperature); poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 10.0, false); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void MgmLIS3MDLHandler::setAbsoluteLimits(float xLimit, float yLimit, float zLimit) { diff --git a/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp b/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp index c329f5a6..24e90c9f 100644 --- a/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp +++ b/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp @@ -93,7 +93,7 @@ ReturnValue_t MgmRM3100Handler::buildTransitionDeviceCommand(DeviceCommandId_t * "Unknown internal state\n"); #endif #endif - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } return buildCommandFromCommand(*id, commandBuffer, commandLen); @@ -146,7 +146,7 @@ ReturnValue_t MgmRM3100Handler::buildCommandFromCommand(DeviceCommandId_t device default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t MgmRM3100Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) { @@ -159,11 +159,11 @@ ReturnValue_t MgmRM3100Handler::scanForReply(const uint8_t *start, size_t len, // For SPI, ID will always be the one of the last sent command *foundId = this->getPendingCommand(); *foundLen = len; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t MgmRM3100Handler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; switch (id) { case (RM3100::CONFIGURE_CMM): case (RM3100::CONFIGURE_CYCLE_COUNT): @@ -250,7 +250,7 @@ ReturnValue_t MgmRM3100Handler::handleCycleCountConfigCommand(DeviceCommandId_t std::memcpy(commandBuffer + 5, &cycleCountRegValueZ, 2); rawPacketLen = 7; rawPacket = commandBuffer; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t MgmRM3100Handler::handleCycleCommand(bool oneCycleValue, const uint8_t *commandData, @@ -258,7 +258,7 @@ ReturnValue_t MgmRM3100Handler::handleCycleCommand(bool oneCycleValue, const uin RM3100::CycleCountCommand command(oneCycleValue); ReturnValue_t result = command.deSerialize(&commandData, &commandDataLen, SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -274,7 +274,7 @@ ReturnValue_t MgmRM3100Handler::handleCycleCommand(bool oneCycleValue, const uin cycleCountRegValueX = command.cycleCountX; cycleCountRegValueY = command.cycleCountY; cycleCountRegValueZ = command.cycleCountZ; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t MgmRM3100Handler::handleTmrcConfigCommand(DeviceCommandId_t deviceCommand, @@ -289,7 +289,7 @@ ReturnValue_t MgmRM3100Handler::handleTmrcConfigCommand(DeviceCommandId_t device tmrcRegValue = commandData[0]; rawPacketLen = 2; rawPacket = commandBuffer; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void MgmRM3100Handler::fillCommandAndReplyMap() { @@ -311,7 +311,7 @@ ReturnValue_t MgmRM3100Handler::initializeLocalDataPool(localpool::DataPool &loc LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(RM3100::FIELD_STRENGTHS, &mgmXYZ); poolManager.subscribeForPeriodicPacket(primaryDataset.getSid(), false, 10.0, false); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } uint32_t MgmRM3100Handler::getTransitionDelayMs(Mode_t from, Mode_t to) { @@ -352,13 +352,13 @@ ReturnValue_t MgmRM3100Handler::handleDataReadout(const uint8_t *packet) { // TODO: Sanity check on values? PoolReadGuard readGuard(&primaryDataset); - if (readGuard.getReadResult() == HasReturnvaluesIF::RETURN_OK) { + if (readGuard.getReadResult() == returnvalue::OK) { primaryDataset.fieldStrengths[0] = fieldStrengthX; primaryDataset.fieldStrengths[1] = fieldStrengthY; primaryDataset.fieldStrengths[2] = fieldStrengthZ; primaryDataset.setValidity(true, true); } - return RETURN_OK; + return returnvalue::OK; } void MgmRM3100Handler::enablePeriodicPrintouts(bool enable, uint8_t divider) { diff --git a/src/fsfw_hal/linux/CommandExecutor.cpp b/src/fsfw_hal/linux/CommandExecutor.cpp index 49c44ebf..8b81d94f 100644 --- a/src/fsfw_hal/linux/CommandExecutor.cpp +++ b/src/fsfw_hal/linux/CommandExecutor.cpp @@ -23,7 +23,7 @@ ReturnValue_t CommandExecutor::load(std::string command, bool blocking, bool pri if (state == States::IDLE) { state = States::COMMAND_LOADED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t CommandExecutor::execute() { @@ -35,7 +35,7 @@ ReturnValue_t CommandExecutor::execute() { currentCmdFile = popen(currentCmd.c_str(), "r"); if (currentCmdFile == nullptr) { lastError = errno; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (blocking) { ReturnValue_t result = executeBlocking(); @@ -46,7 +46,7 @@ ReturnValue_t CommandExecutor::execute() { waiter.fd = currentFd; } state = States::PENDING; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t CommandExecutor::close() { @@ -56,7 +56,7 @@ ReturnValue_t CommandExecutor::close() { pclose(currentCmdFile); } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void CommandExecutor::printLastError(std::string funcName) const { @@ -79,7 +79,7 @@ void CommandExecutor::setRingBuffer(SimpleRingBuffer* ringBuffer, ReturnValue_t CommandExecutor::check(bool& replyReceived) { if (blocking) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } switch (state) { case (States::IDLE): @@ -94,7 +94,7 @@ ReturnValue_t CommandExecutor::check(bool& replyReceived) { int result = poll(&waiter, 1, 0); switch (result) { case (0): { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; break; } case (1): { @@ -151,7 +151,7 @@ ReturnValue_t CommandExecutor::check(bool& replyReceived) { ReturnValue_t retval = EXECUTION_FINISHED; if (result != 0) { lastError = result; - retval = HasReturnvaluesIF::RETURN_FAILED; + retval = returnvalue::FAILED; } state = States::IDLE; currentCmdFile = nullptr; @@ -161,7 +161,7 @@ ReturnValue_t CommandExecutor::check(bool& replyReceived) { break; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void CommandExecutor::reset() { @@ -201,7 +201,7 @@ ReturnValue_t CommandExecutor::executeBlocking() { int result = pclose(currentCmdFile); if (result != 0) { lastError = result; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw_hal/linux/CommandExecutor.h b/src/fsfw_hal/linux/CommandExecutor.h index 90662c0f..f817b0c2 100644 --- a/src/fsfw_hal/linux/CommandExecutor.h +++ b/src/fsfw_hal/linux/CommandExecutor.h @@ -32,19 +32,19 @@ class CommandExecutor { //! [EXPORT] : [COMMENT] Execution of the current command has finished static constexpr ReturnValue_t EXECUTION_FINISHED = - HasReturnvaluesIF::makeReturnCode(CLASS_ID, 0); + returnvalue::makeCode(CLASS_ID, 0); //! [EXPORT] : [COMMENT] Command is pending. This will also be returned if the user tries //! to load another command but a command is still pending - static constexpr ReturnValue_t COMMAND_PENDING = HasReturnvaluesIF::makeReturnCode(CLASS_ID, 1); + static constexpr ReturnValue_t COMMAND_PENDING = returnvalue::makeCode(CLASS_ID, 1); //! [EXPORT] : [COMMENT] Some bytes have been read from the executing process - static constexpr ReturnValue_t BYTES_READ = HasReturnvaluesIF::makeReturnCode(CLASS_ID, 2); + static constexpr ReturnValue_t BYTES_READ = returnvalue::makeCode(CLASS_ID, 2); //! [EXPORT] : [COMMENT] Command execution failed - static constexpr ReturnValue_t COMMAND_ERROR = HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3); + static constexpr ReturnValue_t COMMAND_ERROR = returnvalue::makeCode(CLASS_ID, 3); //! [EXPORT] : [COMMENT] static constexpr ReturnValue_t NO_COMMAND_LOADED_OR_PENDING = - HasReturnvaluesIF::makeReturnCode(CLASS_ID, 4); - static constexpr ReturnValue_t PCLOSE_CALL_ERROR = HasReturnvaluesIF::makeReturnCode(CLASS_ID, 6); + returnvalue::makeCode(CLASS_ID, 4); + static constexpr ReturnValue_t PCLOSE_CALL_ERROR = returnvalue::makeCode(CLASS_ID, 6); /** * Constructor. Is initialized with maximum size of internal buffer to read data from the @@ -64,7 +64,7 @@ class CommandExecutor { /** * Execute the loaded command. * @return - * - In blocking mode, it will return RETURN_FAILED if + * - In blocking mode, it will return returnvalue::FAILED if * the result of the system call was not 0. The error value can be accessed using * getLastError * - In non-blocking mode, this call will start @@ -78,7 +78,7 @@ class CommandExecutor { * - BYTES_READ if bytes have been read from the executing process. It is recommended to call * check again after this * - RETURN_OK execution is pending, but no bytes have been read from the executing process - * - RETURN_FAILED if execution has failed, error value can be accessed using getLastError + * - returnvalue::FAILED if execution has failed, error value can be accessed using getLastError * - EXECUTION_FINISHED if the process was executed successfully * - NO_COMMAND_LOADED_OR_PENDING self-explanatory * - COMMAND_ERROR internal poll error diff --git a/src/fsfw_hal/linux/UnixFileGuard.h b/src/fsfw_hal/linux/UnixFileGuard.h index d94234b6..1fe47116 100644 --- a/src/fsfw_hal/linux/UnixFileGuard.h +++ b/src/fsfw_hal/linux/UnixFileGuard.h @@ -24,7 +24,7 @@ class UnixFileGuard { private: int* fileDescriptor = nullptr; - ReturnValue_t openStatus = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t openStatus = returnvalue::OK; }; #endif /* LINUX_UTILITY_UNIXFILEGUARD_H_ */ diff --git a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.cpp b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.cpp index 15061d14..cecc1f3f 100644 --- a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.cpp +++ b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.cpp @@ -23,30 +23,30 @@ ReturnValue_t LinuxLibgpioIF::addGpios(GpioCookie* gpioCookie) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "LinuxLibgpioIF::addGpios: Invalid cookie" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } GpioMap mapToAdd = gpioCookie->getGpioMap(); /* Check whether this ID already exists in the map and remove duplicates */ result = checkForConflicts(mapToAdd); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = configureGpios(mapToAdd); - if (result != RETURN_OK) { - return RETURN_FAILED; + if (result != returnvalue::OK) { + return returnvalue::FAILED; } /* Register new GPIOs in gpioMap */ gpioMap.insert(mapToAdd.begin(), mapToAdd.end()); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap& mapToAdd) { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; for (auto& gpioConfig : mapToAdd) { auto& gpioType = gpioConfig.second->gpioType; switch (gpioType) { @@ -86,7 +86,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap& mapToAdd) { gpioCallback->initValue, gpioCallback->callbackArgs); } } - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return GPIO_INIT_FAILED; } } @@ -102,7 +102,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpioByLabel(gpioId_t gpioId, sif::warning << "LinuxLibgpioIF::configureGpioByLabel: Failed to open gpio from gpio " << "group with label " << label << ". Gpio ID: " << gpioId << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } std::string failOutput = "label: " + label; return configureRegularGpio(gpioId, chip, gpioByLabel, failOutput); @@ -116,7 +116,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpioByChip(gpioId_t gpioId, GpiodRegularB sif::warning << "LinuxLibgpioIF::configureGpioByChip: Failed to open chip " << chipname << ". Gpio ID: " << gpioId << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } std::string failOutput = "chipname: " + chipname; return configureRegularGpio(gpioId, chip, gpioByChip, failOutput); @@ -132,7 +132,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpioByLineName(gpioId_t gpioId, gpiod_ctxless_find_line(lineName.c_str(), chipname, MAX_CHIPNAME_LENGTH, &lineOffset); if (result != LINE_FOUND) { parseFindeLineResult(result, lineName); - return RETURN_FAILED; + return returnvalue::FAILED; } gpioByLineName.lineNum = static_cast(lineOffset); @@ -143,7 +143,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpioByLineName(gpioId_t gpioId, sif::warning << "LinuxLibgpioIF::configureGpioByLineName: Failed to open chip " << chipname << ". callback(gpioMapIter->first, gpio::GpioOperation::WRITE, gpio::Levels::HIGH, gpioCallback->callbackArgs); - return RETURN_OK; + return returnvalue::OK; } return GPIO_TYPE_FAILURE; } @@ -270,7 +270,7 @@ ReturnValue_t LinuxLibgpioIF::pullLow(gpioId_t gpioId) { } gpioCallback->callback(gpioMapIter->first, gpio::GpioOperation::WRITE, gpio::Levels::LOW, gpioCallback->callbackArgs); - return RETURN_OK; + return returnvalue::OK; } return GPIO_TYPE_FAILURE; } @@ -291,7 +291,7 @@ ReturnValue_t LinuxLibgpioIF::driveGpio(gpioId_t gpioId, GpiodRegularBase& regul return DRIVE_GPIO_FAILURE; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t LinuxLibgpioIF::readGpio(gpioId_t gpioId, int* gpioState) { @@ -321,14 +321,14 @@ ReturnValue_t LinuxLibgpioIF::readGpio(gpioId_t gpioId, int* gpioState) { } gpioCallback->callback(gpioMapIter->first, gpio::GpioOperation::READ, gpio::Levels::NONE, gpioCallback->callbackArgs); - return RETURN_OK; + return returnvalue::OK; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t LinuxLibgpioIF::checkForConflicts(GpioMap& mapToAdd) { - ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t status = returnvalue::OK; + ReturnValue_t result = returnvalue::OK; for (auto& gpioConfig : mapToAdd) { switch (gpioConfig.second->gpioType) { case (gpio::GpioTypes::GPIO_REGULAR_BY_CHIP): @@ -340,7 +340,7 @@ ReturnValue_t LinuxLibgpioIF::checkForConflicts(GpioMap& mapToAdd) { } // Check for conflicts and remove duplicates if necessary result = checkForConflictsById(gpioConfig.first, gpioConfig.second->gpioType, mapToAdd); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } break; @@ -352,7 +352,7 @@ ReturnValue_t LinuxLibgpioIF::checkForConflicts(GpioMap& mapToAdd) { } // Check for conflicts and remove duplicates if necessary result = checkForConflictsById(gpioConfig.first, gpioConfig.second->gpioType, mapToAdd); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { status = result; } break; @@ -426,7 +426,7 @@ ReturnValue_t LinuxLibgpioIF::checkForConflictsById(gpioId_t gpioIdToCheck, mapToAdd.erase(gpioIdToCheck); return GPIO_DUPLICATE_DETECTED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void LinuxLibgpioIF::parseFindeLineResult(int result, std::string& lineName) { diff --git a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h index fcc9c775..f9ba680b 100644 --- a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +++ b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h @@ -71,7 +71,7 @@ class LinuxLibgpioIF : public GpioIF, public SystemObject { * * @param mapToAdd The GPIOs which shall be added to the gpioMap. * - * @return RETURN_OK if successful, otherwise RETURN_FAILED + * @return RETURN_OK if successful, otherwise returnvalue::FAILED */ ReturnValue_t checkForConflicts(GpioMap& mapToAdd); diff --git a/src/fsfw_hal/linux/i2c/I2cComIF.cpp b/src/fsfw_hal/linux/i2c/I2cComIF.cpp index 4f53dc1f..8edeb8ab 100644 --- a/src/fsfw_hal/linux/i2c/I2cComIF.cpp +++ b/src/fsfw_hal/linux/i2c/I2cComIF.cpp @@ -52,16 +52,16 @@ ReturnValue_t I2cComIF::initializeInterface(CookieIF* cookie) { << i2cAddress << "to I2C device " << "map" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "I2cComIF::initializeInterface: Device with address " << i2cAddress << "already in use" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, size_t sendLen) { @@ -73,11 +73,11 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "I2cComIF::sendMessage: Send Data is nullptr" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } if (sendLen == 0) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } I2cCookie* i2cCookie = dynamic_cast(cookie); @@ -95,16 +95,16 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s sif::error << "I2cComIF::sendMessage: i2cAddress of Cookie not " << "registered in i2cDeviceMap" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } deviceFile = i2cCookie->getDeviceFile(); UnixFileGuard fileHelper(deviceFile, &fd, O_RDWR, "I2cComIF::sendMessage"); - if (fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) { + if (fileHelper.getOpenResult() != returnvalue::OK) { return fileHelper.getOpenResult(); } result = openDevice(deviceFile, i2cAddress, &fd); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -114,17 +114,17 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s "device with error code " << errno << ". Error description: " << strerror(errno) << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } #if FSFW_HAL_I2C_WIRETAPPING == 1 sif::info << "Sent I2C data to bus " << deviceFile << ":" << std::endl; arrayprinter::print(sendData, sendLen); #endif - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } -ReturnValue_t I2cComIF::getSendSuccess(CookieIF* cookie) { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t I2cComIF::getSendSuccess(CookieIF* cookie) { return returnvalue::OK; } ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLen) { ReturnValue_t result; @@ -132,7 +132,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe std::string deviceFile; if (requestLen == 0) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } I2cCookie* i2cCookie = dynamic_cast(cookie); @@ -152,16 +152,16 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe << "registered in i2cDeviceMap" << std::endl; #endif i2cDeviceMapIter->second.replyLen = 0; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } deviceFile = i2cCookie->getDeviceFile(); UnixFileGuard fileHelper(deviceFile, &fd, O_RDWR, "I2cComIF::requestReceiveMessage"); - if (fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) { + if (fileHelper.getOpenResult() != returnvalue::OK) { return fileHelper.getOpenResult(); } result = openDevice(deviceFile, i2cAddress, &fd); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { i2cDeviceMapIter->second.replyLen = 0; return result; } @@ -182,7 +182,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe sif::debug << "I2cComIF::requestReceiveMessage: Read " << readLen << " of " << requestLen << " bytes" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } #if FSFW_HAL_I2C_WIRETAPPING == 1 @@ -191,7 +191,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe #endif i2cDeviceMapIter->second.replyLen = requestLen; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t I2cComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) { @@ -210,12 +210,12 @@ ReturnValue_t I2cComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, sif::error << "I2cComIF::readReceivedMessage: i2cAddress of Cookie not " << "found in i2cDeviceMap" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *buffer = i2cDeviceMapIter->second.replyBuffer.data(); *size = i2cDeviceMapIter->second.replyLen; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t I2cComIF::openDevice(std::string deviceFile, address_t i2cAddress, @@ -231,7 +231,7 @@ ReturnValue_t I2cComIF::openDevice(std::string deviceFile, address_t i2cAddress, sif::printWarning("Error description: %s\n", strerror(errno)); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_VERBOSE_LEVEL >= 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw_hal/linux/i2c/I2cComIF.h b/src/fsfw_hal/linux/i2c/I2cComIF.h index cf3bbe49..7101b9b6 100644 --- a/src/fsfw_hal/linux/i2c/I2cComIF.h +++ b/src/fsfw_hal/linux/i2c/I2cComIF.h @@ -49,7 +49,7 @@ class I2cComIF : public DeviceCommunicationIF, public SystemObject { * @param deviceFile The name of the device file. E.g. i2c-0 * @param i2cAddress The address of the i2c slave device. * @param fileDescriptor Pointer to device descriptor. - * @return RETURN_OK if successful, otherwise RETURN_FAILED. + * @return RETURN_OK if successful, otherwise returnvalue::FAILED. */ ReturnValue_t openDevice(std::string deviceFile, address_t i2cAddress, int *fileDescriptor); }; diff --git a/src/fsfw_hal/linux/rpi/GpioRPi.cpp b/src/fsfw_hal/linux/rpi/GpioRPi.cpp index d3c0a577..a6b097bf 100644 --- a/src/fsfw_hal/linux/rpi/GpioRPi.cpp +++ b/src/fsfw_hal/linux/rpi/GpioRPi.cpp @@ -9,7 +9,7 @@ ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int std::string consumer, gpio::Direction direction, gpio::Levels initValue) { if (cookie == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } auto config = new GpiodRegularByChip(); @@ -30,9 +30,9 @@ ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int sif::printError("createRpiGpioConfig: BCM pin %d invalid!\n", bcmPin); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_VERBOSE_LEVEL >= 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } config->lineNum = bcmPin; cookie->addGpio(gpioId, config); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw_hal/linux/spi/SpiComIF.cpp b/src/fsfw_hal/linux/spi/SpiComIF.cpp index b06def69..cc52b689 100644 --- a/src/fsfw_hal/linux/spi/SpiComIF.cpp +++ b/src/fsfw_hal/linux/spi/SpiComIF.cpp @@ -56,7 +56,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF* cookie) { static_cast(spiAddress)); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_VERBOSE_LEVEL >= 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } /* Now we emplaced the read buffer in the map, we still need to assign that location to the SPI driver transfer struct */ @@ -69,7 +69,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF* cookie) { sif::printError("SpiComIF::initializeInterface: SPI address already exists!\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_VERBOSE_LEVEL >= 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } /* Pull CS high in any case to be sure that device is inactive */ @@ -87,7 +87,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF* cookie) { int fileDescriptor = 0; UnixFileGuard fileHelper(spiCookie->getSpiDevice(), &fileDescriptor, O_RDWR, "SpiComIF::initializeInterface"); - if (fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) { + if (fileHelper.getOpenResult() != returnvalue::OK) { return fileHelper.getOpenResult(); } @@ -129,12 +129,12 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF* cookie) { "Could not write bits per word!"); } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t SpiComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, size_t sendLen) { SpiCookie* spiCookie = dynamic_cast(cookie); - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; if (spiCookie == nullptr) { return NULLPOINTER; @@ -178,13 +178,13 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const spiCookie->assignReadBuffer(iter->second.replyBuffer.data()); } - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; int retval = 0; /* Prepare transfer */ int fileDescriptor = 0; std::string device = spiCookie->getSpiDevice(); UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "SpiComIF::sendMessage"); - if (fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) { + if (fileHelper.getOpenResult() != returnvalue::OK) { return OPENING_FILE_FAILED; } spi::SpiModes spiMode = spi::SpiModes::MODE_0; @@ -200,7 +200,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const /* Pull SPI CS low. For now, no support for active high given */ if (gpioId != gpio::NO_GPIO) { result = spiMutex->lockMutex(timeoutType, timeoutMs); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "SpiComIF::sendMessage: Failed to lock mutex" << std::endl; @@ -211,7 +211,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const return result; } result = gpioComIF->pullLow(gpioId); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "SpiComIF::sendMessage: Pulling low CS pin failed" << std::endl; @@ -251,7 +251,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const if (gpioId != gpio::NO_GPIO) { gpioComIF->pullHigh(gpioId); result = spiMutex->unlockMutex(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "SpiComIF::sendMessage: Failed to unlock mutex" << std::endl; #endif @@ -261,7 +261,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const return result; } -ReturnValue_t SpiComIF::getSendSuccess(CookieIF* cookie) { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t SpiComIF::getSendSuccess(CookieIF* cookie) { return returnvalue::OK; } ReturnValue_t SpiComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLen) { SpiCookie* spiCookie = dynamic_cast(cookie); @@ -270,32 +270,32 @@ ReturnValue_t SpiComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe } if (spiCookie->isFullDuplex()) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } return performHalfDuplexReception(spiCookie); } ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::string device = spiCookie->getSpiDevice(); int fileDescriptor = 0; UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "SpiComIF::requestReceiveMessage"); - if (fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) { + if (fileHelper.getOpenResult() != returnvalue::OK) { return OPENING_FILE_FAILED; } uint8_t* rxBuf = nullptr; size_t readSize = spiCookie->getCurrentTransferSize(); result = getReadBuffer(spiCookie->getSpiAddress(), &rxBuf); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } gpioId_t gpioId = spiCookie->getChipSelectPin(); if (gpioId != gpio::NO_GPIO) { result = spiMutex->lockMutex(timeoutType, timeoutMs); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "SpiComIF::getSendSuccess: Failed to lock mutex" << std::endl; #endif @@ -318,7 +318,7 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) { if (gpioId != gpio::NO_GPIO) { gpioComIF->pullHigh(gpioId); result = spiMutex->unlockMutex(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "SpiComIF::getSendSuccess: Failed to unlock mutex" << std::endl; #endif @@ -332,18 +332,18 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) { ReturnValue_t SpiComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) { SpiCookie* spiCookie = dynamic_cast(cookie); if (spiCookie == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } uint8_t* rxBuf = nullptr; ReturnValue_t result = getReadBuffer(spiCookie->getSpiAddress(), &rxBuf); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } *buffer = rxBuf; *size = spiCookie->getCurrentTransferSize(); spiCookie->setTransferSize(0); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } MutexIF* SpiComIF::getMutex(MutexIF::TimeoutType* timeoutType, uint32_t* timeoutMs) { @@ -377,16 +377,16 @@ void SpiComIF::performSpiWiretapping(SpiCookie* spiCookie) { ReturnValue_t SpiComIF::getReadBuffer(address_t spiAddress, uint8_t** buffer) { if (buffer == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } auto iter = spiDeviceMap.find(spiAddress); if (iter == spiDeviceMap.end()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *buffer = iter->second.replyBuffer.data(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } GpioIF* SpiComIF::getGpioInterface() { return gpioComIF; } diff --git a/src/fsfw_hal/linux/uart/UartComIF.cpp b/src/fsfw_hal/linux/uart/UartComIF.cpp index f77bdeae..8947c562 100644 --- a/src/fsfw_hal/linux/uart/UartComIF.cpp +++ b/src/fsfw_hal/linux/uart/UartComIF.cpp @@ -37,7 +37,7 @@ ReturnValue_t UartComIF::initializeInterface(CookieIF* cookie) { if (uartDeviceMapIter == uartDeviceMap.end()) { int fileDescriptor = configureUartPort(uartCookie); if (fileDescriptor < 0) { - return RETURN_FAILED; + return returnvalue::FAILED; } size_t maxReplyLen = uartCookie->getMaxReplyLen(); UartElements uartElements = {fileDescriptor, std::vector(maxReplyLen), 0}; @@ -47,17 +47,17 @@ ReturnValue_t UartComIF::initializeInterface(CookieIF* cookie) { sif::warning << "UartComIF::initializeInterface: Failed to insert device " << deviceFile << "to UART device map" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "UartComIF::initializeInterface: UART device " << deviceFile << " already in use" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } - return RETURN_OK; + return returnvalue::OK; } int UartComIF::configureUartPort(UartCookie* uartCookie) { @@ -329,14 +329,14 @@ ReturnValue_t UartComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, UartDeviceMapIter uartDeviceMapIter; if (sendLen == 0) { - return RETURN_OK; + return returnvalue::OK; } if (sendData == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "UartComIF::sendMessage: Send data is nullptr" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } UartCookie* uartCookie = dynamic_cast(cookie); @@ -354,7 +354,7 @@ ReturnValue_t UartComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, sif::debug << "UartComIF::sendMessage: Device file " << deviceFile << "not in UART map" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } fd = uartDeviceMapIter->second.fileDescriptor; @@ -364,13 +364,13 @@ ReturnValue_t UartComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, sif::error << "UartComIF::sendMessage: Failed to send data with error code " << errno << ": Error description: " << strerror(errno) << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } - return RETURN_OK; + return returnvalue::OK; } -ReturnValue_t UartComIF::getSendSuccess(CookieIF* cookie) { return RETURN_OK; } +ReturnValue_t UartComIF::getSendSuccess(CookieIF* cookie) { return returnvalue::OK; } ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLen) { std::string deviceFile; @@ -389,7 +389,7 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL uartDeviceMapIter = uartDeviceMap.find(deviceFile); if (uartMode == UartModes::NON_CANONICAL and requestLen == 0) { - return RETURN_OK; + return returnvalue::OK; } if (uartDeviceMapIter == uartDeviceMap.end()) { @@ -397,7 +397,7 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL sif::debug << "UartComIF::requestReceiveMessage: Device file " << deviceFile << " not in uart map" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } if (uartMode == UartModes::CANONICAL) { @@ -405,13 +405,13 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL } else if (uartMode == UartModes::NON_CANONICAL) { return handleNoncanonicalRead(*uartCookie, uartDeviceMapIter, requestLen); } else { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } ReturnValue_t UartComIF::handleCanonicalRead(UartCookie& uartCookie, UartDeviceMapIter& iter, size_t requestLen) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; uint8_t maxReadCycles = uartCookie.getReadCycles(); uint8_t currentReadCycles = 0; int bytesRead = 0; @@ -454,7 +454,7 @@ ReturnValue_t UartComIF::handleCanonicalRead(UartCookie& uartCookie, UartDeviceM strerror(errno)); #endif #endif - return RETURN_FAILED; + return returnvalue::FAILED; } } else if (bytesRead > 0) { @@ -487,18 +487,18 @@ ReturnValue_t UartComIF::handleNoncanonicalRead(UartCookie& uartCookie, UartDevi } int bytesRead = read(fd, bufferPtr, requestLen); if (bytesRead < 0) { - return RETURN_FAILED; + return returnvalue::FAILED; } else if (bytesRead != static_cast(requestLen)) { if (uartCookie.isReplySizeFixed()) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "UartComIF::requestReceiveMessage: Only read " << bytesRead << " of " << requestLen << " bytes" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } } iter->second.replyLen = bytesRead; - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t UartComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) { @@ -520,7 +520,7 @@ ReturnValue_t UartComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, sif::debug << "UartComIF::readReceivedMessage: Device file " << deviceFile << " not in uart map" << std::endl; #endif - return RETURN_FAILED; + return returnvalue::FAILED; } *buffer = uartDeviceMapIter->second.replyBuffer.data(); @@ -529,7 +529,7 @@ ReturnValue_t UartComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, /* Length is reset to 0 to prevent reading the same data twice */ uartDeviceMapIter->second.replyLen = 0; - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t UartComIF::flushUartRxBuffer(CookieIF* cookie) { @@ -547,9 +547,9 @@ ReturnValue_t UartComIF::flushUartRxBuffer(CookieIF* cookie) { if (uartDeviceMapIter != uartDeviceMap.end()) { int fd = uartDeviceMapIter->second.fileDescriptor; tcflush(fd, TCIFLUSH); - return RETURN_OK; + return returnvalue::OK; } - return RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF* cookie) { @@ -567,9 +567,9 @@ ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF* cookie) { if (uartDeviceMapIter != uartDeviceMap.end()) { int fd = uartDeviceMapIter->second.fileDescriptor; tcflush(fd, TCOFLUSH); - return RETURN_OK; + return returnvalue::OK; } - return RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF* cookie) { @@ -587,9 +587,9 @@ ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF* cookie) { if (uartDeviceMapIter != uartDeviceMap.end()) { int fd = uartDeviceMapIter->second.fileDescriptor; tcflush(fd, TCIOFLUSH); - return RETURN_OK; + return returnvalue::OK; } - return RETURN_FAILED; + return returnvalue::FAILED; } void UartComIF::setUartMode(struct termios* options, UartCookie& uartCookie) { diff --git a/src/fsfw_hal/linux/uio/UioMapper.cpp b/src/fsfw_hal/linux/uio/UioMapper.cpp index 43ca2727..3d7e5987 100644 --- a/src/fsfw_hal/linux/uio/UioMapper.cpp +++ b/src/fsfw_hal/linux/uio/UioMapper.cpp @@ -18,17 +18,17 @@ UioMapper::UioMapper(std::string uioFile, int mapNum) : uioFile(uioFile), mapNum UioMapper::~UioMapper() {} ReturnValue_t UioMapper::getMappedAdress(uint32_t** address, Permissions permissions) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; int fd = open(uioFile.c_str(), O_RDWR); if (fd < 1) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "PtmeAxiConfig::initialize: Invalid UIO device file" << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } size_t size = 0; result = getMapSize(&size); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } *address = static_cast( @@ -39,9 +39,9 @@ ReturnValue_t UioMapper::getMappedAdress(uint32_t** address, Permissions permiss sif::error << "UioMapper::getMappedAdress: Failed to map physical address of uio device " << uioFile.c_str() << " and map" << static_cast(mapNum) << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t UioMapper::getMapSize(size_t* size) { @@ -54,7 +54,7 @@ ReturnValue_t UioMapper::getMapSize(size_t* size) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "UioMapper::getMapSize: Failed to open file " << namestream.str() << std::endl; #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } char hexstring[SIZE_HEX_STRING] = ""; int items = fscanf(fp, "%s", hexstring); @@ -66,7 +66,7 @@ ReturnValue_t UioMapper::getMapSize(size_t* size) { << namestream.str() << std::endl; #endif fclose(fp); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } uint32_t sizeTmp = 0; items = sscanf(hexstring, "%x", &sizeTmp); @@ -79,8 +79,8 @@ ReturnValue_t UioMapper::getMapSize(size_t* size) { << "size of map" << mapNum << " to integer" << std::endl; #endif fclose(fp); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } fclose(fp); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp b/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp index cbf8def5..624696c8 100644 --- a/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp +++ b/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp @@ -84,7 +84,7 @@ ReturnValue_t GyroL3GD20H::initialize() { spiHandle->Init.Mode = SPI_MODE_MASTER; if (HAL_SPI_Init(spiHandle) != HAL_OK) { sif::printWarning("Error initializing SPI\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } delete mspCfg; @@ -106,11 +106,11 @@ ReturnValue_t GyroL3GD20H::initialize() { return handlePollingTransferInit(); } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroL3GD20H::performOperation() { @@ -125,10 +125,10 @@ ReturnValue_t GyroL3GD20H::performOperation() { return handleInterruptSensorRead(); } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroL3GD20H::handleDmaTransferInit() { @@ -162,10 +162,10 @@ ReturnValue_t GyroL3GD20H::handleDmaTransferInit() { case (TransferStates::FAILURE): { sif::printWarning("Transfer failure\n"); transferState = TransferStates::FAILURE; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -194,10 +194,10 @@ ReturnValue_t GyroL3GD20H::handleDmaTransferInit() { case (TransferStates::FAILURE): { sif::printWarning("GyroL3GD20H::initialize: Configuration transfer failure\n"); transferState = TransferStates::FAILURE; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -228,13 +228,13 @@ ReturnValue_t GyroL3GD20H::handleDmaTransferInit() { case (TransferStates::FAILURE): { sif::printWarning("GyroL3GD20H::initialize: Configuration transfer failure\n"); transferState = TransferStates::FAILURE; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroL3GD20H::handleDmaSensorRead() { @@ -259,13 +259,13 @@ ReturnValue_t GyroL3GD20H::handleDmaSensorRead() { case (TransferStates::FAILURE): { sif::printWarning("GyroL3GD20H::handleDmaSensorRead: Sensor read failure\n"); transferState = TransferStates::FAILURE; - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } HAL_StatusTypeDef GyroL3GD20H::performDmaTransfer(size_t sendSize) { @@ -298,14 +298,14 @@ ReturnValue_t GyroL3GD20H::handlePollingTransferInit() { } case (HAL_TIMEOUT): { sif::printDebug("GyroL3GD20H::initialize: Polling transfer timeout\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } case (HAL_ERROR): { sif::printDebug("GyroL3GD20H::initialize: Polling transfer failure\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -323,14 +323,14 @@ ReturnValue_t GyroL3GD20H::handlePollingTransferInit() { } case (HAL_TIMEOUT): { sif::printDebug("GyroL3GD20H::initialize: Polling transfer timeout\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } case (HAL_ERROR): { sif::printDebug("GyroL3GD20H::initialize: Polling transfer failure\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -353,17 +353,17 @@ ReturnValue_t GyroL3GD20H::handlePollingTransferInit() { } case (HAL_TIMEOUT): { sif::printDebug("GyroL3GD20H::initialize: Polling transfer timeout\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } case (HAL_ERROR): { sif::printDebug("GyroL3GD20H::initialize: Polling transfer failure\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroL3GD20H::handlePollingSensorRead() { @@ -380,17 +380,17 @@ ReturnValue_t GyroL3GD20H::handlePollingSensorRead() { } case (HAL_TIMEOUT): { sif::printDebug("GyroL3GD20H::initialize: Polling transfer timeout\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } case (HAL_ERROR): { sif::printDebug("GyroL3GD20H::initialize: Polling transfer failure\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroL3GD20H::handleInterruptTransferInit() { @@ -416,7 +416,7 @@ ReturnValue_t GyroL3GD20H::handleInterruptTransferInit() { case (HAL_ERROR): case (HAL_TIMEOUT): { sif::printDebug("GyroL3GD20H::initialize: Initialization failure using interrupts\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -438,7 +438,7 @@ ReturnValue_t GyroL3GD20H::handleInterruptTransferInit() { case (HAL_ERROR): case (HAL_TIMEOUT): { sif::printDebug("GyroL3GD20H::initialize: Initialization failure using interrupts\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -465,10 +465,10 @@ ReturnValue_t GyroL3GD20H::handleInterruptTransferInit() { case (HAL_ERROR): case (HAL_TIMEOUT): { sif::printDebug("GyroL3GD20H::initialize: Initialization failure using interrupts\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t GyroL3GD20H::handleInterruptSensorRead() { @@ -489,10 +489,10 @@ ReturnValue_t GyroL3GD20H::handleInterruptSensorRead() { case (HAL_ERROR): case (HAL_TIMEOUT): { sif::printDebug("GyroL3GD20H::initialize: Sensor read failure using interrupts\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void GyroL3GD20H::prepareConfigRegs(uint8_t *configRegs) { diff --git a/src/fsfw_hal/stm32h7/spi/SpiComIF.cpp b/src/fsfw_hal/stm32h7/spi/SpiComIF.cpp index 49e4670d..724917bd 100644 --- a/src/fsfw_hal/stm32h7/spi/SpiComIF.cpp +++ b/src/fsfw_hal/stm32h7/spi/SpiComIF.cpp @@ -35,7 +35,7 @@ void SpiComIF::addDmaHandles(DMA_HandleTypeDef *txHandle, DMA_HandleTypeDef *rxH spi::setDmaHandles(txHandle, rxHandle); } -ReturnValue_t SpiComIF::initialize() { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t SpiComIF::initialize() { return returnvalue::OK; } ReturnValue_t SpiComIF::initializeInterface(CookieIF *cookie) { SpiCookie *spiCookie = dynamic_cast(cookie); @@ -55,7 +55,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF *cookie) { spi::getDmaHandles(&txHandle, &rxHandle); if (txHandle == nullptr or rxHandle == nullptr) { sif::printError("SpiComIF::initialize: DMA handles not set!\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } // This semaphore ensures thread-safety for a given bus @@ -79,7 +79,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF *cookie) { static_cast(spiAddress)); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_VERBOSE_LEVEL >= 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } auto gpioPin = spiCookie->getChipSelectGpioPin(); @@ -98,7 +98,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF *cookie) { #endif } else { printCfgError("SPI Bus Index"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } auto mspCfg = spiCookie->getMspCfg(); @@ -107,21 +107,21 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF *cookie) { auto typedCfg = dynamic_cast(mspCfg); if (typedCfg == nullptr) { printCfgError("Polling MSP"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } spi::setSpiPollingMspFunctions(typedCfg); } else if (transferMode == spi::TransferModes::INTERRUPT) { auto typedCfg = dynamic_cast(mspCfg); if (typedCfg == nullptr) { printCfgError("IRQ MSP"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } spi::setSpiIrqMspFunctions(typedCfg); } else if (transferMode == spi::TransferModes::DMA) { auto typedCfg = dynamic_cast(mspCfg); if (typedCfg == nullptr) { printCfgError("DMA MSP"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } // Check DMA handles DMA_HandleTypeDef *txHandle = nullptr; @@ -129,7 +129,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF *cookie) { spi::getDmaHandles(&txHandle, &rxHandle); if (txHandle == nullptr or rxHandle == nullptr) { printCfgError("DMA Handle"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } spi::setSpiDmaMspFunctions(typedCfg); } @@ -145,12 +145,12 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF *cookie) { if (HAL_SPI_Init(&spiHandle) != HAL_OK) { sif::printWarning("SpiComIF::initialize: Error initializing SPI\n"); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } // The MSP configuration struct is not required anymore spiCookie->deleteMspCfg(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t SpiComIF::sendMessage(CookieIF *cookie, const uint8_t *sendData, size_t sendLen) { @@ -163,7 +163,7 @@ ReturnValue_t SpiComIF::sendMessage(CookieIF *cookie, const uint8_t *sendData, s auto iter = spiDeviceMap.find(spiCookie->getDeviceAddress()); if (iter == spiDeviceMap.end()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } iter->second.currentTransferLen = sendLen; @@ -176,7 +176,7 @@ ReturnValue_t SpiComIF::sendMessage(CookieIF *cookie, const uint8_t *sendData, s case (spi::TransferStates::FAILURE): case (spi::TransferStates::SUCCESS): default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } @@ -194,13 +194,13 @@ ReturnValue_t SpiComIF::sendMessage(CookieIF *cookie, const uint8_t *sendData, s sendData, sendLen); } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } -ReturnValue_t SpiComIF::getSendSuccess(CookieIF *cookie) { return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t SpiComIF::getSendSuccess(CookieIF *cookie) { return returnvalue::OK; } ReturnValue_t SpiComIF::requestReceiveMessage(CookieIF *cookie, size_t requestLen) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t SpiComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) { @@ -212,7 +212,7 @@ ReturnValue_t SpiComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, case (spi::TransferStates::SUCCESS): { auto iter = spiDeviceMap.find(spiCookie->getDeviceAddress()); if (iter == spiDeviceMap.end()) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } *buffer = iter->second.replyBuffer.data(); *size = iter->second.currentTransferLen; @@ -228,18 +228,18 @@ ReturnValue_t SpiComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, #endif #endif spiCookie->setTransferState(spi::TransferStates::IDLE); - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } case (spi::TransferStates::WAIT): case (spi::TransferStates::IDLE): { break; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void SpiComIF::setDefaultPollingTimeout(dur_millis_t timeout) { @@ -252,7 +252,7 @@ ReturnValue_t SpiComIF::handlePollingSendOperation(uint8_t *recvPtr, SPI_HandleT auto gpioPort = spiCookie.getChipSelectGpioPort(); auto gpioPin = spiCookie.getChipSelectGpioPin(); auto returnval = spiSemaphore->acquire(timeoutType, timeoutMs); - if (returnval != HasReturnvaluesIF::RETURN_OK) { + if (returnval != returnvalue::OK) { return returnval; } spiCookie.setTransferState(spi::TransferStates::WAIT); @@ -299,7 +299,7 @@ ReturnValue_t SpiComIF::handlePollingSendOperation(uint8_t *recvPtr, SPI_HandleT return spi::HAL_ERROR_RETVAL; } } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t SpiComIF::handleInterruptSendOperation(uint8_t *recvPtr, SPI_HandleTypeDef &spiHandle, @@ -318,7 +318,7 @@ ReturnValue_t SpiComIF::handleIrqSendOperation(uint8_t *recvPtr, SPI_HandleTypeD SpiCookie &spiCookie, const uint8_t *sendData, size_t sendLen) { ReturnValue_t result = genericIrqSendSetup(recvPtr, spiHandle, spiCookie, sendData, sendLen); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } // yet another HAL driver which is not const-correct.. @@ -366,7 +366,7 @@ ReturnValue_t SpiComIF::halErrorHandler(HAL_StatusTypeDef status, spi::TransferM return spi::HAL_TIMEOUT_RETVAL; } default: { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } } @@ -379,7 +379,7 @@ ReturnValue_t SpiComIF::genericIrqSendSetup(uint8_t *recvPtr, SPI_HandleTypeDef // Take the semaphore which will be released by a callback when the transfer is complete ReturnValue_t result = spiSemaphore->acquire(SemaphoreIF::TimeoutType::WAITING, timeoutMs); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { // Configuration error sif::printWarning( "SpiComIF::handleInterruptSendOperation: Semaphore " @@ -399,7 +399,7 @@ ReturnValue_t SpiComIF::genericIrqSendSetup(uint8_t *recvPtr, SPI_HandleTypeDef HAL_GPIO_WritePin(spiCookie.getChipSelectGpioPort(), spiCookie.getChipSelectGpioPin(), GPIO_PIN_RESET); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void SpiComIF::spiTransferTxCompleteCallback(SPI_HandleTypeDef *hspi, void *args) { @@ -445,7 +445,7 @@ void SpiComIF::genericIrqHandler(void *irqArgsVoid, spi::TransferStates targetSt #elif defined FSFW_OSAL_RTEMS ReturnValue_t result = comIF->spiSemaphore->release(); #endif - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { // Configuration error printf("SpiComIF::genericIrqHandler: Failure releasing Semaphore!\n"); } diff --git a/src/fsfw_tests/integration/assemblies/TestAssembly.cpp b/src/fsfw_tests/integration/assemblies/TestAssembly.cpp index a0313f96..668120c6 100644 --- a/src/fsfw_tests/integration/assemblies/TestAssembly.cpp +++ b/src/fsfw_tests/integration/assemblies/TestAssembly.cpp @@ -30,7 +30,7 @@ ReturnValue_t TestAssembly::commandChildren(Mode_t mode, Submode_t submode) { #else sif::printInfo("TestAssembly: Received command to go to mode %d submode %d\n", mode, submode); #endif - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; if (mode == MODE_OFF) { commandTable[0].setMode(MODE_OFF); commandTable[0].setSubmode(SUBMODE_NONE); @@ -113,14 +113,14 @@ ReturnValue_t TestAssembly::isModeCombinationValid(Mode_t mode, Submode_t submod switch (mode) { case MODE_OFF: if (submode == SUBMODE_NONE) { - return RETURN_OK; + return returnvalue::OK; } else { return INVALID_SUBMODE; } case DeviceHandlerIF::MODE_NORMAL: case MODE_ON: if (submode < 3) { - return RETURN_OK; + return returnvalue::OK; } else { return INVALID_SUBMODE; } @@ -130,24 +130,24 @@ ReturnValue_t TestAssembly::isModeCombinationValid(Mode_t mode, Submode_t submod ReturnValue_t TestAssembly::initialize() { ReturnValue_t result = AssemblyBase::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } handler0 = ObjectManager::instance()->get(deviceHandler0Id); handler1 = ObjectManager::instance()->get(deviceHandler1Id); if ((handler0 == nullptr) or (handler1 == nullptr)) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } handler0->setParentQueue(this->getCommandQueue()); handler1->setParentQueue(this->getCommandQueue()); result = registerChild(deviceHandler0Id); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } result = registerChild(deviceHandler1Id); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } return result; @@ -160,11 +160,11 @@ ReturnValue_t TestAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wa return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE; } } - return RETURN_OK; + return returnvalue::OK; } else if (submode == submodes::SINGLE) { for (const auto& info : childrenMap) { if (info.second.mode == wantedMode and info.second.mode != wantedSubmode) { - return RETURN_OK; + return returnvalue::OK; } } } diff --git a/src/fsfw_tests/integration/controller/TestController.cpp b/src/fsfw_tests/integration/controller/TestController.cpp index 03f24311..2ee4d5fe 100644 --- a/src/fsfw_tests/integration/controller/TestController.cpp +++ b/src/fsfw_tests/integration/controller/TestController.cpp @@ -10,7 +10,7 @@ TestController::TestController(object_id_t objectId, object_id_t parentId, size_ TestController::~TestController() {} ReturnValue_t TestController::handleCommandMessage(CommandMessage *message) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TestController::performControlOperation() {} @@ -24,7 +24,7 @@ LocalPoolDataSetBase *TestController::getDataSetHandle(sid_t sid) { return nullp ReturnValue_t TestController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestController::initializeAfterTaskCreation() { @@ -33,5 +33,5 @@ ReturnValue_t TestController::initializeAfterTaskCreation() { ReturnValue_t TestController::checkModeCommand(Mode_t mode, Submode_t submode, uint32_t *msToReachTheMode) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp b/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp index 36f1ea8c..e2df55c3 100644 --- a/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp +++ b/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp @@ -139,7 +139,7 @@ ReturnValue_t TestDevice::buildCommandFromCommand(DeviceCommandId_t deviceComman const uint8_t* commandData, size_t commandDataLen) { using namespace testdevice; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; switch (deviceCommand) { case (TEST_NORMAL_MODE_CMD): { commandSent = true; @@ -222,7 +222,7 @@ ReturnValue_t TestDevice::buildNormalModeCommand(DeviceCommandId_t deviceCommand } /* The command is passed on in the command buffer as it is */ passOnCommand(deviceCommand, commandData, commandDataLen); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDevice::buildTestCommand0(DeviceCommandId_t deviceCommand, @@ -248,7 +248,7 @@ ReturnValue_t TestDevice::buildTestCommand0(DeviceCommandId_t deviceCommand, /* The command is passed on in the command buffer as it is */ passOnCommand(deviceCommand, commandData, commandDataLen); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDevice::buildTestCommand1(DeviceCommandId_t deviceCommand, @@ -277,7 +277,7 @@ ReturnValue_t TestDevice::buildTestCommand1(DeviceCommandId_t deviceCommand, size_t size = commandDataLen; ReturnValue_t result = SerializeAdapter::deSerialize(¶meter1, &commandData, &size, SerializeIF::Endianness::BIG); - if (result == HasReturnvaluesIF::RETURN_FAILED) { + if (result == returnvalue::FAILED) { return result; } @@ -299,7 +299,7 @@ ReturnValue_t TestDevice::buildTestCommand1(DeviceCommandId_t deviceCommand, memcpy(commandBuffer + 6, ¶meter2, sizeof(parameter2)); rawPacket = commandBuffer; rawPacketLen = sizeof(deviceCommand) + sizeof(parameter1) + sizeof(parameter2); - return RETURN_OK; + return returnvalue::OK; } void TestDevice::passOnCommand(DeviceCommandId_t command, const uint8_t* commandData, @@ -342,7 +342,7 @@ ReturnValue_t TestDevice::scanForReply(const uint8_t* start, size_t len, DeviceC size_t size = len; ReturnValue_t result = SerializeAdapter::deSerialize(foundId, &start, &size, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } @@ -366,7 +366,7 @@ ReturnValue_t TestDevice::scanForReply(const uint8_t* start, size_t len, DeviceC *foundLen = len; *foundId = pendingCmd; - return RETURN_OK; + return returnvalue::OK; } case (TEST_COMMAND_0): { @@ -389,7 +389,7 @@ ReturnValue_t TestDevice::scanForReply(const uint8_t* start, size_t len, DeviceC *foundLen = TEST_COMMAND_0_SIZE; *foundId = pendingCmd; - return RETURN_OK; + return returnvalue::OK; } case (TEST_COMMAND_1): { @@ -409,7 +409,7 @@ ReturnValue_t TestDevice::scanForReply(const uint8_t* start, size_t len, DeviceC *foundLen = len; *foundId = pendingCmd; - return RETURN_OK; + return returnvalue::OK; } default: @@ -418,7 +418,7 @@ ReturnValue_t TestDevice::scanForReply(const uint8_t* start, size_t len, DeviceC } ReturnValue_t TestDevice::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; switch (id) { /* Periodic replies */ case testdevice::TEST_NORMAL_MODE_CMD: { @@ -460,7 +460,7 @@ ReturnValue_t TestDevice::interpretingNormalModeReply() { dataset.testFloat3Vec.value[2] = 0.0; dataset.setValidity(false, true); } - return RETURN_OK; + return returnvalue::OK; } PoolReadGuard readHelper(&dataset); @@ -570,7 +570,7 @@ ReturnValue_t TestDevice::interpretingNormalModeReply() { } } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDevice::interpretingTestReply0(DeviceCommandId_t id, const uint8_t* packet) { @@ -589,7 +589,7 @@ ReturnValue_t TestDevice::interpretingTestReply0(DeviceCommandId_t id, const uin actionHelper.step(1, commander, id); actionHelper.finish(true, commander, id); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDevice::interpretingTestReply1(DeviceCommandId_t id, const uint8_t* packet) { @@ -608,7 +608,7 @@ ReturnValue_t TestDevice::interpretingTestReply1(DeviceCommandId_t id, const uin ReturnValue_t result = actionHelper.reportData(commander, id, packet, testdevice::TEST_COMMAND_1_SIZE, false); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TestDevice" << deviceIdx << "::interpretingReply1: Sending data " @@ -620,7 +620,7 @@ ReturnValue_t TestDevice::interpretingTestReply1(DeviceCommandId_t id, const uin return result; } - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { /* Finish reply */ actionHelper.finish(true, commander, id); } else { @@ -628,7 +628,7 @@ ReturnValue_t TestDevice::interpretingTestReply1(DeviceCommandId_t id, const uin actionHelper.finish(false, commander, id, result); } - return RETURN_OK; + return returnvalue::OK; } uint32_t TestDevice::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; } @@ -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.subscribeForPeriodicPacket(sid, false, 1.0, false); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, @@ -658,7 +658,7 @@ ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, if (fullInfoPrintout) { uint32_t newValue = 0; ReturnValue_t result = newValues->getElement(&newValue, 0, 0); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "TestDevice" << deviceIdx << "::getParameter: Setting parameter 0 to " @@ -677,7 +677,7 @@ ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, if (fullInfoPrintout) { int32_t newValue = 0; ReturnValue_t result = newValues->getElement(&newValue, 0, 0); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "TestDevice" << deviceIdx << "::getParameter: Setting parameter 1 to " @@ -695,10 +695,10 @@ ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, case ParameterUniqueIds::TEST_FLOAT_VEC3_2: { if (fullInfoPrintout) { float newVector[3]; - if (newValues->getElement(newVector, 0, 0) != RETURN_OK or - newValues->getElement(newVector + 1, 0, 1) != RETURN_OK or - newValues->getElement(newVector + 2, 0, 2) != RETURN_OK) { - return HasReturnvaluesIF::RETURN_FAILED; + if (newValues->getElement(newVector, 0, 0) != returnvalue::OK or + newValues->getElement(newVector + 1, 0, 1) != returnvalue::OK or + newValues->getElement(newVector + 2, 0, 2) != returnvalue::OK) { + return returnvalue::FAILED; } #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "TestDevice" << deviceIdx @@ -720,7 +720,7 @@ ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, if (fullInfoPrintout) { uint8_t enabled = 0; ReturnValue_t result = newValues->getElement(&enabled, 0, 0); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } char const* printout = nullptr; @@ -743,7 +743,7 @@ ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, case (ParameterUniqueIds::CHANGING_DATASETS): { uint8_t enabled = 0; ReturnValue_t result = newValues->getElement(&enabled, 0, 0); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } if (not enabled) { @@ -776,7 +776,7 @@ ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, default: return INVALID_IDENTIFIER_ID; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } LocalPoolObjectBase* TestDevice::getPoolObjectHandle(lp_id_t localPoolId) { diff --git a/src/fsfw_tests/integration/devices/TestEchoComIF.cpp b/src/fsfw_tests/integration/devices/TestEchoComIF.cpp index 727381a2..c0aa64a4 100644 --- a/src/fsfw_tests/integration/devices/TestEchoComIF.cpp +++ b/src/fsfw_tests/integration/devices/TestEchoComIF.cpp @@ -25,9 +25,9 @@ ReturnValue_t TestEchoComIF::initializeInterface(CookieIF *cookie) { auto resultPair = replyMap.emplace(dummyCookie->getAddress(), ReplyBuffer(dummyCookie->getReplyMaxLen())); if (not resultPair.second) { - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestEchoComIF::sendMessage(CookieIF *cookie, const uint8_t *sendData, @@ -50,17 +50,17 @@ ReturnValue_t TestEchoComIF::sendMessage(CookieIF *cookie, const uint8_t *sendDa "reply buffer length!\n", sendLen); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } replyBuffer.resize(sendLen); memcpy(replyBuffer.data(), sendData, sendLen); - return RETURN_OK; + return returnvalue::OK; } -ReturnValue_t TestEchoComIF::getSendSuccess(CookieIF *cookie) { return RETURN_OK; } +ReturnValue_t TestEchoComIF::getSendSuccess(CookieIF *cookie) { return returnvalue::OK; } ReturnValue_t TestEchoComIF::requestReceiveMessage(CookieIF *cookie, size_t requestLen) { - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestEchoComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) { @@ -78,5 +78,5 @@ ReturnValue_t TestEchoComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buf // add anything that needs to be read periodically by dummy handler dummyReplyCounter = 0; } - return RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw_tests/integration/task/TestTask.cpp b/src/fsfw_tests/integration/task/TestTask.cpp index a6a4a30b..a09644d2 100644 --- a/src/fsfw_tests/integration/task/TestTask.cpp +++ b/src/fsfw_tests/integration/task/TestTask.cpp @@ -15,7 +15,7 @@ TestTask::TestTask(object_id_t objectId) : SystemObject(objectId), testMode(test TestTask::~TestTask() = default; ReturnValue_t TestTask::performOperation(uint8_t operationCode) { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; testLock->lockMutex(MutexIF::TimeoutType::WAITING, 20); if (oneShotAction) { // Add code here which should only be run once @@ -40,23 +40,23 @@ ReturnValue_t TestTask::performOperation(uint8_t operationCode) { ReturnValue_t TestTask::performOneShotAction() { /* Everything here will only be performed once. */ - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestTask::performPeriodicAction() { /* This is performed each task cycle */ - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; return result; } ReturnValue_t TestTask::performActionA() { /* This is performed each alternating task cycle */ - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; return result; } ReturnValue_t TestTask::performActionB() { /* This is performed each alternating task cycle */ - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; return result; } diff --git a/src/fsfw_tests/internal/InternalUnitTester.cpp b/src/fsfw_tests/internal/InternalUnitTester.cpp index 4e45d25b..a135359c 100644 --- a/src/fsfw_tests/internal/InternalUnitTester.cpp +++ b/src/fsfw_tests/internal/InternalUnitTester.cpp @@ -37,5 +37,5 @@ ReturnValue_t InternalUnitTester::performTests( #else sif::printInfo("Internal unit tests finished.\n"); #endif - return RETURN_OK; + return returnvalue::OK; } diff --git a/src/fsfw_tests/internal/InternalUnitTester.h b/src/fsfw_tests/internal/InternalUnitTester.h index d6d7ca36..07744825 100644 --- a/src/fsfw_tests/internal/InternalUnitTester.h +++ b/src/fsfw_tests/internal/InternalUnitTester.h @@ -13,7 +13,7 @@ * which simply calls all other tests from other files manually. * Maybe there is a better way.. */ -class InternalUnitTester : public HasReturnvaluesIF { +class InternalUnitTester { public: struct TestConfig { bool testArrayPrinter = false; diff --git a/src/fsfw_tests/internal/UnittDefinitions.cpp b/src/fsfw_tests/internal/UnittDefinitions.cpp index 3322b1ad..ea562591 100644 --- a/src/fsfw_tests/internal/UnittDefinitions.cpp +++ b/src/fsfw_tests/internal/UnittDefinitions.cpp @@ -6,5 +6,5 @@ ReturnValue_t unitt::put_error(std::string errorId) { #else sif::printError("Unit Tester error: Failed at test ID %s\n", errorId.c_str()); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } diff --git a/src/fsfw_tests/internal/osal/testMq.cpp b/src/fsfw_tests/internal/osal/testMq.cpp index 3d8e1034..88082b0a 100644 --- a/src/fsfw_tests/internal/osal/testMq.cpp +++ b/src/fsfw_tests/internal/osal/testMq.cpp @@ -20,22 +20,22 @@ void testmq::testMq() { testSenderMq->setDefaultDestination(testReceiverMqId); auto result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - if (result != result::OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } MessageQueueMessage recvMessage; result = testReceiverMq->receiveMessage(&recvMessage); - if (result != result::OK or recvMessage.getData()[0] != 42) { + if (result != returnvalue::OK or recvMessage.getData()[0] != 42) { unitt::put_error(id); } result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - if (result != result::OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } MessageQueueId_t senderId = 0; result = testReceiverMq->receiveMessage(&recvMessage, &senderId); - if (result != result::OK or recvMessage.getData()[0] != 42) { + if (result != returnvalue::OK or recvMessage.getData()[0] != 42) { unitt::put_error(id); } if (senderId != testSenderMqId) { diff --git a/src/fsfw_tests/internal/osal/testMutex.cpp b/src/fsfw_tests/internal/osal/testMutex.cpp index 6206c31d..98c471cb 100644 --- a/src/fsfw_tests/internal/osal/testMutex.cpp +++ b/src/fsfw_tests/internal/osal/testMutex.cpp @@ -16,7 +16,7 @@ void testmutex::testMutex() { std::string id = "[testMutex]"; MutexIF* mutex = MutexFactory::instance()->createMutex(); auto result = mutex->lockMutex(MutexIF::TimeoutType::POLLING); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } // timed_mutex from the C++ library specifies undefined behaviour if @@ -35,7 +35,7 @@ void testmutex::testMutex() { } result = mutex->unlockMutex(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } diff --git a/src/fsfw_tests/internal/osal/testSemaphore.cpp b/src/fsfw_tests/internal/osal/testSemaphore.cpp index a3e4c277..df88b4ed 100644 --- a/src/fsfw_tests/internal/osal/testSemaphore.cpp +++ b/src/fsfw_tests/internal/osal/testSemaphore.cpp @@ -54,7 +54,7 @@ void testsemaph::testCountingSemaph() { // release 3 times in a row for (int i = 0; i < 3; i++) { auto result = countingSemaph->release(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } } @@ -75,7 +75,7 @@ void testsemaph::testBinSemaphoreImplementation(SemaphoreIF* binSemaph, std::str unitt::put_error(id); } result = binSemaph->acquire(SemaphoreIF::BLOCKING); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } @@ -104,7 +104,7 @@ void testsemaph::testBinSemaphoreImplementation(SemaphoreIF* binSemaph, std::str } result = binSemaph->release(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } } @@ -122,7 +122,7 @@ void testsemaph::testCountingSemaphImplementation(SemaphoreIF* countingSemaph, s // acquire 3 times in a row for (int i = 0; i < 3; i++) { result = countingSemaph->acquire(SemaphoreIF::BLOCKING); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } } @@ -144,7 +144,7 @@ void testsemaph::testCountingSemaphImplementation(SemaphoreIF* countingSemaph, s // release 3 times in a row for (int i = 0; i < 3; i++) { result = countingSemaph->release(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { unitt::put_error(id); } } diff --git a/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp b/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp index 5865f8fc..58ab05c1 100644 --- a/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp +++ b/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp @@ -13,18 +13,18 @@ std::array testserialize::test_array = {0}; ReturnValue_t testserialize::test_serialization() { // Here, we test all serialization tools. First test basic cases. ReturnValue_t result = test_endianness_tools(); - if (result != result::OK) { + if (result != returnvalue::OK) { return result; } result = test_autoserialization(); - if (result != result::OK) { + if (result != returnvalue::OK) { return result; } result = test_serial_buffer_adapter(); - if (result != result::OK) { + if (result != returnvalue::OK) { return result; } - return result::OK; + return returnvalue::OK; } ReturnValue_t testserialize::test_endianness_tools() { @@ -48,7 +48,7 @@ ReturnValue_t testserialize::test_endianness_tools() { if (test_array[0] != 0 and test_array[1] != 1) { return unitt::put_error(id); } - return result::OK; + return returnvalue::OK; } ReturnValue_t testserialize::test_autoserialization() { @@ -152,7 +152,7 @@ ReturnValue_t testserialize::test_autoserialization() { } // Check overflow - return result::OK; + return returnvalue::OK; } // TODO: Also test for constant buffers. @@ -205,5 +205,5 @@ ReturnValue_t testserialize::test_serial_buffer_adapter() { if (testUint16 != 16) { return unitt::put_error(id); } - return result::OK; + return returnvalue::OK; } diff --git a/unittests/action/TestActionHelper.cpp b/unittests/action/TestActionHelper.cpp index 0d160c6f..fdb8aad6 100644 --- a/unittests/action/TestActionHelper.cpp +++ b/unittests/action/TestActionHelper.cpp @@ -19,12 +19,12 @@ TEST_CASE("Action Helper", "[ActionHelper]") { StorageManagerIF* ipcStore = tglob::getIpcStoreHandle(); REQUIRE(ipcStore != nullptr); ipcStore->addData(¶mAddress, testParams.data(), 3); - REQUIRE(actionHelper.initialize() == result::OK); + REQUIRE(actionHelper.initialize() == returnvalue::OK); SECTION("Simple tests") { ActionMessage::setCommand(&actionMessage, testActionId, paramAddress); CHECK(not testDhMock.executeActionCalled); - REQUIRE(actionHelper.handleActionMessage(&actionMessage) == result::OK); + REQUIRE(actionHelper.handleActionMessage(&actionMessage) == returnvalue::OK); CHECK(testDhMock.executeActionCalled); // No message is sent if everything is alright. CHECK(not testMqMock.wasMessageSent()); @@ -58,7 +58,7 @@ TEST_CASE("Action Helper", "[ActionHelper]") { CHECK(testMqMock.wasMessageSent()); CommandMessage testMessage; REQUIRE(testMqMock.receiveMessage(&testMessage) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(testMessage.getCommand() == static_cast(ActionMessage::STEP_FAILED)); REQUIRE(testMessage.getParameter() == static_cast(testActionId)); uint32_t parameter2 = ((uint32_t)step << 16) | (uint32_t)status; @@ -73,7 +73,7 @@ TEST_CASE("Action Helper", "[ActionHelper]") { CHECK(testMqMock.wasMessageSent()); CommandMessage testMessage; REQUIRE(testMqMock.receiveMessage(&testMessage) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(testMessage.getCommand() == static_cast(ActionMessage::COMPLETION_FAILED)); REQUIRE(ActionMessage::getActionId(&testMessage) == testActionId); REQUIRE(ActionMessage::getReturnCode(&testMessage) == static_cast(status)); @@ -82,15 +82,15 @@ TEST_CASE("Action Helper", "[ActionHelper]") { SECTION("Handle failed") { store_address_t toLongParamAddress = StorageManagerIF::INVALID_ADDRESS; std::array toLongData = {5, 4, 3, 2, 1}; - REQUIRE(ipcStore->addData(&toLongParamAddress, toLongData.data(), 5) == result::OK); + REQUIRE(ipcStore->addData(&toLongParamAddress, toLongData.data(), 5) == returnvalue::OK); ActionMessage::setCommand(&actionMessage, testActionId, toLongParamAddress); CHECK(not testDhMock.executeActionCalled); - REQUIRE(actionHelper.handleActionMessage(&actionMessage) == result::OK); + REQUIRE(actionHelper.handleActionMessage(&actionMessage) == returnvalue::OK); REQUIRE(ipcStore->getData(toLongParamAddress).first == static_cast(StorageManagerIF::DATA_DOES_NOT_EXIST)); CommandMessage testMessage; REQUIRE(testMqMock.receiveMessage(&testMessage) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(testMessage.getCommand() == static_cast(ActionMessage::STEP_FAILED)); REQUIRE(ActionMessage::getReturnCode(&testMessage) == 0xAFFE); REQUIRE(ActionMessage::getStep(&testMessage) == 0); @@ -100,10 +100,10 @@ TEST_CASE("Action Helper", "[ActionHelper]") { SECTION("Missing IPC Data") { ActionMessage::setCommand(&actionMessage, testActionId, StorageManagerIF::INVALID_ADDRESS); CHECK(not testDhMock.executeActionCalled); - REQUIRE(actionHelper.handleActionMessage(&actionMessage) == result::OK); + REQUIRE(actionHelper.handleActionMessage(&actionMessage) == returnvalue::OK); CommandMessage testMessage; REQUIRE(testMqMock.receiveMessage(&testMessage) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(testMessage.getCommand() == static_cast(ActionMessage::STEP_FAILED)); REQUIRE(ActionMessage::getReturnCode(&testMessage) == static_cast(StorageManagerIF::ILLEGAL_STORAGE_ID)); diff --git a/unittests/action/TestActionHelper.h b/unittests/action/TestActionHelper.h index 75a9f3fe..bd88df80 100644 --- a/unittests/action/TestActionHelper.h +++ b/unittests/action/TestActionHelper.h @@ -26,7 +26,7 @@ class ActionHelperOwnerMockBase : public HasActionsIF { } this->size = size; memcpy(buffer, data, size); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void clearBuffer() { diff --git a/unittests/cfdp/testAckPdu.cpp b/unittests/cfdp/testAckPdu.cpp index e5668799..93d484db 100644 --- a/unittests/cfdp/testAckPdu.cpp +++ b/unittests/cfdp/testAckPdu.cpp @@ -7,7 +7,7 @@ TEST_CASE("ACK PDU", "[AckPdu]") { using namespace cfdp; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array buf = {}; uint8_t* bufptr = buf.data(); size_t maxsz = buf.size(); @@ -20,7 +20,7 @@ TEST_CASE("ACK PDU", "[AckPdu]") { AckTransactionStatus::ACTIVE); auto ackSerializer = AckPduSerializer(ackInfo, pduConf); result = ackSerializer.serialize(&bufptr, &sz, maxsz, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); SECTION("Serialize") { REQUIRE(buf.data()[sz - 3] == cfdp::FileDirectives::ACK); @@ -34,7 +34,7 @@ TEST_CASE("ACK PDU", "[AckPdu]") { bufptr = buf.data(); sz = 0; result = ackSerializer2.serialize(&bufptr, &sz, maxsz, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(buf.data()[sz - 3] == cfdp::FileDirectives::ACK); REQUIRE((buf.data()[sz - 2] >> 4) == FileDirectives::FINISH); REQUIRE((buf.data()[sz - 2] & 0x0f) == 0b0001); @@ -47,7 +47,7 @@ TEST_CASE("ACK PDU", "[AckPdu]") { auto ackSerializer3 = AckPduSerializer(ackInfo, pduConf); result = ackSerializer3.serialize(&bufptr, &sz, maxsz, SerializeIF::Endianness::NETWORK); // Invalid file directive - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); ackInfo.setAckedDirective(FileDirectives::FINISH); // buffer too small @@ -59,7 +59,7 @@ TEST_CASE("ACK PDU", "[AckPdu]") { AckInfo ackInfo; auto reader = AckPduDeserializer(buf.data(), sz, ackInfo); result = reader.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(ackInfo.getAckedDirective() == FileDirectives::EOF_DIRECTIVE); REQUIRE(ackInfo.getAckedConditionCode() == ConditionCode::NO_ERROR); REQUIRE(ackInfo.getDirectiveSubtypeCode() == 0); @@ -71,11 +71,11 @@ TEST_CASE("ACK PDU", "[AckPdu]") { bufptr = buf.data(); sz = 0; result = ackSerializer2.serialize(&bufptr, &sz, maxsz, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); auto reader2 = AckPduDeserializer(buf.data(), sz, ackInfo); result = reader2.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(ackInfo.getAckedDirective() == FileDirectives::FINISH); REQUIRE(ackInfo.getAckedConditionCode() == ConditionCode::FILESTORE_REJECTION); REQUIRE(ackInfo.getDirectiveSubtypeCode() == 0b0001); diff --git a/unittests/cfdp/testCfdp.cpp b/unittests/cfdp/testCfdp.cpp index e7acab01..b18ef9a3 100644 --- a/unittests/cfdp/testCfdp.cpp +++ b/unittests/cfdp/testCfdp.cpp @@ -14,7 +14,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { using namespace cfdp; std::array serBuf; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; cfdp::TransactionSeqNum seqNum = TransactionSeqNum(cfdp::WidthInBytes::ONE_BYTE, 2); cfdp::EntityId sourceId = EntityId(cfdp::WidthInBytes::ONE_BYTE, 0); cfdp::EntityId destId = EntityId(cfdp::WidthInBytes::ONE_BYTE, 1); @@ -29,10 +29,10 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { const uint8_t** dummyPtr = nullptr; ReturnValue_t deserResult = headerSerializer.deSerialize(dummyPtr, &serSize, SerializeIF::Endianness::NETWORK); - REQUIRE(deserResult == result::FAILED); + REQUIRE(deserResult == returnvalue::FAILED); deserResult = headerSerializer.serialize(nullptr, &serSize, serBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(deserResult == result::FAILED); + REQUIRE(deserResult == returnvalue::FAILED); REQUIRE(seqNum.getSerializedSize() == 1); REQUIRE(headerSerializer.getPduDataFieldLen() == 0); @@ -62,7 +62,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { result = headerSerializer.serialize(&serTarget, &serSize, serBuf.size(), SerializeIF::Endianness::BIG); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serSize == 7); // Only version bits are set REQUIRE(serBuf[0] == 0b00100000); @@ -155,11 +155,11 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { REQUIRE(entityId == 0x00ff00ff); result = pduConf.sourceId.setValue(cfdp::WidthInBytes::ONE_BYTE, 0xfff); - REQUIRE(result == result::FAILED); + REQUIRE(result == returnvalue::FAILED); result = pduConf.sourceId.setValue(cfdp::WidthInBytes::TWO_BYTES, 0xfffff); - REQUIRE(result == result::FAILED); + REQUIRE(result == returnvalue::FAILED); result = pduConf.sourceId.setValue(cfdp::WidthInBytes::FOUR_BYTES, 0xfffffffff); - REQUIRE(result == result::FAILED); + REQUIRE(result == returnvalue::FAILED); uint8_t oneByteSourceId = 32; serTarget = &oneByteSourceId; size_t deserLen = 1; @@ -197,7 +197,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { auto headerSerializer = HeaderSerializer(pduConf, cfdp::PduType::FILE_DIRECTIVE, 0); ReturnValue_t result = headerSerializer.serialize(&serTarget, &serSize, serBuf.size(), SerializeIF::Endianness::BIG); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serBuf[1] == 0); REQUIRE(serBuf[2] == 0); // Entity and Transaction Sequence number are 1 byte large @@ -207,7 +207,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { auto headerDeser = HeaderDeserializer(serBuf.data(), serBuf.size()); ReturnValue_t serResult = headerDeser.parseData(); - REQUIRE(serResult == result::OK); + REQUIRE(serResult == returnvalue::OK); REQUIRE(headerDeser.getPduDataFieldLen() == 0); REQUIRE(headerDeser.getHeaderSize() == 7); REQUIRE(headerDeser.getWholePduSize() == 7); @@ -230,11 +230,11 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { headerSerializer.setPduType(cfdp::PduType::FILE_DATA); headerSerializer.setSegmentMetadataFlag(cfdp::SegmentMetadataFlag::PRESENT); result = pduConf.seqNum.setValue(cfdp::WidthInBytes::TWO_BYTES, 0x0fff); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = pduConf.sourceId.setValue(cfdp::WidthInBytes::FOUR_BYTES, 0xff00ff00); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = pduConf.destId.setValue(cfdp::WidthInBytes::FOUR_BYTES, 0x00ff00ff); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); serTarget = serBuf.data(); serSize = 0; result = headerSerializer.serialize(&serTarget, &serSize, serBuf.size(), @@ -242,7 +242,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { headerDeser = HeaderDeserializer(serBuf.data(), serBuf.size()); result = headerDeser.parseData(); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); // Everything except version bit flipped to one now REQUIRE(serBuf[0] == 0x3f); REQUIRE(serBuf[3] == 0b11001010); @@ -274,7 +274,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { serTarget = serBuf.data(); const uint8_t** serTargetConst = const_cast(&serTarget); result = headerDeser.parseData(); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); headerDeser.setData(nullptr, -1); REQUIRE(headerDeser.getHeaderSize() == 0); @@ -286,7 +286,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { pduConf.destId.setValue(cfdp::WidthInBytes::ONE_BYTE, 48); result = headerSerializer.serialize(&serTarget, &serSize, serBuf.size(), SerializeIF::Endianness::BIG); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); REQUIRE(headerDeser.getWholePduSize() == 8); headerDeser.setData(serBuf.data(), serBuf.size()); @@ -301,7 +301,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { serTarget = serBuf.data(); serSize = 0; result = fdSer.serialize(&serTarget, &serSize, serBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); // Only version bits are set REQUIRE(serBuf[0] == 0b00100000); // PDU data field length is 5 (4 + Directive code octet) @@ -321,9 +321,9 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { size_t deserSize = 20; serSize = 0; REQUIRE(fdSer.deSerialize(&deserTarget, &deserSize, SerializeIF::Endianness::NETWORK) == - HasReturnvaluesIF::RETURN_FAILED); + returnvalue::FAILED); REQUIRE(fdSer.serialize(nullptr, nullptr, 85, SerializeIF::Endianness::NETWORK) == - HasReturnvaluesIF::RETURN_FAILED); + returnvalue::FAILED); for (uint8_t idx = 0; idx < 8; idx++) { serTarget = serBuf.data(); serSize = 0; @@ -338,7 +338,7 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { fdDeser.setEndianness(SerializeIF::Endianness::MACHINE); REQUIRE(fdDeser.getEndianness() == SerializeIF::Endianness::MACHINE); fdDeser.setEndianness(SerializeIF::Endianness::NETWORK); - REQUIRE(fdDeser.parseData() == HasReturnvaluesIF::RETURN_OK); + REQUIRE(fdDeser.parseData() == returnvalue::OK); REQUIRE(fdDeser.getFileDirective() == FileDirectives::ACK); REQUIRE(fdDeser.getPduDataFieldLen() == 5); REQUIRE(fdDeser.getHeaderSize() == 8); @@ -358,11 +358,11 @@ TEST_CASE("CFDP Base", "[CfdpBase]") { fss.setFileSize(0x20, false); ReturnValue_t result = fss.serialize(&buffer, &size, fssBuf.size(), SerializeIF::Endianness::MACHINE); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); uint32_t fileSize = 0; result = SerializeAdapter::deSerialize(&fileSize, fssBuf.data(), nullptr, SerializeIF::Endianness::MACHINE); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(fileSize == 0x20); } } diff --git a/unittests/cfdp/testEofPdu.cpp b/unittests/cfdp/testEofPdu.cpp index d400af5a..b5cd801c 100644 --- a/unittests/cfdp/testEofPdu.cpp +++ b/unittests/cfdp/testEofPdu.cpp @@ -8,7 +8,7 @@ TEST_CASE("EOF PDU", "[EofPdu]") { using namespace cfdp; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array buf = {}; uint8_t* bufPtr = buf.data(); size_t sz = 0; @@ -25,17 +25,17 @@ TEST_CASE("EOF PDU", "[EofPdu]") { auto eofSerializer = EofPduSerializer(pduConf, eofInfo); SECTION("Serialize") { result = eofSerializer.serialize(&bufPtr, &sz, buf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(((buf[1] << 8) | buf[2]) == 10); uint32_t checksum = 0; result = SerializeAdapter::deSerialize(&checksum, buf.data() + sz - 8, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(checksum == 5); uint32_t fileSizeVal = 0; result = SerializeAdapter::deSerialize(&fileSizeVal, buf.data() + sz - 4, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(fileSizeVal == 12); REQUIRE(buf[sz - 10] == cfdp::FileDirectives::EOF_DIRECTIVE); REQUIRE(buf[sz - 9] == 0x00); @@ -50,7 +50,7 @@ TEST_CASE("EOF PDU", "[EofPdu]") { sz = 0; result = serializeWithFaultLocation.serialize(&bufPtr, &sz, buf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(sz == 28); REQUIRE(buf[10] == cfdp::FileDirectives::EOF_DIRECTIVE); REQUIRE(buf[11] >> 4 == cfdp::ConditionCode::FILESTORE_REJECTION); @@ -80,12 +80,12 @@ TEST_CASE("EOF PDU", "[EofPdu]") { SECTION("Deserialize") { result = eofSerializer.serialize(&bufPtr, &sz, buf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); EntityIdTlv tlv(destId); EofInfo emptyInfo(&tlv); auto deserializer = EofPduDeserializer(buf.data(), buf.size(), emptyInfo); result = deserializer.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(emptyInfo.getConditionCode() == cfdp::ConditionCode::NO_ERROR); REQUIRE(emptyInfo.getChecksum() == 5); REQUIRE(emptyInfo.getFileSize().getSize() == 12); @@ -101,7 +101,7 @@ TEST_CASE("EOF PDU", "[EofPdu]") { SerializeIF::Endianness::NETWORK); auto deserializer2 = EofPduDeserializer(buf.data(), buf.size(), emptyInfo); result = deserializer2.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(emptyInfo.getConditionCode() == cfdp::ConditionCode::FILESTORE_REJECTION); REQUIRE(emptyInfo.getChecksum() == 5); REQUIRE(emptyInfo.getFileSize().getSize() == 0x10ffffff10); @@ -112,7 +112,7 @@ TEST_CASE("EOF PDU", "[EofPdu]") { for (size_t maxSz = 0; maxSz < deserializer2.getWholePduSize() - 1; maxSz++) { auto invalidDeser = EofPduDeserializer(buf.data(), maxSz, emptyInfo); result = invalidDeser.parseData(); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } } diff --git a/unittests/cfdp/testFileData.cpp b/unittests/cfdp/testFileData.cpp index 1f6a09e9..dd8654d6 100644 --- a/unittests/cfdp/testFileData.cpp +++ b/unittests/cfdp/testFileData.cpp @@ -9,7 +9,7 @@ TEST_CASE("File Data PDU", "[FileDataPdu]") { using namespace cfdp; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array fileBuffer = {}; std::array fileDataBuffer = {}; uint8_t* buffer = fileDataBuffer.data(); @@ -29,7 +29,7 @@ TEST_CASE("File Data PDU", "[FileDataPdu]") { FileDataSerializer serializer(pduConf, info); result = serializer.serialize(&buffer, &sz, fileDataBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(sz == 24); // 10 file bytes plus 4 byte offset REQUIRE(((fileDataBuffer[1] << 8) | fileDataBuffer[2]) == 14); @@ -39,7 +39,7 @@ TEST_CASE("File Data PDU", "[FileDataPdu]") { buffer = fileDataBuffer.data(); result = SerializeAdapter::deSerialize(&offsetRaw, buffer + 10, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(offsetRaw == 50); buffer = fileDataBuffer.data() + 14; for (size_t idx = 0; idx < 10; idx++) { @@ -62,7 +62,7 @@ TEST_CASE("File Data PDU", "[FileDataPdu]") { result = serializer.serialize(&buffer, &sz, fileDataBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(((fileDataBuffer[1] << 8) | fileDataBuffer[2]) == 25); // First bit: Seg Ctrl is set // Bits 1 to 3 length of enitity IDs is 2 @@ -88,7 +88,7 @@ TEST_CASE("File Data PDU", "[FileDataPdu]") { buffer = fileDataBuffer.data(); sz = 0; result = serializer.serialize(&buffer, &invalidStartSz, sz, SerializeIF::Endianness::NETWORK); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } info.setSegmentMetadataFlag(true); @@ -105,13 +105,13 @@ TEST_CASE("File Data PDU", "[FileDataPdu]") { FileDataSerializer serializer(pduConf, info); result = serializer.serialize(&buffer, &sz, fileDataBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); FileSize emptyOffset; FileDataInfo emptyInfo(emptyOffset); FileDataDeserializer deserializer(fileDataBuffer.data(), fileDataBuffer.size(), emptyInfo); result = deserializer.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserializer.getWholePduSize() == 24); REQUIRE(deserializer.getPduDataFieldLen() == 14); REQUIRE(deserializer.getSegmentationControl() == @@ -136,10 +136,10 @@ TEST_CASE("File Data PDU", "[FileDataPdu]") { sz = 0; result = serializer.serialize(&buffer, &sz, fileDataBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); result = deserializer.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(emptyInfo.getOffset().getSize() == 50); REQUIRE(emptyInfo.hasSegmentMetadata() == true); @@ -164,7 +164,7 @@ TEST_CASE("File Data PDU", "[FileDataPdu]") { // Starting at 15, the file data is parsed. There is not leading file data length // field to the parser can't check whether the remaining length is valid if (invalidPduField < 15) { - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } } diff --git a/unittests/cfdp/testFinishedPdu.cpp b/unittests/cfdp/testFinishedPdu.cpp index 143eaf2a..dd04144c 100644 --- a/unittests/cfdp/testFinishedPdu.cpp +++ b/unittests/cfdp/testFinishedPdu.cpp @@ -7,7 +7,7 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { using namespace cfdp; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array fnBuffer = {}; uint8_t* buffer = fnBuffer.data(); size_t sz = 0; @@ -24,7 +24,7 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { SECTION("Serialize") { FinishPduSerializer serializer(pduConf, info); result = serializer.serialize(&buffer, &sz, fnBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serializer.getSerializedSize() == 12); REQUIRE(((fnBuffer[1] << 8) | fnBuffer[2]) == 2); REQUIRE(fnBuffer[10] == cfdp::FileDirectives::FINISH); @@ -47,7 +47,7 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { sz = 0; buffer = fnBuffer.data(); result = serializer.serialize(&buffer, &sz, fnBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serializer.getSerializedSize() == 12 + 14); REQUIRE(serializer.getPduDataFieldLen() == 16); @@ -69,7 +69,7 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { sz = 0; buffer = fnBuffer.data(); result = serializer.serialize(&buffer, &sz, fnBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); info.setConditionCode(cfdp::ConditionCode::FILESTORE_REJECTION); REQUIRE(serializer.getSerializedSize() == 12 + 14 + 15 + 4); REQUIRE(sz == 12 + 14 + 15 + 4); @@ -81,7 +81,7 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { sz = 0; buffer = fnBuffer.data(); result = serializer.serialize(&buffer, &sz, maxSz, SerializeIF::Endianness::NETWORK); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } @@ -89,10 +89,10 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { FinishedInfo emptyInfo; FinishPduSerializer serializer(pduConf, info); result = serializer.serialize(&buffer, &sz, fnBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); FinishPduDeserializer deserializer(fnBuffer.data(), fnBuffer.size(), emptyInfo); result = deserializer.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(emptyInfo.getFileStatus() == cfdp::FinishedFileStatus::DISCARDED_DELIBERATELY); REQUIRE(emptyInfo.getConditionCode() == cfdp::ConditionCode::INACTIVITY_DETECTED); REQUIRE(emptyInfo.getDeliveryCode() == cfdp::FinishedDeliveryCode::DATA_INCOMPLETE); @@ -110,13 +110,13 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { serializer.updateDirectiveFieldLen(); REQUIRE(serializer.getPduDataFieldLen() == 16); result = serializer.serialize(&buffer, &sz, fnBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); FilestoreResponseTlv emptyResponse(firstNameLv, nullptr); responsePtr = &emptyResponse; emptyInfo.setFilestoreResponsesArray(&responsePtr, nullptr, &len); FinishPduDeserializer deserializer2(fnBuffer.data(), fnBuffer.size(), emptyInfo); result = deserializer2.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(emptyInfo.getFsResponsesLen() == 1); FilestoreResponseTlv** responseArray = nullptr; emptyInfo.getFilestoreResonses(&responseArray, nullptr, nullptr); @@ -145,7 +145,7 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { sz = 0; buffer = fnBuffer.data(); result = serializer.serialize(&buffer, &sz, fnBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); EntityId emptyId; EntityIdTlv emptyFaultLoc(emptyId); emptyInfo.setFaultLocation(&emptyFaultLoc); @@ -154,7 +154,7 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { response2.setFilestoreMessage(&emptyFsMsg); FinishPduDeserializer deserializer3(fnBuffer.data(), fnBuffer.size(), emptyInfo); result = deserializer3.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); auto& infoRef = deserializer3.getInfo(); REQUIRE(deserializer3.getWholePduSize() == 45); @@ -183,7 +183,7 @@ TEST_CASE("Finished PDU", "[FinishedPdu]") { for (size_t maxSz = 0; maxSz < 45; maxSz++) { FinishPduDeserializer faultyDeser(fnBuffer.data(), maxSz, emptyInfo); result = faultyDeser.parseData(); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } } diff --git a/unittests/cfdp/testKeepAlivePdu.cpp b/unittests/cfdp/testKeepAlivePdu.cpp index 8ec8c66c..4b52a084 100644 --- a/unittests/cfdp/testKeepAlivePdu.cpp +++ b/unittests/cfdp/testKeepAlivePdu.cpp @@ -7,7 +7,7 @@ TEST_CASE("Keep Alive PDU", "[KeepAlivePdu]") { using namespace cfdp; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array kaBuffer = {}; uint8_t* buffer = kaBuffer.data(); size_t sz = 0; @@ -21,12 +21,12 @@ TEST_CASE("Keep Alive PDU", "[KeepAlivePdu]") { SECTION("Serialize") { KeepAlivePduSerializer serializer(pduConf, progress); result = serializer.serialize(&buffer, &sz, kaBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(kaBuffer[10] == cfdp::FileDirectives::KEEP_ALIVE); uint32_t fsRaw = 0; result = SerializeAdapter::deSerialize(&fsRaw, kaBuffer.data() + 11, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(fsRaw == 0x50); REQUIRE(sz == 15); REQUIRE(serializer.getWholePduSize() == 15); @@ -37,33 +37,33 @@ TEST_CASE("Keep Alive PDU", "[KeepAlivePdu]") { buffer = kaBuffer.data(); sz = 0; result = serializer.serialize(&buffer, &sz, kaBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serializer.getWholePduSize() == 19); REQUIRE(serializer.getPduDataFieldLen() == 9); uint64_t fsRawLarge = 0; result = SerializeAdapter::deSerialize(&fsRawLarge, kaBuffer.data() + 11, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(fsRawLarge == 0x50); for (size_t invalidMaxSz = 0; invalidMaxSz < sz; invalidMaxSz++) { buffer = kaBuffer.data(); sz = 0; result = serializer.serialize(&buffer, &sz, invalidMaxSz, SerializeIF::Endianness::NETWORK); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } SECTION("Deserialize") { KeepAlivePduSerializer serializer(pduConf, progress); result = serializer.serialize(&buffer, &sz, kaBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); // Set another file size progress.setFileSize(200, false); KeepAlivePduDeserializer deserializer(kaBuffer.data(), kaBuffer.size(), progress); result = deserializer.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); auto& progRef = deserializer.getProgress(); // Should have been overwritten REQUIRE(progRef.getSize() == 0x50); @@ -73,7 +73,7 @@ TEST_CASE("Keep Alive PDU", "[KeepAlivePdu]") { for (size_t invalidMaxSz = 0; invalidMaxSz < sz; invalidMaxSz++) { deserializer.setData(kaBuffer.data(), invalidMaxSz); result = deserializer.parseData(); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } } diff --git a/unittests/cfdp/testMetadataPdu.cpp b/unittests/cfdp/testMetadataPdu.cpp index 331d64a9..7e90e8d3 100644 --- a/unittests/cfdp/testMetadataPdu.cpp +++ b/unittests/cfdp/testMetadataPdu.cpp @@ -10,7 +10,7 @@ TEST_CASE("Metadata PDU", "[MetadataPdu]") { using namespace cfdp; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array mdBuffer = {}; uint8_t* buffer = mdBuffer.data(); size_t sz = 0; @@ -41,7 +41,7 @@ TEST_CASE("Metadata PDU", "[MetadataPdu]") { SECTION("Serialize") { MetadataPduSerializer serializer(pduConf, info); result = serializer.serialize(&buffer, &sz, mdBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serializer.getWholePduSize() == 27); REQUIRE(info.getSourceFileName().getSerializedSize() == 10); REQUIRE(info.getDestFileName().getSerializedSize() == 1); @@ -53,7 +53,7 @@ TEST_CASE("Metadata PDU", "[MetadataPdu]") { uint32_t fileSizeRaw = 0; result = SerializeAdapter::deSerialize(&fileSizeRaw, mdBuffer.data() + 12, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(fileSizeRaw == 35); REQUIRE(mdBuffer[16] == 9); REQUIRE(mdBuffer[17] == 'h'); @@ -83,7 +83,7 @@ TEST_CASE("Metadata PDU", "[MetadataPdu]") { serializer.updateDirectiveFieldLen(); result = serializer.serialize(&buffer, &sz, mdBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE((mdBuffer[1] << 8 | mdBuffer[2]) == 37); auto checksumType = static_cast(mdBuffer[11] & 0x0f); REQUIRE(checksumType == cfdp::ChecksumType::CRC_32C); @@ -117,16 +117,16 @@ TEST_CASE("Metadata PDU", "[MetadataPdu]") { SECTION("Deserialize") { MetadataPduSerializer serializer(pduConf, info); result = serializer.serialize(&buffer, &sz, mdBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); MetadataPduDeserializer deserializer(mdBuffer.data(), mdBuffer.size(), info); result = deserializer.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); size_t fullSize = deserializer.getWholePduSize(); for (size_t maxSz = 0; maxSz < fullSize; maxSz++) { MetadataPduDeserializer invalidSzDeser(mdBuffer.data(), maxSz, info); result = invalidSzDeser.parseData(); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } size_t sizeOfOptions = options.size(); size_t maxSize = 4; @@ -140,11 +140,11 @@ TEST_CASE("Metadata PDU", "[MetadataPdu]") { info.setSourceFileName(sourceFileName); result = serializer.serialize(&buffer, &sz, mdBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); MetadataPduDeserializer deserializer2(mdBuffer.data(), mdBuffer.size(), info); result = deserializer2.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(options[0]->getType() == cfdp::TlvTypes::FILESTORE_RESPONSE); REQUIRE(options[0]->getSerializedSize() == 14); REQUIRE(options[1]->getType() == cfdp::TlvTypes::MSG_TO_USER); @@ -162,7 +162,7 @@ TEST_CASE("Metadata PDU", "[MetadataPdu]") { } // This is the precise length where there are no options or one option if (invalidFieldLen != 17 and invalidFieldLen != 31) { - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } mdBuffer[1] = (36 >> 8) & 0xff; diff --git a/unittests/cfdp/testNakPdu.cpp b/unittests/cfdp/testNakPdu.cpp index 38b45300..0fc74c89 100644 --- a/unittests/cfdp/testNakPdu.cpp +++ b/unittests/cfdp/testNakPdu.cpp @@ -8,7 +8,7 @@ TEST_CASE("NAK PDU", "[NakPdu]") { using namespace cfdp; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array nakBuffer = {}; uint8_t* buffer = nakBuffer.data(); size_t sz = 0; @@ -23,7 +23,7 @@ TEST_CASE("NAK PDU", "[NakPdu]") { SECTION("Serializer") { NakPduSerializer serializer(pduConf, info); result = serializer.serialize(&buffer, &sz, nakBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serializer.getSerializedSize() == 19); REQUIRE(serializer.FileDirectiveSerializer::getSerializedSize() == 11); REQUIRE(sz == 19); @@ -33,11 +33,11 @@ TEST_CASE("NAK PDU", "[NakPdu]") { uint32_t scope = 0; result = SerializeAdapter::deSerialize(&scope, nakBuffer.data() + 11, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(scope == 50); result = SerializeAdapter::deSerialize(&scope, nakBuffer.data() + 15, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(scope == 1050); NakInfo::SegmentRequest segReq0(cfdp::FileSize(2020), cfdp::FileSize(2520)); @@ -50,26 +50,26 @@ TEST_CASE("NAK PDU", "[NakPdu]") { size_t sz = 0; serializer.updateDirectiveFieldLen(); result = serializer.serialize(&buffer, &sz, nakBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serializer.getSerializedSize() == 35); REQUIRE(serializer.getPduDataFieldLen() == 25); REQUIRE(((nakBuffer[1] << 8) | nakBuffer[2]) == 25); uint32_t segReqScopes = 0; result = SerializeAdapter::deSerialize(&segReqScopes, nakBuffer.data() + 19, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(segReqScopes == 2020); result = SerializeAdapter::deSerialize(&segReqScopes, nakBuffer.data() + 23, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(segReqScopes == 2520); result = SerializeAdapter::deSerialize(&segReqScopes, nakBuffer.data() + 27, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(segReqScopes == 2932); result = SerializeAdapter::deSerialize(&segReqScopes, nakBuffer.data() + 31, nullptr, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(segReqScopes == 3021); for (size_t maxSz = 0; maxSz < 35; maxSz++) { @@ -89,13 +89,13 @@ TEST_CASE("NAK PDU", "[NakPdu]") { SECTION("Deserializer") { NakPduSerializer serializer(pduConf, info); result = serializer.serialize(&buffer, &sz, nakBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); info.getStartOfScope().setFileSize(0, false); info.getEndOfScope().setFileSize(0, false); NakPduDeserializer deserializer(nakBuffer.data(), nakBuffer.size(), info); result = deserializer.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserializer.getWholePduSize() == 19); REQUIRE(info.getStartOfScope().getSize() == 50); REQUIRE(info.getEndOfScope().getSize() == 1050); @@ -110,11 +110,11 @@ TEST_CASE("NAK PDU", "[NakPdu]") { size_t sz = 0; serializer.updateDirectiveFieldLen(); result = serializer.serialize(&buffer, &sz, nakBuffer.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); NakPduDeserializer deserializeWithSegReqs(nakBuffer.data(), nakBuffer.size(), info); result = deserializeWithSegReqs.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); NakInfo::SegmentRequest* segReqsPtr = nullptr; size_t readSegReqs = 0; info.getSegmentRequests(&segReqsPtr, &readSegReqs, nullptr); @@ -128,7 +128,7 @@ TEST_CASE("NAK PDU", "[NakPdu]") { for (size_t idx = 0; idx < 34; idx++) { NakPduDeserializer faultyDeserializer(nakBuffer.data(), idx, info); result = faultyDeserializer.parseData(); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } for (size_t pduFieldLen = 0; pduFieldLen < 25; pduFieldLen++) { nakBuffer[1] = (pduFieldLen >> 8) & 0xff; @@ -143,7 +143,7 @@ TEST_CASE("NAK PDU", "[NakPdu]") { REQUIRE(info.getSegmentRequestsLen() == 2); } if (pduFieldLen != 9 and pduFieldLen != 17 and pduFieldLen != 25) { - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } info.setMaxSegmentRequestLen(5); diff --git a/unittests/cfdp/testPromptPdu.cpp b/unittests/cfdp/testPromptPdu.cpp index 9f406aec..80363983 100644 --- a/unittests/cfdp/testPromptPdu.cpp +++ b/unittests/cfdp/testPromptPdu.cpp @@ -7,7 +7,7 @@ TEST_CASE("Prompt PDU", "[PromptPdu]") { using namespace cfdp; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array rawBuf = {}; uint8_t* buffer = rawBuf.data(); size_t sz = 0; @@ -19,7 +19,7 @@ TEST_CASE("Prompt PDU", "[PromptPdu]") { SECTION("Serialize") { PromptPduSerializer serializer(pduConf, cfdp::PromptResponseRequired::PROMPT_KEEP_ALIVE); result = serializer.serialize(&buffer, &sz, rawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(serializer.getWholePduSize() == 12); REQUIRE(sz == 12); REQUIRE(serializer.getPduDataFieldLen() == 2); @@ -30,24 +30,24 @@ TEST_CASE("Prompt PDU", "[PromptPdu]") { uint8_t* buffer = rawBuf.data(); size_t sz = 0; result = serializer.serialize(&buffer, &sz, invalidMaxSz, SerializeIF::Endianness::NETWORK); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } for (size_t invalidSz = 1; invalidSz < sz; invalidSz++) { size_t locSz = invalidSz; uint8_t* buffer = rawBuf.data(); result = serializer.serialize(&buffer, &locSz, sz, SerializeIF::Endianness::NETWORK); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } SECTION("Deserialize") { PromptPduSerializer serializer(pduConf, cfdp::PromptResponseRequired::PROMPT_KEEP_ALIVE); result = serializer.serialize(&buffer, &sz, rawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); PromptPduDeserializer deserializer(rawBuf.data(), rawBuf.size()); result = deserializer.parseData(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserializer.getPromptResponseRequired() == cfdp::PromptResponseRequired::PROMPT_KEEP_ALIVE); sz = deserializer.getWholePduSize(); @@ -59,7 +59,7 @@ TEST_CASE("Prompt PDU", "[PromptPdu]") { for (size_t invalidMaxSz = 0; invalidMaxSz < sz; invalidMaxSz++) { deserializer.setData(rawBuf.data(), invalidMaxSz); result = deserializer.parseData(); - REQUIRE(result != HasReturnvaluesIF::RETURN_OK); + REQUIRE(result != returnvalue::OK); } } } diff --git a/unittests/cfdp/testTlvsLvs.cpp b/unittests/cfdp/testTlvsLvs.cpp index c251fd15..3bfd3a6b 100644 --- a/unittests/cfdp/testTlvsLvs.cpp +++ b/unittests/cfdp/testTlvsLvs.cpp @@ -16,7 +16,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { using namespace cfdp; - int result = HasReturnvaluesIF::RETURN_OK; + int result = returnvalue::OK; std::array rawBuf; uint8_t* serPtr = rawBuf.data(); const uint8_t* deserPtr = rawBuf.data(); @@ -28,7 +28,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { serPtr = tlvRawBuf.data(); result = sourceId.serialize(&serPtr, &deserSize, tlvRawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserSize == 2); auto tlv = Tlv(TlvTypes::ENTITY_ID, tlvRawBuf.data(), deserSize); REQUIRE(tlv.getSerializedSize() == 4); @@ -36,7 +36,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { serPtr = rawBuf.data(); deserSize = 0; result = tlv.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserSize == 4); REQUIRE(rawBuf[0] == TlvTypes::ENTITY_ID); REQUIRE(rawBuf[1] == 2); @@ -55,25 +55,25 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { serPtr = rawBuf.data(); deserSize = 0; result = tlv.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(rawBuf[0] == TlvTypes::ENTITY_ID); REQUIRE(rawBuf[1] == 4); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); serPtr = rawBuf.data(); deserSize = 0; auto tlvInvalid = Tlv(cfdp::TlvTypes::INVALID_TLV, tlvRawBuf.data(), 0); REQUIRE(tlvInvalid.serialize(&serPtr, &deserSize, rawBuf.size(), - SerializeIF::Endianness::NETWORK) != HasReturnvaluesIF::RETURN_OK); + SerializeIF::Endianness::NETWORK) != returnvalue::OK); tlvInvalid = Tlv(cfdp::TlvTypes::ENTITY_ID, nullptr, 3); REQUIRE(tlvInvalid.serialize(&serPtr, &deserSize, rawBuf.size(), - SerializeIF::Endianness::NETWORK) != HasReturnvaluesIF::RETURN_OK); + SerializeIF::Endianness::NETWORK) != returnvalue::OK); REQUIRE(tlvInvalid.serialize(&serPtr, &deserSize, 0, SerializeIF::Endianness::NETWORK) != - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); REQUIRE(tlvInvalid.getSerializedSize() == 0); REQUIRE(tlvInvalid.serialize(nullptr, nullptr, 0, SerializeIF::Endianness::NETWORK) != - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); Tlv zeroLenField(TlvTypes::FAULT_HANDLER, nullptr, 0); REQUIRE(zeroLenField.getSerializedSize() == 2); @@ -81,7 +81,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { deserSize = 0; REQUIRE(zeroLenField.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); REQUIRE(rawBuf[0] == TlvTypes::FAULT_HANDLER); REQUIRE(rawBuf[1] == 0); } @@ -100,7 +100,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { Tlv tlv; deserPtr = rawBuf.data(); result = tlv.deSerialize(&deserPtr, &deserSize, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(tlv.getSerializedSize() == 4); REQUIRE(tlv.getType() == TlvTypes::ENTITY_ID); deserPtr = tlv.getValue(); @@ -111,7 +111,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { REQUIRE(entityId == 0x0ff0); REQUIRE(tlv.deSerialize(nullptr, nullptr, SerializeIF::Endianness::NETWORK) != - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); deserPtr = rawBuf.data(); deserSize = 0; REQUIRE(tlv.deSerialize(&deserPtr, &deserSize, SerializeIF::Endianness::NETWORK) == @@ -120,17 +120,17 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { rawBuf[0] = TlvTypes::INVALID_TLV; deserSize = 4; REQUIRE(tlv.deSerialize(&deserPtr, &deserSize, SerializeIF::Endianness::NETWORK) != - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); Tlv zeroLenField(TlvTypes::FAULT_HANDLER, nullptr, 0); serPtr = rawBuf.data(); deserSize = 0; REQUIRE(zeroLenField.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); deserPtr = rawBuf.data(); result = zeroLenField.deSerialize(&deserPtr, &deserSize, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(zeroLenField.getSerializedSize() == 2); REQUIRE(deserSize == 0); } @@ -140,7 +140,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { serPtr = lvRawBuf.data(); result = sourceId.serialize(&serPtr, &deserSize, lvRawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserSize == 2); auto lv = cfdp::Lv(lvRawBuf.data(), 2); auto lvCopy = cfdp::Lv(lv); @@ -150,7 +150,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { serPtr = rawBuf.data(); deserSize = 0; result = lv.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserSize == 3); REQUIRE(rawBuf[0] == 2); uint16_t sourceId = 0; @@ -164,7 +164,7 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { deserSize = 0; result = lvEmpty.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserSize == 1); } @@ -177,13 +177,13 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { serPtr = rawBuf.data(); deserSize = 0; result = lv.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); Lv uninitLv; deserPtr = rawBuf.data(); deserSize = 3; result = uninitLv.deSerialize(&deserPtr, &deserSize, SerializeIF::Endianness::BIG); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(uninitLv.getSerializedSize() == 3); const uint8_t* storedValue = uninitLv.getValue(nullptr); uint16_t sourceId = 0; @@ -197,15 +197,15 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { deserSize = 0; result = lvEmpty.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(deserSize == 1); deserPtr = rawBuf.data(); result = uninitLv.deSerialize(&deserPtr, &deserSize, SerializeIF::Endianness::BIG); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(uninitLv.getSerializedSize() == 1); REQUIRE(uninitLv.deSerialize(nullptr, nullptr, SerializeIF::Endianness::BIG) == - HasReturnvaluesIF::RETURN_FAILED); + returnvalue::FAILED); serPtr = rawBuf.data(); deserSize = 0; REQUIRE(uninitLv.serialize(&serPtr, &deserSize, 0, SerializeIF::Endianness::BIG) == @@ -233,14 +233,14 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { std::array serBuf = {}; result = response.convertToTlv(rawResponse, serBuf.data(), serBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(rawResponse.getType() == cfdp::TlvTypes::FILESTORE_RESPONSE); cfdp::Lv emptyMsg; cfdp::Lv emptySecondName; FilestoreResponseTlv emptyTlv(firstName, &emptyMsg); emptyTlv.setSecondFileName(&emptySecondName); result = emptyTlv.deSerialize(rawResponse, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(emptyTlv.getActionCode() == cfdp::FilestoreActionCode::APPEND_FILE); REQUIRE(emptyTlv.getStatusCode() == cfdp::FSR_SUCCESS); size_t firstNameLen = 0; @@ -274,26 +274,26 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { REQUIRE(expectedSz == 10 + 11 + 1); REQUIRE(request.getSerializedSize() == expectedSz + 2); result = request.serialize(&ptr, &sz, serBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(sz == expectedSz + 2); FilestoreRequestTlv emptyRequest(firstName); emptyRequest.setSecondFileName(&secondName); const uint8_t* constptr = serBuf.data(); result = emptyRequest.deSerialize(&constptr, &sz, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); cfdp::Tlv rawRequest; ptr = serBuf.data(); sz = 0; result = request.convertToTlv(rawRequest, serBuf.data(), serBuf.size(), SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(rawRequest.getType() == cfdp::TlvTypes::FILESTORE_REQUEST); emptyRequest.setActionCode(cfdp::FilestoreActionCode::DELETE_FILE); result = emptyRequest.deSerialize(rawRequest, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(emptyRequest.getType() == cfdp::TlvTypes::FILESTORE_REQUEST); REQUIRE(emptyRequest.getActionCode() == cfdp::FilestoreActionCode::APPEND_FILE); } @@ -310,11 +310,11 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { faultOverrideTlv.serialize(&serPtr, &sz, rawBuf.size(), SerializeIF::Endianness::NETWORK); REQUIRE(faultOverrideTlv.getSerializedSize() == 3); REQUIRE(sz == 3); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); FaultHandlerOverrideTlv emptyOverrideTlv; result = emptyOverrideTlv.deSerialize(&deserPtr, &sz, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); EntityId entId(cfdp::WidthInBytes::TWO_BYTES, 0x42); EntityId emptyId; @@ -322,9 +322,9 @@ TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") { serPtr = rawBuf.data(); result = idTlv.serialize(&serPtr, &deserSize, rawBuf.size(), SerializeIF::Endianness::NETWORK); cfdp::Tlv rawTlv(cfdp::TlvTypes::ENTITY_ID, rawBuf.data() + 2, 2); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); deserPtr = rawBuf.data(); result = idTlv.deSerialize(rawTlv, SerializeIF::Endianness::NETWORK); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); } } diff --git a/unittests/container/RingBufferTest.cpp b/unittests/container/RingBufferTest.cpp index edabfd55..efc571b4 100644 --- a/unittests/container/RingBufferTest.cpp +++ b/unittests/container/RingBufferTest.cpp @@ -12,42 +12,42 @@ TEST_CASE("Ring Buffer Test", "[RingBufferTest]") { SECTION("Simple Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); - REQUIRE(ringBuffer.writeData(testData, 3) == result::FAILED); - REQUIRE(ringBuffer.readData(readBuffer, 5, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 9) == returnvalue::OK); + REQUIRE(ringBuffer.writeData(testData, 3) == returnvalue::FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, true) == returnvalue::OK); for (uint8_t i = 0; i < 5; i++) { CHECK(readBuffer[i] == i); } REQUIRE(ringBuffer.availableWriteSpace() == 5); ringBuffer.clear(); REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 4) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 4, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 4) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 4, true) == returnvalue::OK); for (uint8_t i = 0; i < 4; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 9, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 9) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 9, true) == returnvalue::OK); for (uint8_t i = 0; i < 9; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 1024) == result::FAILED); - REQUIRE(ringBuffer.writeData(nullptr, 5) == result::FAILED); + REQUIRE(ringBuffer.writeData(testData, 1024) == returnvalue::FAILED); + REQUIRE(ringBuffer.writeData(nullptr, 5) == returnvalue::FAILED); } SECTION("Get Free Element Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 8) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 8) == returnvalue::OK); REQUIRE(ringBuffer.availableWriteSpace() == 1); - REQUIRE(ringBuffer.readData(readBuffer, 8, true) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 8, true) == returnvalue::OK); REQUIRE(ringBuffer.availableWriteSpace() == 9); uint8_t *testPtr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == result::FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == returnvalue::FAILED); REQUIRE(ringBuffer.writeTillWrap() == 2); // too many excess bytes. - REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == result::FAILED); - REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == result::OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == returnvalue::FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == returnvalue::OK); REQUIRE(ringBuffer.getExcessBytes() == 3); std::memcpy(testPtr, testData, 5); ringBuffer.confirmBytesWritten(5); @@ -59,19 +59,19 @@ TEST_CASE("Ring Buffer Test", "[RingBufferTest]") { } SECTION("Read Remaining Test") { - REQUIRE(ringBuffer.writeData(testData, 3) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 3) == returnvalue::OK); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == result::FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == returnvalue::FAILED); size_t trueSize = 0; - REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == returnvalue::OK); REQUIRE(trueSize == 3); for (uint8_t i = 0; i < 3; i++) { CHECK(readBuffer[i] == i); } trueSize = 0; - REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == result::FAILED); + REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == returnvalue::FAILED); REQUIRE(trueSize == 0); - REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == result::OK); + REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == returnvalue::OK); REQUIRE(trueSize == 3); } } @@ -84,21 +84,21 @@ TEST_CASE("Ring Buffer Test2", "[RingBufferTest2]") { SECTION("Simple Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 5, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 9) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, true) == returnvalue::OK); for (uint8_t i = 0; i < 5; i++) { CHECK(readBuffer[i] == i); } REQUIRE(ringBuffer.availableWriteSpace() == 5); ringBuffer.clear(); REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 4) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 4, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 4) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 4, true) == returnvalue::OK); for (uint8_t i = 0; i < 4; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 9, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 9) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 9, true) == returnvalue::OK); for (uint8_t i = 0; i < 9; i++) { CHECK(readBuffer[i] == i); } @@ -106,17 +106,17 @@ TEST_CASE("Ring Buffer Test2", "[RingBufferTest2]") { SECTION("Get Free Element Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 8) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 8) == returnvalue::OK); REQUIRE(ringBuffer.availableWriteSpace() == 1); - REQUIRE(ringBuffer.readData(readBuffer, 8, true) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 8, true) == returnvalue::OK); REQUIRE(ringBuffer.availableWriteSpace() == 9); uint8_t *testPtr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == result::FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == returnvalue::FAILED); REQUIRE(ringBuffer.writeTillWrap() == 2); // too many excess bytes. - REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == result::FAILED); - REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == result::OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == returnvalue::FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == returnvalue::OK); REQUIRE(ringBuffer.getExcessBytes() == 3); std::memcpy(testPtr, testData, 5); ringBuffer.confirmBytesWritten(5); @@ -128,19 +128,19 @@ TEST_CASE("Ring Buffer Test2", "[RingBufferTest2]") { } SECTION("Read Remaining Test") { - REQUIRE(ringBuffer.writeData(testData, 3) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 3) == returnvalue::OK); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == result::FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == returnvalue::FAILED); size_t trueSize = 0; - REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == returnvalue::OK); REQUIRE(trueSize == 3); for (uint8_t i = 0; i < 3; i++) { CHECK(readBuffer[i] == i); } trueSize = 0; - REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == result::FAILED); + REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == returnvalue::FAILED); REQUIRE(trueSize == 0); - REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == result::OK); + REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == returnvalue::OK); REQUIRE(trueSize == 3); } @@ -148,17 +148,17 @@ TEST_CASE("Ring Buffer Test2", "[RingBufferTest2]") { REQUIRE(ringBuffer.availableWriteSpace() == 9); // We don't allow writing of Data that is larger than the ring buffer in total REQUIRE(ringBuffer.getMaxSize() == 9); - REQUIRE(ringBuffer.writeData(testData, 13) == result::FAILED); + REQUIRE(ringBuffer.writeData(testData, 13) == returnvalue::FAILED); REQUIRE(ringBuffer.getAvailableReadData() == 0); ringBuffer.clear(); uint8_t *ptr = nullptr; // With excess Bytes 13 Bytes can be written to this Buffer - REQUIRE(ringBuffer.getFreeElement(&ptr, 13) == result::OK); + REQUIRE(ringBuffer.getFreeElement(&ptr, 13) == returnvalue::OK); REQUIRE(ptr != nullptr); memcpy(ptr, testData, 13); ringBuffer.confirmBytesWritten(13); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 3, true) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 3, true) == returnvalue::OK); for (auto i = 0; i < 3; i++) { REQUIRE(readBuffer[i] == testData[i + 10]); } @@ -173,21 +173,21 @@ TEST_CASE("Ring Buffer Test3", "[RingBufferTest3]") { SECTION("Simple Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 5, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 9) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, true) == returnvalue::OK); for (uint8_t i = 0; i < 5; i++) { CHECK(readBuffer[i] == i); } REQUIRE(ringBuffer.availableWriteSpace() == 5); ringBuffer.clear(); REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 4) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 4, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 4) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 4, true) == returnvalue::OK); for (uint8_t i = 0; i < 4; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 9, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 9) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 9, true) == returnvalue::OK); for (uint8_t i = 0; i < 9; i++) { CHECK(readBuffer[i] == i); } @@ -195,19 +195,19 @@ TEST_CASE("Ring Buffer Test3", "[RingBufferTest3]") { SECTION("Get Free Element Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 8) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 8) == returnvalue::OK); REQUIRE(ringBuffer.availableWriteSpace() == 1); - REQUIRE(ringBuffer.readData(readBuffer, 8, true) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 8, true) == returnvalue::OK); REQUIRE(ringBuffer.availableWriteSpace() == 9); uint8_t *testPtr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == result::OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == returnvalue::OK); REQUIRE(ringBuffer.getExcessBytes() == 8); REQUIRE(ringBuffer.writeTillWrap() == 2); // too many excess bytes. - REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == result::FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == returnvalue::FAILED); // Less Execss bytes overwrites before - REQUIRE(ringBuffer.getFreeElement(&testPtr, 3) == result::OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 3) == returnvalue::OK); REQUIRE(ringBuffer.getExcessBytes() == 1); std::memcpy(testPtr, testData, 3); ringBuffer.confirmBytesWritten(3); @@ -219,19 +219,19 @@ TEST_CASE("Ring Buffer Test3", "[RingBufferTest3]") { } SECTION("Read Remaining Test") { - REQUIRE(ringBuffer.writeData(testData, 3) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 3) == returnvalue::OK); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == result::FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == returnvalue::FAILED); size_t trueSize = 0; - REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == returnvalue::OK); REQUIRE(trueSize == 3); for (uint8_t i = 0; i < 3; i++) { CHECK(readBuffer[i] == i); } trueSize = 0; - REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == result::FAILED); + REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == returnvalue::FAILED); REQUIRE(trueSize == 0); - REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == result::OK); + REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == returnvalue::OK); REQUIRE(trueSize == 3); } @@ -239,18 +239,18 @@ TEST_CASE("Ring Buffer Test3", "[RingBufferTest3]") { REQUIRE(ringBuffer.availableWriteSpace() == 9); // Writing more than the buffer is large. // This write will be rejected and is seen as a configuration mistake - REQUIRE(ringBuffer.writeData(testData, 13) == result::FAILED); + REQUIRE(ringBuffer.writeData(testData, 13) == returnvalue::FAILED); REQUIRE(ringBuffer.getAvailableReadData() == 0); ringBuffer.clear(); // Using FreeElement allows the usage of excessBytes but // should be used with caution uint8_t *ptr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&ptr, 13) == result::OK); + REQUIRE(ringBuffer.getFreeElement(&ptr, 13) == returnvalue::OK); REQUIRE(ptr != nullptr); memcpy(ptr, testData, 13); ringBuffer.confirmBytesWritten(13); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 3, true) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 3, true) == returnvalue::OK); for (auto i = 0; i < 3; i++) { REQUIRE(readBuffer[i] == testData[i + 10]); } @@ -264,22 +264,22 @@ TEST_CASE("Ring Buffer Test4", "[RingBufferTest4]") { SECTION("Simple Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); - REQUIRE(ringBuffer.writeData(testData, 3) == result::FAILED); - REQUIRE(ringBuffer.readData(readBuffer, 5, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 9) == returnvalue::OK); + REQUIRE(ringBuffer.writeData(testData, 3) == returnvalue::FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, true) == returnvalue::OK); for (uint8_t i = 0; i < 5; i++) { CHECK(readBuffer[i] == i); } REQUIRE(ringBuffer.availableWriteSpace() == 5); ringBuffer.clear(); REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 4) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 4, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 4) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 4, true) == returnvalue::OK); for (uint8_t i = 0; i < 4; i++) { CHECK(readBuffer[i] == i); } - REQUIRE(ringBuffer.writeData(testData, 9) == result::OK); - REQUIRE(ringBuffer.readData(readBuffer, 9, true) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 9) == returnvalue::OK); + REQUIRE(ringBuffer.readData(readBuffer, 9, true) == returnvalue::OK); for (uint8_t i = 0; i < 9; i++) { CHECK(readBuffer[i] == i); } @@ -287,16 +287,16 @@ TEST_CASE("Ring Buffer Test4", "[RingBufferTest4]") { SECTION("Get Free Element Test") { REQUIRE(ringBuffer.availableWriteSpace() == 9); - REQUIRE(ringBuffer.writeData(testData, 8) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 8) == returnvalue::OK); REQUIRE(ringBuffer.availableWriteSpace() == 1); - REQUIRE(ringBuffer.readData(readBuffer, 8, true) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 8, true) == returnvalue::OK); REQUIRE(ringBuffer.availableWriteSpace() == 9); uint8_t *testPtr = nullptr; - REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == result::FAILED); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 10) == returnvalue::FAILED); REQUIRE(ringBuffer.writeTillWrap() == 2); - REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == result::OK); - REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == result::OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 8) == returnvalue::OK); + REQUIRE(ringBuffer.getFreeElement(&testPtr, 5) == returnvalue::OK); REQUIRE(ringBuffer.getExcessBytes() == 3); std::memcpy(testPtr, testData, 5); ringBuffer.confirmBytesWritten(5); @@ -308,19 +308,19 @@ TEST_CASE("Ring Buffer Test4", "[RingBufferTest4]") { } SECTION("Read Remaining Test") { - REQUIRE(ringBuffer.writeData(testData, 3) == result::OK); + REQUIRE(ringBuffer.writeData(testData, 3) == returnvalue::OK); REQUIRE(ringBuffer.getAvailableReadData() == 3); - REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == result::FAILED); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, false, nullptr) == returnvalue::FAILED); size_t trueSize = 0; - REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == result::OK); + REQUIRE(ringBuffer.readData(readBuffer, 5, false, true, &trueSize) == returnvalue::OK); REQUIRE(trueSize == 3); for (uint8_t i = 0; i < 3; i++) { CHECK(readBuffer[i] == i); } trueSize = 0; - REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == result::FAILED); + REQUIRE(ringBuffer.deleteData(5, false, &trueSize) == returnvalue::FAILED); REQUIRE(trueSize == 0); - REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == result::OK); + REQUIRE(ringBuffer.deleteData(5, true, &trueSize) == returnvalue::OK); REQUIRE(trueSize == 3); } } diff --git a/unittests/container/TestArrayList.cpp b/unittests/container/TestArrayList.cpp index 4daf59d4..e2f14e47 100644 --- a/unittests/container/TestArrayList.cpp +++ b/unittests/container/TestArrayList.cpp @@ -25,7 +25,7 @@ TEST_CASE("Array List", "[ArrayListTest]") { SECTION("SimpleTest") { REQUIRE(list.maxSize() == 20); REQUIRE(list.size == 0); - REQUIRE(list.insert(10) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(list.insert(10) == static_cast(returnvalue::OK)); REQUIRE(list[0] == 10); REQUIRE(list.front() != nullptr); REQUIRE((*list.front()) == 10); @@ -41,7 +41,7 @@ TEST_CASE("Array List", "[ArrayListTest]") { // This is an invalid element but its not a nullptr REQUIRE(list.back() != nullptr); for (auto i = 0; i < 20; i++) { - REQUIRE(list.insert(i) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(list.insert(i) == static_cast(returnvalue::OK)); } REQUIRE(list.insert(20) == static_cast(ArrayList::FULL)); ArrayList::Iterator it = list.begin(); @@ -64,7 +64,7 @@ TEST_CASE("Array List", "[ArrayListTest]") { SECTION("Const Iterator") { ArrayList::Iterator it = list.begin(); for (auto i = 0; i < 10; i++) { - REQUIRE(list.insert(i) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(list.insert(i) == static_cast(returnvalue::OK)); } it++; const uint16_t* number = it.value; @@ -75,7 +75,7 @@ TEST_CASE("Array List", "[ArrayListTest]") { ArrayList::Iterator it = complexList.begin(); for (auto i = 0; i < 10; i++) { REQUIRE(complexList.insert(TestClass(i, i + 1)) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); } it++; const TestClass* secondTest = it.value; diff --git a/unittests/container/TestDynamicFifo.cpp b/unittests/container/TestDynamicFifo.cpp index 6769c247..1475b0dc 100644 --- a/unittests/container/TestDynamicFifo.cpp +++ b/unittests/container/TestDynamicFifo.cpp @@ -35,13 +35,13 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { REQUIRE(fifo.empty()); REQUIRE(not fifo.full()); - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structThree) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structThree) == static_cast(returnvalue::OK)); REQUIRE(fifo.insert(structTwo) == static_cast(FIFOBase::FULL)); struct Test testptr; - REQUIRE(fifo.peek(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.peek(&testptr) == static_cast(returnvalue::OK)); bool equal = testptr == structOne; REQUIRE(equal); REQUIRE(fifo.size() == 3); @@ -52,7 +52,7 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { testptr.number1 = 0; testptr.number2 = 0; testptr.number3 = 0; - REQUIRE(fifo.retrieve(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.retrieve(&testptr) == static_cast(returnvalue::OK)); equal = testptr == list[i]; REQUIRE(equal); REQUIRE(fifo.size() == i); @@ -66,29 +66,29 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { REQUIRE(fifo.empty()); REQUIRE(fifo.pop() == static_cast(FIFOBase::EMPTY)); - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 1); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 2); - REQUIRE(fifo.pop() == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.pop() == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 1); testptr.number1 = 0; testptr.number2 = 0; testptr.number3 = 0; - REQUIRE(fifo.peek(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.peek(&testptr) == static_cast(returnvalue::OK)); equal = testptr == structTwo; REQUIRE(equal); - REQUIRE(fifo.pop() == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.pop() == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 0); REQUIRE(fifo.empty()); // struct Test* ptr = nullptr; - // REQUIRE(fifo.retrieve(ptr) == static_cast(HasReturnvaluesIF::RETURN_FAILED)); - // REQUIRE(fifo.peek(ptr) == static_cast(HasReturnvaluesIF::RETURN_FAILED)); + // REQUIRE(fifo.retrieve(ptr) == static_cast(HasReturnvaluesIF::returnvalue::FAILED)); + // REQUIRE(fifo.peek(ptr) == static_cast(HasReturnvaluesIF::returnvalue::FAILED)); }; SECTION("Copy Test") { - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structThree) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structThree) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 3); REQUIRE(fifo.full()); REQUIRE(not fifo.empty()); @@ -100,9 +100,9 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { }; SECTION("Assignment Test") { - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structThree) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structThree) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 3); REQUIRE(fifo.full()); REQUIRE(not fifo.empty()); @@ -114,7 +114,7 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { REQUIRE(not fifo2.empty()); for (size_t i = 2; i < 3; i--) { struct Test testptr = {0, 0, 0}; - REQUIRE(fifo2.retrieve(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo2.retrieve(&testptr) == static_cast(returnvalue::OK)); bool equal = testptr == list[i]; REQUIRE(equal); REQUIRE(fifo2.size() == i); @@ -122,9 +122,9 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { }; SECTION("Assignment Test Smaller") { - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structThree) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structThree) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 3); REQUIRE(fifo.full()); REQUIRE(not fifo.empty()); @@ -136,7 +136,7 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { REQUIRE(not fifo2.empty()); for (size_t i = 2; i < 3; i--) { struct Test testptr = {0, 0, 0}; - REQUIRE(fifo2.retrieve(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo2.retrieve(&testptr) == static_cast(returnvalue::OK)); bool equal = testptr == list[i]; REQUIRE(equal); REQUIRE(fifo2.size() == i); diff --git a/unittests/container/TestFifo.cpp b/unittests/container/TestFifo.cpp index 0b4b41af..1a3c9d8a 100644 --- a/unittests/container/TestFifo.cpp +++ b/unittests/container/TestFifo.cpp @@ -35,13 +35,13 @@ TEST_CASE("Static Fifo Tests", "[TestFifo]") { REQUIRE(fifo.empty()); REQUIRE(not fifo.full()); - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structThree) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structThree) == static_cast(returnvalue::OK)); REQUIRE(fifo.insert(structTwo) == static_cast(FIFOBase::FULL)); struct Test testptr; - REQUIRE(fifo.peek(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.peek(&testptr) == static_cast(returnvalue::OK)); bool equal = testptr == structOne; REQUIRE(equal); REQUIRE(fifo.size() == 3); @@ -52,7 +52,7 @@ TEST_CASE("Static Fifo Tests", "[TestFifo]") { testptr.number1 = 0; testptr.number2 = 0; testptr.number3 = 0; - REQUIRE(fifo.retrieve(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.retrieve(&testptr) == static_cast(returnvalue::OK)); equal = testptr == list[i]; REQUIRE(equal); REQUIRE(fifo.size() == i); @@ -66,11 +66,11 @@ TEST_CASE("Static Fifo Tests", "[TestFifo]") { REQUIRE(fifo.empty()); REQUIRE(fifo.pop() == static_cast(FIFOBase::EMPTY)); - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 1); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 2); - REQUIRE(fifo.pop() == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.pop() == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 1); testptr.number1 = 0; testptr.number2 = 0; @@ -78,20 +78,20 @@ TEST_CASE("Static Fifo Tests", "[TestFifo]") { // Test that retrieve and peek will not cause a nullptr dereference struct Test* ptr = nullptr; - REQUIRE(fifo.retrieve(ptr) == static_cast(HasReturnvaluesIF::RETURN_FAILED)); - REQUIRE(fifo.peek(ptr) == static_cast(HasReturnvaluesIF::RETURN_FAILED)); + REQUIRE(fifo.retrieve(ptr) == static_cast(returnvalue::FAILED)); + REQUIRE(fifo.peek(ptr) == static_cast(returnvalue::FAILED)); - REQUIRE(fifo.peek(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.peek(&testptr) == static_cast(returnvalue::OK)); equal = testptr == structTwo; REQUIRE(equal); - REQUIRE(fifo.pop() == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.pop() == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 0); REQUIRE(fifo.empty()); }; SECTION("Copy Test") { - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structThree) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structThree) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 3); REQUIRE(fifo.full()); REQUIRE(not fifo.empty()); @@ -102,7 +102,7 @@ TEST_CASE("Static Fifo Tests", "[TestFifo]") { REQUIRE(not fifo2.empty()); for (size_t i = 2; i < 3; i--) { struct Test testptr = {0, 0, 0}; - REQUIRE(fifo2.retrieve(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo2.retrieve(&testptr) == static_cast(returnvalue::OK)); bool equal = testptr == list[i]; REQUIRE(equal); REQUIRE(fifo2.size() == i); @@ -110,9 +110,9 @@ TEST_CASE("Static Fifo Tests", "[TestFifo]") { }; SECTION("Assignment Test") { - REQUIRE(fifo.insert(structOne) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structTwo) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(fifo.insert(structThree) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structTwo) == static_cast(returnvalue::OK)); + REQUIRE(fifo.insert(structThree) == static_cast(returnvalue::OK)); REQUIRE(fifo.size() == 3); REQUIRE(fifo.full()); REQUIRE(not fifo.empty()); @@ -124,7 +124,7 @@ TEST_CASE("Static Fifo Tests", "[TestFifo]") { REQUIRE(not fifo2.empty()); for (size_t i = 2; i < 3; i--) { struct Test testptr = {0, 0, 0}; - REQUIRE(fifo2.retrieve(&testptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(fifo2.retrieve(&testptr) == static_cast(returnvalue::OK)); bool equal = testptr == list[i]; REQUIRE(equal); REQUIRE(fifo2.size() == i); diff --git a/unittests/container/TestFixedArrayList.cpp b/unittests/container/TestFixedArrayList.cpp index 6beb8d5d..b28c3166 100644 --- a/unittests/container/TestFixedArrayList.cpp +++ b/unittests/container/TestFixedArrayList.cpp @@ -10,7 +10,7 @@ TEST_CASE("FixedArrayList Tests", "[TestFixedArrayList]") { using testList = FixedArrayList; testList list; REQUIRE(list.size == 0); - REQUIRE(list.insert(10) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(list.insert(10) == static_cast(returnvalue::OK)); REQUIRE(list.size == 1); REQUIRE(list.maxSize() == 260); SECTION("Copy Constructor") { @@ -29,7 +29,7 @@ TEST_CASE("FixedArrayList Tests", "[TestFixedArrayList]") { }; SECTION("Fill") { for (auto i = 1; i < 260; i++) { - REQUIRE(list.insert(i) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(list.insert(i) == static_cast(returnvalue::OK)); } REQUIRE(list.insert(260) == static_cast(ArrayList::FULL)); list.clear(); diff --git a/unittests/container/TestFixedMap.cpp b/unittests/container/TestFixedMap.cpp index d3c65760..d17cc55b 100644 --- a/unittests/container/TestFixedMap.cpp +++ b/unittests/container/TestFixedMap.cpp @@ -20,8 +20,8 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { SECTION("Fill and erase") { for (uint16_t i = 0; i < 30; i++) { REQUIRE(map.insert(std::make_pair(i, i + 1)) == - static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(map.exists(i) == static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); + REQUIRE(map.exists(i) == static_cast(returnvalue::OK)); REQUIRE(map.find(i)->second == i + 1); REQUIRE(not map.empty()); } @@ -32,7 +32,7 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { REQUIRE(map.full()); { uint16_t* ptr; - REQUIRE(map.find(5, &ptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.find(5, &ptr) == static_cast(returnvalue::OK)); REQUIRE(*ptr == 6); REQUIRE(*(map.findValue(6)) == 7); REQUIRE(map.find(31, &ptr) == @@ -41,7 +41,7 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { REQUIRE(map.getSerializedSize() == (sizeof(uint32_t) + 30 * (sizeof(uint32_t) + sizeof(uint16_t)))); - REQUIRE(map.erase(2) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.erase(2) == static_cast(returnvalue::OK)); REQUIRE(map.erase(31) == static_cast(FixedMap::KEY_DOES_NOT_EXIST)); REQUIRE(map.exists(2) == static_cast(FixedMap::KEY_DOES_NOT_EXIST)); REQUIRE(map.size() == 29); @@ -60,7 +60,7 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { } for (FixedMap::Iterator it = map.begin(); it != map.end(); it++) { - REQUIRE(map.erase(&it) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.erase(&it) == static_cast(returnvalue::OK)); } REQUIRE(map.size() == 0); @@ -73,11 +73,11 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { SECTION("Insert variants") { FixedMap::Iterator it = map.end(); - REQUIRE(map.insert(36, 37, &it) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.insert(36, 37, &it) == static_cast(returnvalue::OK)); REQUIRE(it->first == 36); REQUIRE(it->second == 37); REQUIRE(map.size() == 1); - REQUIRE(map.insert(37, 38, nullptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.insert(37, 38, nullptr) == static_cast(returnvalue::OK)); REQUIRE(map.find(37)->second == 38); REQUIRE(map.size() == 2); REQUIRE(map.insert(37, 24, nullptr) == @@ -86,8 +86,8 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { REQUIRE(map.size() == 2); }; SECTION("Serialize and DeSerialize") { - REQUIRE(map.insert(36, 37, nullptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(map.insert(37, 38, nullptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.insert(36, 37, nullptr) == static_cast(returnvalue::OK)); + REQUIRE(map.insert(37, 38, nullptr) == static_cast(returnvalue::OK)); uint8_t buffer[sizeof(uint32_t) + 2 * (sizeof(uint32_t) + sizeof(uint16_t))]; REQUIRE(map.getSerializedSize() == (sizeof(uint32_t) + 2 * (sizeof(uint32_t) + sizeof(uint16_t)))); @@ -99,25 +99,25 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { size = 0; REQUIRE(map.serialize( &loc_ptr, &size, sizeof(uint32_t) + 2 * (sizeof(uint32_t) + sizeof(uint16_t)), - SerializeIF::Endianness::BIG) == static_cast(HasReturnvaluesIF::RETURN_OK)); + SerializeIF::Endianness::BIG) == static_cast(returnvalue::OK)); REQUIRE(size == 16); uint32_t internal_size = 0; const uint8_t* ptr2 = buffer; REQUIRE( SerializeAdapter::deSerialize(&internal_size, &ptr2, &size, SerializeIF::Endianness::BIG) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(internal_size == 2); for (uint8_t i = 36; i < 38; i++) { uint32_t first_element = 0; REQUIRE(SerializeAdapter::deSerialize(&first_element, &ptr2, &size, SerializeIF::Endianness::BIG) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(first_element == i); uint16_t second_element = 0; REQUIRE(SerializeAdapter::deSerialize(&second_element, &ptr2, &size, SerializeIF::Endianness::BIG) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(second_element == i + 1); } REQUIRE(size == 0); @@ -126,7 +126,7 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { size = 16; REQUIRE(map.size() == 0); REQUIRE(map.deSerialize(&constPtr, &size, SerializeIF::Endianness::BIG) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(map.size() == 2); REQUIRE(map.find(36)->second == 37); for (auto& element : map) { @@ -154,12 +154,12 @@ TEST_CASE("FixedMap Tests", "[TestFixedMap]") { size_t size = 0; size_t max_size = sizeof(uint32_t) + 1 * (sizeof(uint32_t) + sizeof(uint16_t)); REQUIRE(map.serialize(&ptr, &size, max_size, SerializeIF::Endianness::LITTLE) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); map.clear(); REQUIRE(map.size() == 0); const uint8_t* ptr2 = newBuffer; REQUIRE(map.deSerialize(&ptr2, &size, SerializeIF::Endianness::LITTLE) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(map.size() == 1); REQUIRE(map.find(10)->second == 20); }; diff --git a/unittests/container/TestFixedOrderedMultimap.cpp b/unittests/container/TestFixedOrderedMultimap.cpp index 88b32694..153144cd 100644 --- a/unittests/container/TestFixedOrderedMultimap.cpp +++ b/unittests/container/TestFixedOrderedMultimap.cpp @@ -15,8 +15,8 @@ TEST_CASE("FixedOrderedMultimap Tests", "[TestFixedOrderedMultimap]") { SECTION("Test insert, find, exists") { for (uint16_t i = 0; i < 30; i++) { REQUIRE(map.insert(std::make_pair(i, i + 1)) == - static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(map.exists(i) == static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); + REQUIRE(map.exists(i) == static_cast(returnvalue::OK)); REQUIRE(map.find(i)->second == i + 1); } REQUIRE(map.insert(0, 0) == @@ -26,12 +26,12 @@ TEST_CASE("FixedOrderedMultimap Tests", "[TestFixedOrderedMultimap]") { REQUIRE(map.size() == 30); { uint16_t* ptr; - REQUIRE(map.find(5, &ptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.find(5, &ptr) == static_cast(returnvalue::OK)); REQUIRE(*ptr == 6); REQUIRE(map.find(31, &ptr) == static_cast(FixedOrderedMultimap::KEY_DOES_NOT_EXIST)); } - REQUIRE(map.erase(2) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.erase(2) == static_cast(returnvalue::OK)); REQUIRE(map.erase(31) == static_cast(FixedOrderedMultimap::KEY_DOES_NOT_EXIST)); REQUIRE(map.exists(2) == @@ -55,7 +55,7 @@ TEST_CASE("FixedOrderedMultimap Tests", "[TestFixedOrderedMultimap]") { { FixedOrderedMultimap::Iterator it = map.begin(); while (it != map.end()) { - REQUIRE(map.erase(&it) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.erase(&it) == static_cast(returnvalue::OK)); } REQUIRE(map.size() == 0); } @@ -69,16 +69,16 @@ TEST_CASE("FixedOrderedMultimap Tests", "[TestFixedOrderedMultimap]") { SECTION("Test different insert variants") { FixedOrderedMultimap::Iterator it = map.end(); - REQUIRE(map.insert(36, 37, &it) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.insert(36, 37, &it) == static_cast(returnvalue::OK)); REQUIRE(it->first == 36); REQUIRE(it->second == 37); REQUIRE(map.size() == 1); - REQUIRE(map.insert(37, 38, nullptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.insert(37, 38, nullptr) == static_cast(returnvalue::OK)); REQUIRE(map.find(37)->second == 38); REQUIRE(map.size() == 2); - REQUIRE(map.insert(37, 24, nullptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.insert(37, 24, nullptr) == static_cast(returnvalue::OK)); REQUIRE(map.find(37)->second == 38); - REQUIRE(map.insert(0, 1, nullptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.insert(0, 1, nullptr) == static_cast(returnvalue::OK)); REQUIRE(map.find(0)->second == 1); REQUIRE(map.size() == 4); map.clear(); @@ -128,8 +128,8 @@ TEST_CASE("FixedOrderedMultimap Non Trivial Type", "[TestFixedOrderedMultimapNon SECTION("Test insert, find, exists") { for (uint16_t i = 0; i < 30; i++) { REQUIRE(map.insert(std::make_pair(i, TestClass(i + 1, i))) == - static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(map.exists(i) == static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); + REQUIRE(map.exists(i) == static_cast(returnvalue::OK)); bool compare = map.find(i)->second == TestClass(i + 1, i); REQUIRE(compare); } @@ -140,13 +140,13 @@ TEST_CASE("FixedOrderedMultimap Non Trivial Type", "[TestFixedOrderedMultimapNon REQUIRE(map.size() == 30); { TestClass* ptr = nullptr; - REQUIRE(map.find(5, &ptr) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.find(5, &ptr) == static_cast(returnvalue::OK)); bool compare = *ptr == TestClass(6, 5); REQUIRE(compare); REQUIRE(map.find(31, &ptr) == static_cast(FixedOrderedMultimap::KEY_DOES_NOT_EXIST)); } - REQUIRE(map.erase(2) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.erase(2) == static_cast(returnvalue::OK)); REQUIRE(map.erase(31) == static_cast(FixedOrderedMultimap::KEY_DOES_NOT_EXIST)); REQUIRE(map.exists(2) == @@ -174,7 +174,7 @@ TEST_CASE("FixedOrderedMultimap Non Trivial Type", "[TestFixedOrderedMultimapNon { FixedOrderedMultimap::Iterator it = map.begin(); while (it != map.end()) { - REQUIRE(map.erase(&it) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(map.erase(&it) == static_cast(returnvalue::OK)); } REQUIRE(map.size() == 0); } @@ -189,22 +189,22 @@ TEST_CASE("FixedOrderedMultimap Non Trivial Type", "[TestFixedOrderedMultimapNon SECTION("Test different insert variants") { FixedOrderedMultimap::Iterator it = map.end(); REQUIRE(map.insert(36, TestClass(37, 36), &it) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); REQUIRE(it->first == 36); bool compare = it->second == TestClass(37, 36); REQUIRE(compare); REQUIRE(map.size() == 1); REQUIRE(map.insert(37, TestClass(38, 37), nullptr) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); compare = map.find(37)->second == TestClass(38, 37); REQUIRE(compare); REQUIRE(map.size() == 2); REQUIRE(map.insert(37, TestClass(24, 37), nullptr) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); compare = map.find(37)->second == TestClass(38, 37); REQUIRE(compare); REQUIRE(map.insert(0, TestClass(1, 0), nullptr) == - static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); compare = map.find(0)->second == TestClass(1, 0); REQUIRE(compare); REQUIRE(map.size() == 4); diff --git a/unittests/container/TestPlacementFactory.cpp b/unittests/container/TestPlacementFactory.cpp index 1333567e..142f03d7 100644 --- a/unittests/container/TestPlacementFactory.cpp +++ b/unittests/container/TestPlacementFactory.cpp @@ -36,13 +36,13 @@ TEST_CASE("PlacementFactory Tests", "[TestPlacementFactory]") { static_cast(StorageManagerIF::DATA_TOO_LARGE)); uint64_t* number2 = factory.generate(12345); REQUIRE(number2 == nullptr); - REQUIRE(factory.destroy(number) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(factory.destroy(number) == static_cast(returnvalue::OK)); REQUIRE(storagePool.getFreeElement(&address, sizeof(uint64_t), &ptr) == - static_cast(HasReturnvaluesIF::RETURN_OK)); - REQUIRE(storagePool.deleteData(address) == static_cast(HasReturnvaluesIF::RETURN_OK)); + static_cast(returnvalue::OK)); + REQUIRE(storagePool.deleteData(address) == static_cast(returnvalue::OK)); // Check that PlacementFactory checks for nullptr ptr = nullptr; - REQUIRE(factory.destroy(ptr) == static_cast(HasReturnvaluesIF::RETURN_FAILED)); + REQUIRE(factory.destroy(ptr) == static_cast(returnvalue::FAILED)); } } diff --git a/unittests/datapoollocal/DataSetTest.cpp b/unittests/datapoollocal/DataSetTest.cpp index 45085eaf..5ccae911 100644 --- a/unittests/datapoollocal/DataSetTest.cpp +++ b/unittests/datapoollocal/DataSetTest.cpp @@ -16,8 +16,8 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { LocalPoolOwnerBase* poolOwner = ObjectManager::instance()->get(objects::TEST_LOCAL_POOL_OWNER_BASE); REQUIRE(poolOwner != nullptr); - REQUIRE(poolOwner->initializeHkManager() == result::OK); - REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == result::OK); + REQUIRE(poolOwner->initializeHkManager() == returnvalue::OK); + REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == returnvalue::OK); LocalPoolStaticTestDataSet localSet; SECTION("BasicTest") { @@ -36,7 +36,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { /* Test local pool ID serialization */ CHECK(localSet.serializeLocalPoolIds(&localPoolIdBuffPtr, &serSize, maxSize, - SerializeIF::Endianness::MACHINE) == result::OK); + SerializeIF::Endianness::MACHINE) == returnvalue::OK); CHECK(serSize == maxSize); CHECK(localPoolIdBuff[0] == 3); CHECK(lpIds[0] == localSet.localPoolVarUint8.getDataPoolId()); @@ -48,7 +48,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { serSize = 0; CHECK(localSet.serializeLocalPoolIds(&localPoolIdBuffPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE, - false) == result::OK); + false) == returnvalue::OK); CHECK(serSize == maxSize - sizeof(uint8_t)); CHECK(lpIds[0] == localSet.localPoolVarUint8.getDataPoolId()); CHECK(lpIds[1] == localSet.localPoolVarFloat.getDataPoolId()); @@ -57,7 +57,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { { /* Test read operation. Values should be all zeros */ PoolReadGuard readHelper(&localSet); - REQUIRE(readHelper.getReadResult() == result::OK); + REQUIRE(readHelper.getReadResult() == returnvalue::OK); CHECK(not localSet.isValid()); CHECK(localSet.localPoolVarUint8.value == 0); CHECK(not localSet.localPoolVarUint8.isValid()); @@ -90,7 +90,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { /* Now we read again and check whether our zeroed values were overwritten with the values in the pool */ PoolReadGuard readHelper(&localSet); - REQUIRE(readHelper.getReadResult() == result::OK); + REQUIRE(readHelper.getReadResult() == returnvalue::OK); CHECK(localSet.isValid()); CHECK(localSet.localPoolVarUint8.value == 232); CHECK(localSet.localPoolVarUint8.isValid()); @@ -110,7 +110,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { uint8_t buffer[maxSize + 1]; uint8_t* buffPtr = buffer; CHECK(localSet.serialize(&buffPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - result::OK); + returnvalue::OK); uint8_t rawUint8 = buffer[0]; CHECK(rawUint8 == 232); float rawFloat = 0.0; @@ -128,7 +128,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { std::memset(buffer, 0, sizeof(buffer)); const uint8_t* constBuffPtr = buffer; CHECK(localSet.deSerialize(&constBuffPtr, &sizeToDeserialize, - SerializeIF::Endianness::MACHINE) == result::OK); + SerializeIF::Endianness::MACHINE) == returnvalue::OK); /* Check whether deserialization was successfull */ CHECK(localSet.localPoolVarUint8.value == 0); CHECK(localSet.localPoolVarFloat.value == Catch::Approx(0.0)); @@ -156,7 +156,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { serSize = 0; buffPtr = buffer; CHECK(localSet.serialize(&buffPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - result::OK); + returnvalue::OK); CHECK(rawUint8 == 232); std::memcpy(&rawFloat, buffer + sizeof(uint8_t), sizeof(float)); CHECK(rawFloat == Catch::Approx(-2324.322)); @@ -186,7 +186,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { sizeToDeserialize = maxSize; constBuffPtr = buffer; CHECK(localSet.deSerialize(&constBuffPtr, &sizeToDeserialize, - SerializeIF::Endianness::MACHINE) == result::OK); + SerializeIF::Endianness::MACHINE) == returnvalue::OK); /* Check whether deserialization was successfull */ CHECK(localSet.localPoolVarUint8.value == 0); CHECK(localSet.localPoolVarFloat.value == Catch::Approx(0.0)); @@ -213,10 +213,10 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { /* Register same variables again to get more than 8 registered variables */ for (uint8_t idx = 0; idx < 8; idx++) { - REQUIRE(set.registerVariable(&localSet.localPoolVarUint8) == result::OK); + REQUIRE(set.registerVariable(&localSet.localPoolVarUint8) == returnvalue::OK); } - REQUIRE(set.registerVariable(&localSet.localPoolVarUint8) == result::OK); - REQUIRE(set.registerVariable(&localSet.localPoolUint16Vec) == result::OK); + REQUIRE(set.registerVariable(&localSet.localPoolVarUint8) == returnvalue::OK); + REQUIRE(set.registerVariable(&localSet.localPoolUint16Vec) == returnvalue::OK); set.setValidityBufferGeneration(true); { @@ -233,7 +233,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { uint8_t buffer[maxSize + 1]; uint8_t* buffPtr = buffer; CHECK(set.serialize(&buffPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - result::OK); + returnvalue::OK); std::array validityBuffer; std::memcpy(validityBuffer.data(), buffer + 9 + sizeof(uint16_t) * 3, 2); /* The first 9 variables should be valid */ @@ -251,7 +251,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { const uint8_t* constBuffPtr = buffer; size_t sizeToDeSerialize = serSize; CHECK(set.deSerialize(&constBuffPtr, &sizeToDeSerialize, SerializeIF::Endianness::MACHINE) == - result::OK); + returnvalue::OK); CHECK(localSet.localPoolVarUint8.isValid() == false); CHECK(localSet.localPoolUint16Vec.isValid() == true); } @@ -261,11 +261,11 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { SharedLocalDataSet sharedSet(sharedSetId, poolOwner, lpool::testSetId, 5); localSet.localPoolVarUint8.setReadWriteMode(pool_rwm_t::VAR_WRITE); localSet.localPoolUint16Vec.setReadWriteMode(pool_rwm_t::VAR_WRITE); - CHECK(sharedSet.registerVariable(&localSet.localPoolVarUint8) == result::OK); - CHECK(sharedSet.registerVariable(&localSet.localPoolUint16Vec) == result::OK); - CHECK(sharedSet.initialize() == result::OK); - CHECK(sharedSet.lockDataset() == result::OK); - CHECK(sharedSet.unlockDataset() == result::OK); + CHECK(sharedSet.registerVariable(&localSet.localPoolVarUint8) == returnvalue::OK); + CHECK(sharedSet.registerVariable(&localSet.localPoolUint16Vec) == returnvalue::OK); + CHECK(sharedSet.initialize() == returnvalue::OK); + CHECK(sharedSet.lockDataset() == returnvalue::OK); + CHECK(sharedSet.unlockDataset() == returnvalue::OK); { // PoolReadGuard rg(&sharedSet); @@ -274,7 +274,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { localSet.localPoolUint16Vec.value[0] = 1; localSet.localPoolUint16Vec.value[1] = 2; localSet.localPoolUint16Vec.value[2] = 3; - CHECK(sharedSet.commit() == result::OK); + CHECK(sharedSet.commit() == returnvalue::OK); } sharedSet.setReadCommitProtectionBehaviour(true); @@ -282,5 +282,5 @@ TEST_CASE("DataSetTest", "[DataSetTest]") { /* we need to reset the subscription list because the pool owner is a global object. */ - CHECK(poolOwner->reset() == result::OK); + CHECK(poolOwner->reset() == returnvalue::OK); } diff --git a/unittests/datapoollocal/LocalPoolManagerTest.cpp b/unittests/datapoollocal/LocalPoolManagerTest.cpp index 4fc67c97..e72b108f 100644 --- a/unittests/datapoollocal/LocalPoolManagerTest.cpp +++ b/unittests/datapoollocal/LocalPoolManagerTest.cpp @@ -18,8 +18,8 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { LocalPoolOwnerBase* poolOwner = ObjectManager::instance()->get(objects::TEST_LOCAL_POOL_OWNER_BASE); REQUIRE(poolOwner != nullptr); - REQUIRE(poolOwner->initializeHkManager() == result::OK); - REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == result::OK); + REQUIRE(poolOwner->initializeHkManager() == returnvalue::OK); + REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == returnvalue::OK); MessageQueueMockBase* poolOwnerMock = poolOwner->getMockQueueHandle(); REQUIRE(poolOwnerMock != nullptr); @@ -38,14 +38,14 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { CHECK(owner->getObjectId() == objects::TEST_LOCAL_POOL_OWNER_BASE); /* Subscribe for message generation on update. */ - REQUIRE(poolOwner->subscribeWrapperSetUpdate() == result::OK); + REQUIRE(poolOwner->subscribeWrapperSetUpdate() == returnvalue::OK); /* Subscribe for an update message. */ poolOwner->dataset.setChanged(true); /* Now the update message should be generated. */ - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent() == true); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_SET)); @@ -53,27 +53,27 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { CHECK(poolOwner->dataset.hasChanged() == false); /* Set changed again, result should be the same. */ poolOwner->dataset.setChanged(true); - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_SET)); /* Now subscribe for set update HK as well. */ - REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == result::OK); + REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == returnvalue::OK); poolOwner->dataset.setChanged(true); - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 2); /* first message sent should be the update notification, considering the internal list is a vector checked in insertion order. */ - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_SET)); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::HK_REPORT)); /* Clear message to avoid memory leak, our mock won't do it for us (yet) */ CommandMessageCleaner::clearCommandMessage(&messageSent); @@ -83,7 +83,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* Set the variables in the set to certain values. These are checked later. */ { PoolReadGuard readHelper(&poolOwner->dataset); - REQUIRE(readHelper.getReadResult() == result::OK); + REQUIRE(readHelper.getReadResult() == returnvalue::OK); poolOwner->dataset.localPoolVarUint8.value = 5; poolOwner->dataset.localPoolVarFloat.value = -12.242; poolOwner->dataset.localPoolUint16Vec.value[0] = 2; @@ -92,7 +92,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { } /* Subscribe for snapshot generation on update. */ - REQUIRE(poolOwner->subscribeWrapperSetUpdateSnapshot() == result::OK); + REQUIRE(poolOwner->subscribeWrapperSetUpdateSnapshot() == returnvalue::OK); poolOwner->dataset.setChanged(true); /* Store current time, we are going to check the (approximate) time equality later */ @@ -100,10 +100,10 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { Clock::getClock_timeval(&now); /* Trigger generation of snapshot */ - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); /* Check that snapshot was generated */ CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_SNAPSHOT_SET)); /* Now we deserialize the snapshot into a new dataset instance */ @@ -113,7 +113,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { store_address_t storeId; HousekeepingMessage::getUpdateSnapshotSetCommand(&messageSent, &storeId); ConstAccessorPair accessorPair = tglob::getIpcStoreHandle()->getData(storeId); - REQUIRE(accessorPair.first == result::OK); + REQUIRE(accessorPair.first == returnvalue::OK); const uint8_t* readOnlyPtr = accessorPair.second.data(); size_t sizeToDeserialize = accessorPair.second.size(); CHECK(newSet.localPoolVarFloat.value == 0); @@ -123,7 +123,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { CHECK(newSet.localPoolUint16Vec.value[2] == 0); /* Fill the dataset and timestamp */ REQUIRE(snapshot.deSerialize(&readOnlyPtr, &sizeToDeserialize, - SerializeIF::Endianness::MACHINE) == result::OK); + SerializeIF::Endianness::MACHINE) == returnvalue::OK); /* Now we check that the snapshot is actually correct */ CHECK(newSet.localPoolVarFloat.value == Catch::Approx(-12.242)); CHECK(newSet.localPoolVarUint8 == 5); @@ -134,7 +134,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* Now we check that both times are equal */ timeval timeFromHK; auto result = CCSDSTime::convertFromCDS(&timeFromHK, &cdsShort); - CHECK(result == HasReturnvaluesIF::RETURN_OK); + CHECK(result == returnvalue::OK); timeval difference = timeFromHK - now; CHECK(timevalOperations::toDouble(difference) < 1.0); } @@ -145,14 +145,14 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { REQUIRE(subscriptionIF != nullptr); /* Subscribe for variable snapshot */ - REQUIRE(poolOwner->subscribeWrapperVariableSnapshot(lpool::uint8VarId) == result::OK); + REQUIRE(poolOwner->subscribeWrapperVariableSnapshot(lpool::uint8VarId) == returnvalue::OK); auto poolVar = dynamic_cast*>(poolOwner->getPoolObjectHandle(lpool::uint8VarId)); REQUIRE(poolVar != nullptr); { PoolReadGuard rg(poolVar); - CHECK(rg.getReadResult() == result::OK); + CHECK(rg.getReadResult() == returnvalue::OK); poolVar->value = 25; } @@ -161,7 +161,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { CCSDSTime::CDS_short timeCdsNow; timeval now; Clock::getClock_timeval(&now); - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); /* Check update snapshot was sent. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); @@ -169,7 +169,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* Should have been reset. */ CHECK(poolVar->hasChanged() == false); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_SNAPSHOT_VARIABLE)); /* Now we deserialize the snapshot into a new dataset instance */ @@ -179,19 +179,19 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { store_address_t storeId; HousekeepingMessage::getUpdateSnapshotVariableCommand(&messageSent, &storeId); ConstAccessorPair accessorPair = tglob::getIpcStoreHandle()->getData(storeId); - REQUIRE(accessorPair.first == result::OK); + REQUIRE(accessorPair.first == returnvalue::OK); const uint8_t* readOnlyPtr = accessorPair.second.data(); size_t sizeToDeserialize = accessorPair.second.size(); CHECK(varCopy.value == 0); /* Fill the dataset and timestamp */ REQUIRE(snapshot.deSerialize(&readOnlyPtr, &sizeToDeserialize, - SerializeIF::Endianness::MACHINE) == result::OK); + SerializeIF::Endianness::MACHINE) == returnvalue::OK); CHECK(varCopy.value == 25); /* Now we check that both times are equal */ timeval timeFromHK; auto result = CCSDSTime::convertFromCDS(&timeFromHK, &cdsShort); - CHECK(result == HasReturnvaluesIF::RETURN_OK); + CHECK(result == returnvalue::OK); timeval difference = timeFromHK - now; CHECK(timevalOperations::toDouble(difference) < 1.0); } @@ -202,30 +202,30 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { REQUIRE(subscriptionIF != nullptr); /* Subscribe for variable update */ - REQUIRE(poolOwner->subscribeWrapperVariableUpdate(lpool::uint8VarId) == result::OK); + REQUIRE(poolOwner->subscribeWrapperVariableUpdate(lpool::uint8VarId) == returnvalue::OK); lp_var_t* poolVar = dynamic_cast*>(poolOwner->getPoolObjectHandle(lpool::uint8VarId)); REQUIRE(poolVar != nullptr); poolVar->setChanged(true); REQUIRE(poolVar->hasChanged() == true); - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); /* Check update notification was sent. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); /* Should have been reset. */ CHECK(poolVar->hasChanged() == false); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_VARIABLE)); /* Now subscribe for the dataset update (HK and update) again with subscription interface */ REQUIRE(subscriptionIF->subscribeForSetUpdateMessage(lpool::testSetId, objects::NO_OBJECT, objects::HK_RECEIVER_MOCK, - false) == result::OK); - REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == result::OK); + false) == returnvalue::OK); + REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == returnvalue::OK); poolOwner->dataset.setChanged(true); - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); /* Now two messages should be sent. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 2); @@ -233,17 +233,17 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { poolOwner->dataset.setChanged(true); poolVar->setChanged(true); - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); /* Now three messages should be sent. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 3); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_VARIABLE)); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::UPDATE_NOTIFICATION_SET)); - REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == result::OK); + REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == returnvalue::OK); CHECK(messageSent.getCommand() == static_cast(HousekeepingMessage::HK_REPORT)); CommandMessageCleaner::clearCommandMessage(&messageSent); REQUIRE(poolOwnerMock->receiveMessage(&messageSent) == static_cast(MessageQueueIF::EMPTY)); @@ -254,70 +254,70 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { the temporal behaviour correctly the HK manager should generate a HK packet immediately and the periodic helper depends on HK op function calls anyway instead of using the clock, so we could also just call performHkOperation multiple times */ - REQUIRE(poolOwner->subscribePeriodicHk(true) == result::OK); - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); + REQUIRE(poolOwner->subscribePeriodicHk(true) == returnvalue::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); /* Now HK packet should be sent as message immediately. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); LocalPoolDataSetBase* setHandle = poolOwner->getDataSetHandle(lpool::testSid); REQUIRE(setHandle != nullptr); CHECK(poolOwner->poolManager.generateHousekeepingPacket(lpool::testSid, setHandle, false) == - result::OK); + returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); CHECK(setHandle->getReportingEnabled() == true); CommandMessage hkCmd; HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, false, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); CHECK(setHandle->getReportingEnabled() == false); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, true, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); CHECK(setHandle->getReportingEnabled() == true); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, false, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); CHECK(setHandle->getReportingEnabled() == false); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setCollectionIntervalModificationCommand(&hkCmd, lpool::testSid, 0.4, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); /* For non-diagnostics and a specified minimum frequency of 0.2 seconds, the resulting collection interval should be 1.0 second */ CHECK(poolOwner->dataset.getCollectionInterval() == 1.0); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setStructureReportingCommand(&hkCmd, lpool::testSid, false); - REQUIRE(poolOwner->poolManager.performHkOperation() == result::OK); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + REQUIRE(poolOwner->poolManager.performHkOperation() == returnvalue::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); /* Now HK packet should be sent as message. */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setOneShotReportCommand(&hkCmd, lpool::testSid, false); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setUpdateNotificationSetCommand(&hkCmd, lpool::testSid); sid_t sidToCheck; store_address_t storeId; - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); CHECK(poolOwner->changedDataSetCallbackWasCalled(sidToCheck, storeId) == true); CHECK(sidToCheck == lpool::testSid); @@ -330,7 +330,7 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* We still expect a failure message being sent */ REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setCollectionIntervalModificationCommand(&hkCmd, lpool::testSid, 0.4, false); @@ -338,68 +338,68 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { static_cast(LocalDataPoolManager::WRONG_HK_PACKET_TYPE)); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setStructureReportingCommand(&hkCmd, lpool::testSid, false); CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == static_cast(LocalDataPoolManager::WRONG_HK_PACKET_TYPE)); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setStructureReportingCommand(&hkCmd, lpool::testSid, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setCollectionIntervalModificationCommand(&hkCmd, lpool::testSid, 0.4, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, true, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setToggleReportingCommand(&hkCmd, lpool::testSid, false, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setOneShotReportCommand(&hkCmd, lpool::testSid, false); CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == static_cast(LocalDataPoolManager::WRONG_HK_PACKET_TYPE)); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setOneShotReportCommand(&hkCmd, lpool::testSid, true); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); REQUIRE(poolOwnerMock->wasMessageSent(&messagesSent) == true); CHECK(messagesSent == 1); - CHECK(poolOwnerMock->popMessage() == result::OK); + CHECK(poolOwnerMock->popMessage() == returnvalue::OK); HousekeepingMessage::setUpdateNotificationVariableCommand(&hkCmd, lpool::uint8VarGpid); gp_id_t gpidToCheck; - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); CHECK(poolOwner->changedVariableCallbackWasCalled(gpidToCheck, storeId) == true); CHECK(gpidToCheck == lpool::uint8VarGpid); HousekeepingMessage::setUpdateSnapshotSetCommand(&hkCmd, lpool::testSid, storeId::INVALID_STORE_ADDRESS); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); CHECK(poolOwner->changedDataSetCallbackWasCalled(sidToCheck, storeId) == true); CHECK(sidToCheck == lpool::testSid); HousekeepingMessage::setUpdateSnapshotVariableCommand(&hkCmd, lpool::uint8VarGpid, storeId::INVALID_STORE_ADDRESS); - CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == result::OK); + CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == returnvalue::OK); CHECK(poolOwner->changedVariableCallbackWasCalled(gpidToCheck, storeId) == true); CHECK(gpidToCheck == lpool::uint8VarGpid); @@ -408,6 +408,6 @@ TEST_CASE("LocalPoolManagerTest", "[LocManTest]") { /* we need to reset the subscription list because the pool owner is a global object. */ - CHECK(poolOwner->reset() == result::OK); + CHECK(poolOwner->reset() == returnvalue::OK); poolOwnerMock->clearMessages(true); } diff --git a/unittests/datapoollocal/LocalPoolOwnerBase.cpp b/unittests/datapoollocal/LocalPoolOwnerBase.cpp index 6f054893..07ede256 100644 --- a/unittests/datapoollocal/LocalPoolOwnerBase.cpp +++ b/unittests/datapoollocal/LocalPoolOwnerBase.cpp @@ -14,7 +14,7 @@ ReturnValue_t LocalPoolOwnerBase::initializeHkManager() { initialized = true; return poolManager.initialize(messageQueue); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t LocalPoolOwnerBase::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, @@ -26,7 +26,7 @@ ReturnValue_t LocalPoolOwnerBase::initializeLocalDataPool(localpool::DataPool &l localDataPoolMap.emplace(lpool::uint16Vec3Id, new PoolEntry({0, 0, 0})); localDataPoolMap.emplace(lpool::int64Vec2Id, new PoolEntry({0, 0})); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } LocalPoolObjectBase *LocalPoolOwnerBase::getPoolObjectHandle(lp_id_t localPoolId) { @@ -47,10 +47,10 @@ LocalPoolObjectBase *LocalPoolOwnerBase::getPoolObjectHandle(lp_id_t localPoolId ReturnValue_t LocalPoolOwnerBase::reset() { resetSubscriptionList(); - ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t status = returnvalue::OK; { PoolReadGuard readHelper(&dataset); - if (readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) { + if (readHelper.getReadResult() != returnvalue::OK) { status = readHelper.getReadResult(); } dataset.localPoolVarUint8.value = 0; @@ -63,7 +63,7 @@ ReturnValue_t LocalPoolOwnerBase::reset() { { PoolReadGuard readHelper(&testUint32); - if (readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) { + if (readHelper.getReadResult() != returnvalue::OK) { status = readHelper.getReadResult(); } testUint32.value = 0; @@ -72,7 +72,7 @@ ReturnValue_t LocalPoolOwnerBase::reset() { { PoolReadGuard readHelper(&testInt64Vec); - if (readHelper.getReadResult() != HasReturnvaluesIF::RETURN_OK) { + if (readHelper.getReadResult() != returnvalue::OK) { status = readHelper.getReadResult(); } testInt64Vec.value[0] = 0; @@ -117,7 +117,7 @@ ReturnValue_t LocalPoolOwnerBase::initializeHkManagerAfterTaskCreation() { initializedAfterTaskCreation = true; return poolManager.initializeAfterTaskCreation(); } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void LocalPoolOwnerBase::handleChangedPoolVariable(gp_id_t globPoolId, store_address_t storeId, diff --git a/unittests/datapoollocal/LocalPoolVariableTest.cpp b/unittests/datapoollocal/LocalPoolVariableTest.cpp index e9bed9ed..ece01ca5 100644 --- a/unittests/datapoollocal/LocalPoolVariableTest.cpp +++ b/unittests/datapoollocal/LocalPoolVariableTest.cpp @@ -11,23 +11,23 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { auto* poolOwner = ObjectManager::instance()->get(objects::TEST_LOCAL_POOL_OWNER_BASE); REQUIRE(poolOwner != nullptr); - REQUIRE(poolOwner->initializeHkManager() == result::OK); - REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == result::OK); + REQUIRE(poolOwner->initializeHkManager() == returnvalue::OK); + REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == returnvalue::OK); SECTION("Basic Tests") { /* very basic test. */ lp_var_t testVariable = lp_var_t(objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint8VarId); - REQUIRE(testVariable.read() == result::OK); + REQUIRE(testVariable.read() == returnvalue::OK); CHECK(testVariable.value == 0); testVariable.value = 5; - REQUIRE(testVariable.commit() == result::OK); - REQUIRE(testVariable.read() == result::OK); + REQUIRE(testVariable.commit() == returnvalue::OK); + REQUIRE(testVariable.read() == returnvalue::OK); REQUIRE(testVariable.value == 5); CHECK(not testVariable.isValid()); testVariable.setValid(true); CHECK(testVariable.isValid()); - CHECK(testVariable.commit(true) == result::OK); + CHECK(testVariable.commit(true) == returnvalue::OK); testVariable.setReadWriteMode(pool_rwm_t::VAR_READ); CHECK(testVariable.getReadWriteMode() == pool_rwm_t::VAR_READ); @@ -43,7 +43,7 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { gp_id_t globPoolId(objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint8VarId); lp_var_t testVariable2 = lp_var_t(globPoolId); - REQUIRE(testVariable2.read() == result::OK); + REQUIRE(testVariable2.read() == returnvalue::OK); CHECK(testVariable2 == 5); CHECK(testVariable == testVariable2); testVariable = 10; @@ -55,12 +55,12 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { CHECK(maxSize == 1); size_t serSize = 0; CHECK(testVariable.serialize(&varPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - result::OK); + returnvalue::OK); CHECK(variableRaw == 10); const uint8_t* varConstPtr = &variableRaw; testVariable = 5; CHECK(testVariable.deSerialize(&varConstPtr, &serSize, SerializeIF::Endianness::MACHINE) == - result::OK); + returnvalue::OK); CHECK(testVariable == 10); CHECK(testVariable != testVariable2); CHECK(testVariable2 < testVariable); @@ -107,5 +107,5 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") { lp_var_t invalidObjectVar3 = lp_var_t(nullptr, lpool::uint8VarId); } - CHECK(poolOwner->reset() == result::OK); + CHECK(poolOwner->reset() == returnvalue::OK); } diff --git a/unittests/datapoollocal/LocalPoolVectorTest.cpp b/unittests/datapoollocal/LocalPoolVectorTest.cpp index ddf6da9b..fb75846b 100644 --- a/unittests/datapoollocal/LocalPoolVectorTest.cpp +++ b/unittests/datapoollocal/LocalPoolVectorTest.cpp @@ -11,26 +11,26 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { LocalPoolOwnerBase* poolOwner = ObjectManager::instance()->get(objects::TEST_LOCAL_POOL_OWNER_BASE); REQUIRE(poolOwner != nullptr); - REQUIRE(poolOwner->initializeHkManager() == result::OK); - REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == result::OK); + REQUIRE(poolOwner->initializeHkManager() == returnvalue::OK); + REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == returnvalue::OK); SECTION("BasicTest") { // very basic test. lp_vec_t testVector = lp_vec_t(objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint16Vec3Id); - REQUIRE(testVector.read() == result::OK); + REQUIRE(testVector.read() == returnvalue::OK); testVector.value[0] = 5; testVector.value[1] = 232; testVector.value[2] = 32023; - REQUIRE(testVector.commit(true) == result::OK); + REQUIRE(testVector.commit(true) == returnvalue::OK); CHECK(testVector.isValid()); testVector.value[0] = 0; testVector.value[1] = 0; testVector.value[2] = 0; - CHECK(testVector.read() == result::OK); + CHECK(testVector.read() == returnvalue::OK); CHECK(testVector.value[0] == 5); CHECK(testVector.value[1] == 232); CHECK(testVector.value[2] == 32023); @@ -41,7 +41,7 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { (we can't throw exceptions) */ testVector[4] = 12; CHECK(testVector[2] == 12); - CHECK(testVector.commit() == result::OK); + CHECK(testVector.commit() == returnvalue::OK); /* Use read-only reference. */ const lp_vec_t& roTestVec = testVector; @@ -58,7 +58,7 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { uint8_t* vecPtr = reinterpret_cast(serializedVector); size_t serSize = 0; REQUIRE(testVector.serialize(&vecPtr, &serSize, maxSize, SerializeIF::Endianness::MACHINE) == - result::OK); + returnvalue::OK); CHECK(serSize == 6); CHECK(serializedVector[0] == 5); @@ -75,7 +75,7 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") { const uint8_t* constVecPtr = reinterpret_cast(serializedVector); REQUIRE(testVector.deSerialize(&constVecPtr, &serSize, SerializeIF::Endianness::MACHINE) == - result::OK); + returnvalue::OK); CHECK(testVector[0] == 16); CHECK(testVector[1] == 7832); CHECK(testVector[2] == 39232); diff --git a/unittests/devicehandler/ComIFMock.cpp b/unittests/devicehandler/ComIFMock.cpp index 650b74bd..d51339dc 100644 --- a/unittests/devicehandler/ComIFMock.cpp +++ b/unittests/devicehandler/ComIFMock.cpp @@ -6,24 +6,24 @@ ComIFMock::ComIFMock(object_id_t objectId) : SystemObject(objectId) {} ComIFMock::~ComIFMock() {} -ReturnValue_t ComIFMock::initializeInterface(CookieIF *cookie) { return RETURN_OK; } +ReturnValue_t ComIFMock::initializeInterface(CookieIF *cookie) { return returnvalue::OK; } ReturnValue_t ComIFMock::sendMessage(CookieIF *cookie, const uint8_t *sendData, size_t sendLen) { data = *sendData; - return RETURN_OK; + return returnvalue::OK; } -ReturnValue_t ComIFMock::getSendSuccess(CookieIF *cookie) { return RETURN_OK; } +ReturnValue_t ComIFMock::getSendSuccess(CookieIF *cookie) { return returnvalue::OK; } ReturnValue_t ComIFMock::requestReceiveMessage(CookieIF *cookie, size_t requestLen) { - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t ComIFMock::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) { switch (testCase) { case TestCase::MISSED_REPLY: { *size = 0; - return RETURN_OK; + return returnvalue::OK; } case TestCase::SIMPLE_COMMAND_NOMINAL: { *size = 1; @@ -40,7 +40,7 @@ ReturnValue_t ComIFMock::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, default: break; } - return RETURN_OK; + return returnvalue::OK; } void ComIFMock::setTestCase(TestCase testCase_) { testCase = testCase_; } diff --git a/unittests/devicehandler/DeviceHandlerCommander.cpp b/unittests/devicehandler/DeviceHandlerCommander.cpp index d38166ad..03ff992c 100644 --- a/unittests/devicehandler/DeviceHandlerCommander.cpp +++ b/unittests/devicehandler/DeviceHandlerCommander.cpp @@ -13,15 +13,15 @@ DeviceHandlerCommander::~DeviceHandlerCommander() {} ReturnValue_t DeviceHandlerCommander::performOperation(uint8_t operationCode) { readCommandQueue(); - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t DeviceHandlerCommander::initialize() { ReturnValue_t result = commandActionHelper.initialize(); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { return result; } - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } MessageQueueIF* DeviceHandlerCommander::getCommandQueuePtr() { return commandQueue; } @@ -35,7 +35,7 @@ void DeviceHandlerCommander::dataReceived(ActionId_t actionId, const uint8_t* da } void DeviceHandlerCommander::completionSuccessfulReceived(ActionId_t actionId) { - lastReplyReturnCode = RETURN_OK; + lastReplyReturnCode = returnvalue::OK; } void DeviceHandlerCommander::completionFailedReceived(ActionId_t actionId, @@ -45,11 +45,11 @@ void DeviceHandlerCommander::completionFailedReceived(ActionId_t actionId, void DeviceHandlerCommander::readCommandQueue() { CommandMessage message; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - for (result = commandQueue->receiveMessage(&message); result == HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; + for (result = commandQueue->receiveMessage(&message); result == returnvalue::OK; result = commandQueue->receiveMessage(&message)) { result = commandActionHelper.handleReply(&message); - if (result == HasReturnvaluesIF::RETURN_OK) { + if (result == returnvalue::OK) { continue; } } @@ -61,4 +61,4 @@ ReturnValue_t DeviceHandlerCommander::sendCommand(object_id_t target, ActionId_t ReturnValue_t DeviceHandlerCommander::getReplyReturnCode() { return lastReplyReturnCode; } -void DeviceHandlerCommander::resetReplyReturnCode() { lastReplyReturnCode = RETURN_FAILED; } +void DeviceHandlerCommander::resetReplyReturnCode() { lastReplyReturnCode = returnvalue::FAILED; } diff --git a/unittests/devicehandler/DeviceHandlerCommander.h b/unittests/devicehandler/DeviceHandlerCommander.h index 435d0017..e90cbcee 100644 --- a/unittests/devicehandler/DeviceHandlerCommander.h +++ b/unittests/devicehandler/DeviceHandlerCommander.h @@ -9,8 +9,7 @@ class DeviceHandlerCommander : public ExecutableObjectIF, public SystemObject, - public CommandsActionsIF, - public HasReturnvaluesIF { + public CommandsActionsIF { public: DeviceHandlerCommander(object_id_t objectId); virtual ~DeviceHandlerCommander(); @@ -42,7 +41,7 @@ class DeviceHandlerCommander : public ExecutableObjectIF, CommandActionHelper commandActionHelper; - ReturnValue_t lastReplyReturnCode = RETURN_FAILED; + ReturnValue_t lastReplyReturnCode = returnvalue::FAILED; void readCommandQueue(); }; diff --git a/unittests/devicehandler/DeviceHandlerMock.cpp b/unittests/devicehandler/DeviceHandlerMock.cpp index ea30ff6a..3992d09c 100644 --- a/unittests/devicehandler/DeviceHandlerMock.cpp +++ b/unittests/devicehandler/DeviceHandlerMock.cpp @@ -36,7 +36,7 @@ ReturnValue_t DeviceHandlerMock::buildCommandFromCommand(DeviceCommandId_t devic WARN("DeviceHandlerMock::buildCommandFromCommand: Invalid device command"); break; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t DeviceHandlerMock::scanForReply(const uint8_t *start, size_t len, @@ -45,19 +45,19 @@ ReturnValue_t DeviceHandlerMock::scanForReply(const uint8_t *start, size_t len, case SIMPLE_COMMAND_DATA: { *foundId = SIMPLE_COMMAND; *foundLen = sizeof(SIMPLE_COMMAND_DATA); - return RETURN_OK; + return returnvalue::OK; break; } case PERIODIC_REPLY_DATA: { *foundId = PERIODIC_REPLY; *foundLen = sizeof(PERIODIC_REPLY_DATA); - return RETURN_OK; + return returnvalue::OK; break; } default: break; } - return RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t DeviceHandlerMock::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { @@ -70,7 +70,7 @@ ReturnValue_t DeviceHandlerMock::interpretDeviceReply(DeviceCommandId_t id, cons default: break; } - return RETURN_OK; + return returnvalue::OK; } void DeviceHandlerMock::fillCommandAndReplyMap() { diff --git a/unittests/devicehandler/TestDeviceHandlerBase.cpp b/unittests/devicehandler/TestDeviceHandlerBase.cpp index e8fdd17b..afa9d2ba 100644 --- a/unittests/devicehandler/TestDeviceHandlerBase.cpp +++ b/unittests/devicehandler/TestDeviceHandlerBase.cpp @@ -15,16 +15,16 @@ TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") { DeviceHandlerMock deviceHandlerMock(objects::DEVICE_HANDLER_MOCK, objects::COM_IF_MOCK, cookieIFMock, &deviceFdirMock); ReturnValue_t result = deviceHandlerMock.initialize(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); DeviceHandlerCommander deviceHandlerCommander(objects::DEVICE_HANDLER_COMMANDER); result = deviceHandlerCommander.initialize(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); SECTION("Commanding nominal") { comIF.setTestCase(ComIFMock::TestCase::SIMPLE_COMMAND_NOMINAL); result = deviceHandlerCommander.sendCommand(objects::DEVICE_HANDLER_MOCK, DeviceHandlerMock::SIMPLE_COMMAND); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); deviceHandlerMock.performOperation(DeviceHandlerIF::PERFORM_OPERATION); deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_WRITE); deviceHandlerMock.performOperation(DeviceHandlerIF::GET_WRITE); @@ -34,7 +34,7 @@ TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") { result = deviceHandlerCommander.getReplyReturnCode(); uint32_t missedReplies = deviceFdirMock.getMissedReplyCount(); REQUIRE(missedReplies == 0); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); } SECTION("Commanding missed reply") { @@ -44,7 +44,7 @@ TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") { deviceHandlerMock.changeSimpleCommandReplyCountdown(0); result = deviceHandlerCommander.sendCommand(objects::DEVICE_HANDLER_MOCK, DeviceHandlerMock::SIMPLE_COMMAND); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); deviceHandlerMock.performOperation(DeviceHandlerIF::PERFORM_OPERATION); deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_WRITE); deviceHandlerMock.performOperation(DeviceHandlerIF::GET_WRITE); diff --git a/unittests/globalfunctions/testDleEncoder.cpp b/unittests/globalfunctions/testDleEncoder.cpp index fc4d79bf..55e27ba4 100644 --- a/unittests/globalfunctions/testDleEncoder.cpp +++ b/unittests/globalfunctions/testDleEncoder.cpp @@ -49,7 +49,7 @@ const std::vector TEST_ARRAY_4_ENCODED_NON_ESCAPED = { TEST_CASE("DleEncoder", "[DleEncoder]") { DleEncoder dleEncoder; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t result = returnvalue::OK; std::array buffer; size_t encodedLen = 0; @@ -60,7 +60,7 @@ TEST_CASE("DleEncoder", "[DleEncoder]") { const std::vector& expectedVec) { result = encoder.encode(vecToEncode.data(), vecToEncode.size(), buffer.data(), buffer.size(), &encodedLen); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); for (size_t idx = 0; idx < expectedVec.size(); idx++) { REQUIRE(buffer[idx] == expectedVec[idx]); } @@ -71,7 +71,7 @@ TEST_CASE("DleEncoder", "[DleEncoder]") { const std::vector& expectedVec) { result = encoder.decode(testVecEncoded.data(), testVecEncoded.size(), &readLen, buffer.data(), buffer.size(), &decodedLen); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); REQUIRE(readLen == testVecEncoded.size()); REQUIRE(decodedLen == expectedVec.size()); for (size_t idx = 0; idx < decodedLen; idx++) { diff --git a/unittests/hal/testCommandExecutor.cpp b/unittests/hal/testCommandExecutor.cpp index d34f67aa..e6f1ae88 100644 --- a/unittests/hal/testCommandExecutor.cpp +++ b/unittests/hal/testCommandExecutor.cpp @@ -22,8 +22,8 @@ TEST_CASE("Command Executor", "[cmd-exec]") { REQUIRE(cmdExecutor.getCurrentState() == CommandExecutor::States::IDLE); ReturnValue_t result = cmdExecutor.load(cmd, true, true); REQUIRE(cmdExecutor.getCurrentState() == CommandExecutor::States::COMMAND_LOADED); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); - REQUIRE(cmdExecutor.execute() == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); + REQUIRE(cmdExecutor.execute() == returnvalue::OK); // Check that file exists with contents std::ifstream file(TEST_FILE_NAME); std::string line; @@ -38,7 +38,7 @@ TEST_CASE("Command Executor", "[cmd-exec]") { cmdExecutor.setRingBuffer(&outputBuffer, &sizesFifo); result = cmdExecutor.load("echo \"Hello World\"", false, false); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); cmdExecutor.execute(); bool bytesHaveBeenRead = false; size_t limitIdx = 0; @@ -58,7 +58,7 @@ TEST_CASE("Command Executor", "[cmd-exec]") { REQUIRE(readBytes == 12); REQUIRE(outputBuffer.getAvailableReadData() == 12); uint8_t readBuffer[32] = {}; - REQUIRE(outputBuffer.readData(readBuffer, 12) == HasReturnvaluesIF::RETURN_OK); + REQUIRE(outputBuffer.readData(readBuffer, 12) == returnvalue::OK); std::string readString(reinterpret_cast(readBuffer)); std::string cmpString = "Hello World\n"; CHECK(readString == cmpString); @@ -69,7 +69,7 @@ TEST_CASE("Command Executor", "[cmd-exec]") { // Test more complex command result = cmdExecutor.load("ping -c 1 localhost", false, false); REQUIRE(cmdExecutor.getCurrentState() == CommandExecutor::States::COMMAND_LOADED); - REQUIRE(cmdExecutor.execute() == HasReturnvaluesIF::RETURN_OK); + REQUIRE(cmdExecutor.execute() == returnvalue::OK); REQUIRE(cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING); limitIdx = 0; while (result != CommandExecutor::EXECUTION_FINISHED) { @@ -110,11 +110,11 @@ TEST_CASE("Command Executor", "[cmd-exec]") { // Now check failing command result = cmdExecutor.load("false", false, false); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); result = cmdExecutor.execute(); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); while (result != CommandExecutor::EXECUTION_FINISHED and - result != HasReturnvaluesIF::RETURN_FAILED) { + result != returnvalue::FAILED) { limitIdx++; result = cmdExecutor.check(bytesHaveBeenRead); REQUIRE(result != CommandExecutor::COMMAND_ERROR); @@ -122,7 +122,7 @@ TEST_CASE("Command Executor", "[cmd-exec]") { usleep(500); REQUIRE(limitIdx < 500); } - REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED); + REQUIRE(result == returnvalue::FAILED); REQUIRE(cmdExecutor.getLastError() == 1); } diff --git a/unittests/internalerror/TestInternalErrorReporter.cpp b/unittests/internalerror/TestInternalErrorReporter.cpp index b61a6203..a23658c0 100644 --- a/unittests/internalerror/TestInternalErrorReporter.cpp +++ b/unittests/internalerror/TestInternalErrorReporter.cpp @@ -38,7 +38,7 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") { CommandMessage message; ActionMessage::setCompletionReply(&message, 10, true); auto result = hkQueue->sendMessage(testQueue->getId(), &message); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); uint32_t queueHits = 0; uint32_t lostTm = 0; uint32_t storeHits = 0; @@ -49,7 +49,7 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") { { CommandMessage hkMessage; result = hkQueue->receiveMessage(&hkMessage); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(hkMessage.getCommand() == HousekeepingMessage::UPDATE_SNAPSHOT_SET); store_address_t storeAddress; gp_id_t gpid = @@ -59,12 +59,12 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") { InternalErrorDataset dataset(objects::INTERNAL_ERROR_REPORTER); CCSDSTime::CDS_short time; ConstAccessorPair data = ipcStore->getData(storeAddress); - REQUIRE(data.first == HasReturnvaluesIF::RETURN_OK); + REQUIRE(data.first == returnvalue::OK); HousekeepingSnapshot hkSnapshot(&time, &dataset); const uint8_t* buffer = data.second.data(); size_t size = data.second.size(); result = hkSnapshot.deSerialize(&buffer, &size, SerializeIF::Endianness::MACHINE); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); // Remember the amount of queueHits before to see the increase queueHits = dataset.queueHits.value; lostTm = dataset.tmHits.value; @@ -78,7 +78,7 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") { internalErrorReporter->performOperation(0); CommandMessage hkMessage; result = hkQueue->receiveMessage(&hkMessage); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(hkMessage.getCommand() == HousekeepingMessage::UPDATE_SNAPSHOT_SET); store_address_t storeAddress; gp_id_t gpid = @@ -86,7 +86,7 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") { REQUIRE(gpid.objectId == objects::INTERNAL_ERROR_REPORTER); ConstAccessorPair data = ipcStore->getData(storeAddress); - REQUIRE(data.first == HasReturnvaluesIF::RETURN_OK); + REQUIRE(data.first == returnvalue::OK); CCSDSTime::CDS_short time; // We need the object ID of the reporter here (NO_OBJECT) InternalErrorDataset dataset(objects::INTERNAL_ERROR_REPORTER); @@ -94,7 +94,7 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") { const uint8_t* buffer = data.second.data(); size_t size = data.second.size(); result = hkSnapshot.deSerialize(&buffer, &size, SerializeIF::Endianness::MACHINE); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); // Test that we had one more queueHit REQUIRE(dataset.queueHits.value == (queueHits + 1)); REQUIRE(dataset.tmHits.value == (lostTm + 1)); @@ -111,7 +111,7 @@ TEST_CASE("Internal Error Reporter", "[TestInternalError]") { sid_t sid(objects::INTERNAL_ERROR_REPORTER, InternalErrorDataset::ERROR_SET_ID); HousekeepingMessage::setToggleReportingCommand(&message, sid, true, false); result = hkQueue->sendMessage(id, &message); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); internalErrorReporter->performOperation(0); } } diff --git a/unittests/mocks/MessageQueueMockBase.h b/unittests/mocks/MessageQueueMockBase.h index d3323186..22f66a54 100644 --- a/unittests/mocks/MessageQueueMockBase.h +++ b/unittests/mocks/MessageQueueMockBase.h @@ -48,9 +48,9 @@ class MessageQueueMockBase : public MessageQueueBase { std::memcpy(message->getBuffer(), messagesSentQueue.front().getBuffer(), message->getMessageSize()); messagesSentQueue.pop(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } - virtual ReturnValue_t flush(uint32_t* count) { return HasReturnvaluesIF::RETURN_OK; } + virtual ReturnValue_t flush(uint32_t* count) { return returnvalue::OK; } virtual ReturnValue_t sendMessageFrom(MessageQueueId_t sendTo, MessageQueueMessageIF* message, MessageQueueId_t sentFrom, bool ignoreFault = false) override { @@ -58,7 +58,7 @@ class MessageQueueMockBase : public MessageQueueBase { messageSentCounter++; MessageQueueMessage& messageRef = *(dynamic_cast(message)); messagesSentQueue.push(messageRef); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } virtual ReturnValue_t reply(MessageQueueMessageIF* message) override { diff --git a/unittests/mocks/PeriodicTaskIFMock.h b/unittests/mocks/PeriodicTaskIFMock.h index dc0ccefc..7fbcfee1 100644 --- a/unittests/mocks/PeriodicTaskIFMock.h +++ b/unittests/mocks/PeriodicTaskIFMock.h @@ -16,10 +16,10 @@ class PeriodicTaskMock : public PeriodicTaskBase { */ virtual ReturnValue_t startTask() override { initObjsAfterTaskCreation(); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; }; - virtual ReturnValue_t sleepFor(uint32_t ms) override { return HasReturnvaluesIF::RETURN_OK; }; + virtual ReturnValue_t sleepFor(uint32_t ms) override { return returnvalue::OK; }; }; #endif // FSFW_UNITTEST_TESTS_MOCKS_PERIODICTASKMOCK_H_ diff --git a/unittests/mocks/PowerSwitcherMock.cpp b/unittests/mocks/PowerSwitcherMock.cpp index 5c6935e4..b1506f6e 100644 --- a/unittests/mocks/PowerSwitcherMock.cpp +++ b/unittests/mocks/PowerSwitcherMock.cpp @@ -16,7 +16,7 @@ ReturnValue_t PowerSwitcherMock::sendSwitchCommand(power::Switch_t switchNr, Ret info.timesCalledOff++; } } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t PowerSwitcherMock::sendFuseOnCommand(uint8_t fuseNr) { @@ -26,7 +26,7 @@ ReturnValue_t PowerSwitcherMock::sendFuseOnCommand(uint8_t fuseNr) { FuseInfo& info = fuseMap.at(fuseNr); info.timesCalled++; } - return RETURN_OK; + return returnvalue::OK; } ReturnValue_t PowerSwitcherMock::getSwitchState(power::Switch_t switchNr) const { @@ -35,7 +35,7 @@ ReturnValue_t PowerSwitcherMock::getSwitchState(power::Switch_t switchNr) const SWITCH_REQUEST_UPDATE_VALUE++; return info.currentState; } - return RETURN_FAILED; + return returnvalue::FAILED; } ReturnValue_t PowerSwitcherMock::getFuseState(uint8_t fuseNr) const { @@ -44,7 +44,7 @@ ReturnValue_t PowerSwitcherMock::getFuseState(uint8_t fuseNr) const { } else { return FUSE_OFF; } - return RETURN_FAILED; + return returnvalue::FAILED; } uint32_t PowerSwitcherMock::getSwitchDelayMs(void) const { return 5000; } diff --git a/unittests/osal/TestClock.cpp b/unittests/osal/TestClock.cpp index 9979b28c..5d198db1 100644 --- a/unittests/osal/TestClock.cpp +++ b/unittests/osal/TestClock.cpp @@ -11,13 +11,13 @@ TEST_CASE("OSAL::Clock Test", "[OSAL::Clock Test]") { SECTION("Test getClock") { timeval time; ReturnValue_t result = Clock::getClock_timeval(&time); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); Clock::TimeOfDay_t timeOfDay; result = Clock::getDateAndTime(&timeOfDay); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); timeval timeOfDayAsTimeval; result = Clock::convertTimeOfDayToTimeval(&timeOfDay, &timeOfDayAsTimeval); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); // We require timeOfDayAsTimeval to be larger than time as it // was request a few ns later double difference = timevalOperations::toDouble(timeOfDayAsTimeval - time); @@ -27,28 +27,28 @@ TEST_CASE("OSAL::Clock Test", "[OSAL::Clock Test]") { // Conversion in the other direction Clock::TimeOfDay_t timevalAsTimeOfDay; result = Clock::convertTimevalToTimeOfDay(&time, &timevalAsTimeOfDay); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); CHECK(timevalAsTimeOfDay.year <= timeOfDay.year); // TODO We should write TimeOfDay operators! } SECTION("Leap seconds") { uint16_t leapSeconds = 0; ReturnValue_t result = Clock::getLeapSeconds(&leapSeconds); - REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED); + REQUIRE(result == returnvalue::FAILED); REQUIRE(leapSeconds == 0); result = Clock::setLeapSeconds(18); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); result = Clock::getLeapSeconds(&leapSeconds); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(leapSeconds == 18); } SECTION("usec Test") { timeval timeAsTimeval; ReturnValue_t result = Clock::getClock_timeval(&timeAsTimeval); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); uint64_t timeAsUsec = 0; result = Clock::getClock_usecs(&timeAsUsec); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); double timeAsUsecDouble = static_cast(timeAsUsec) / 1000000.0; timeval timeAsUsecTimeval = timevalOperations::toTimeval(timeAsUsecDouble); double difference = timevalOperations::toDouble(timeAsUsecTimeval - timeAsTimeval); @@ -66,7 +66,7 @@ TEST_CASE("OSAL::Clock Test", "[OSAL::Clock Test]") { time.tv_sec = 1648208539; time.tv_usec = 0; ReturnValue_t result = Clock::convertTimevalToJD2000(time, &j2000); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); double correctJ2000 = 2459663.98772 - 2451545.0; CHECK(j2000 == Catch::Approx(correctJ2000).margin(1.2 * 1e-8)); } @@ -76,9 +76,9 @@ TEST_CASE("OSAL::Clock Test", "[OSAL::Clock Test]") { utcTime.tv_usec = 999000; timeval tt; ReturnValue_t result = Clock::setLeapSeconds(27); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); result = Clock::convertUTCToTT(utcTime, &tt); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); CHECK(tt.tv_usec == 183000); // The plus 1 is a own forced overflow of usecs CHECK(tt.tv_sec == (1648208539 + 27 + 10 + 32 + 1)); diff --git a/unittests/osal/TestMessageQueue.cpp b/unittests/osal/TestMessageQueue.cpp index b1792a9c..dbab553f 100644 --- a/unittests/osal/TestMessageQueue.cpp +++ b/unittests/osal/TestMessageQueue.cpp @@ -19,17 +19,17 @@ TEST_CASE("MessageQueue Basic Test", "[TestMq]") { SECTION("Simple Tests") { auto result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); MessageQueueMessage recvMessage; result = testReceiverMq->receiveMessage(&recvMessage); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(recvMessage.getData()[0] == 42); result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); MessageQueueId_t senderId = 0; result = testReceiverMq->receiveMessage(&recvMessage, &senderId); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(recvMessage.getData()[0] == 42); CHECK(senderId == testSenderMqId); senderId = testReceiverMq->getLastPartner(); @@ -37,7 +37,7 @@ TEST_CASE("MessageQueue Basic Test", "[TestMq]") { } SECTION("Test Full") { auto result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); REQUIRE(result == MessageQueueIF::FULL); // We try another message @@ -45,12 +45,12 @@ TEST_CASE("MessageQueue Basic Test", "[TestMq]") { REQUIRE(result == MessageQueueIF::FULL); MessageQueueMessage recvMessage; result = testReceiverMq->receiveMessage(&recvMessage); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(recvMessage.getData()[0] == 42); result = testSenderMq->sendMessage(testReceiverMqId, &testMessage); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = testReceiverMq->receiveMessage(&recvMessage); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(recvMessage.getData()[0] == 42); } // We have to clear MQs ourself ATM diff --git a/unittests/power/testPowerSwitcher.cpp b/unittests/power/testPowerSwitcher.cpp index f6a24583..222dccf6 100644 --- a/unittests/power/testPowerSwitcher.cpp +++ b/unittests/power/testPowerSwitcher.cpp @@ -30,7 +30,7 @@ TEST_CASE("Power Switcher", "[power-switcher]") { REQUIRE(switchInfo.timesCalledOn == 1); REQUIRE(not switcher.active()); REQUIRE(mock.getAmountSwitchStatWasRequested() == 2); - REQUIRE(switcher.checkSwitchState() == HasReturnvaluesIF::RETURN_OK); + REQUIRE(switcher.checkSwitchState() == returnvalue::OK); REQUIRE(mock.getAmountSwitchStatWasRequested() == 3); switcher.turnOff(false); REQUIRE(mock.getAmountSwitchStatWasRequested() == 3); diff --git a/unittests/serialize/testSerialBufferAdapter.cpp b/unittests/serialize/testSerialBufferAdapter.cpp index 56b16975..e5ea379e 100644 --- a/unittests/serialize/testSerialBufferAdapter.cpp +++ b/unittests/serialize/testSerialBufferAdapter.cpp @@ -102,7 +102,7 @@ TEST_CASE("Serial Buffer Adapter", "[single-file]") { size_t size = 6; auto result = tv_serial_buffer_adapter3.deSerialize(const_cast(&arrayPtr), &size, SerializeIF::Endianness::MACHINE); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(test_recv_array[0] == 1); CHECK(test_recv_array[1] == 1); CHECK(test_recv_array[2] == 1); diff --git a/unittests/serialize/testSerialLinkedPacket.cpp b/unittests/serialize/testSerialLinkedPacket.cpp index 0af5d2a1..30024248 100644 --- a/unittests/serialize/testSerialLinkedPacket.cpp +++ b/unittests/serialize/testSerialLinkedPacket.cpp @@ -40,7 +40,7 @@ TEST_CASE("Serial Linked Packet", "[SerLinkPacket]") { // Deserialize big endian packet by setting bigEndian to true. ReturnValue_t result = testClass.deSerialize(&readOnlyPointer, &packetLen, SerializeIF::Endianness::BIG); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(testClass.getHeader() == 42); // Equivalent check. // CHECK(testClass.getBuffer()[0] == 1); @@ -59,7 +59,7 @@ TEST_CASE("Serial Linked Packet", "[SerLinkPacket]") { // serialize for ground: bigEndian = true. ReturnValue_t result = testClass.serialize(&packetPointer, &serializedSize, packetMaxSize, SerializeIF::Endianness::BIG); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); // Result should be big endian now. CHECK(packet[3] == 42); CHECK(packet[4] == 1); diff --git a/unittests/serialize/testSerializeIF.cpp b/unittests/serialize/testSerializeIF.cpp index 7aafe98f..99878eb6 100644 --- a/unittests/serialize/testSerializeIF.cpp +++ b/unittests/serialize/testSerializeIF.cpp @@ -14,7 +14,7 @@ TEST_CASE("Serialize IF Serialize", "[serialize-if-ser]") { SECTION("Little Endian Normal") { REQUIRE(simpleSer.serialize(&ptr, &len, buf.size(), SerializeIF::Endianness::LITTLE) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); CHECK(buf[0] == 1); CHECK(buf[1] == 3); CHECK(buf[2] == 2); @@ -27,7 +27,7 @@ TEST_CASE("Serialize IF Serialize", "[serialize-if-ser]") { size_t serLen = 0xff; REQUIRE(simpleSer.SerializeIF::serialize(buf.data(), serLen, buf.size(), SerializeIF::Endianness::LITTLE) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); CHECK(buf[0] == 1); CHECK(buf[1] == 3); CHECK(buf[2] == 2); @@ -37,14 +37,14 @@ TEST_CASE("Serialize IF Serialize", "[serialize-if-ser]") { SECTION("Big Endian Normal") { SECTION("Explicit") { REQUIRE(simpleSer.serialize(&ptr, &len, buf.size(), SerializeIF::Endianness::BIG) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } SECTION("Network 0") { REQUIRE(simpleSer.serialize(&ptr, &len, buf.size(), SerializeIF::Endianness::NETWORK) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } SECTION("Network 1") { - REQUIRE(simpleSer.serializeBe(&ptr, &len, buf.size()) == HasReturnvaluesIF::RETURN_OK); + REQUIRE(simpleSer.serializeBe(&ptr, &len, buf.size()) == returnvalue::OK); } CHECK(buf[0] == 1); @@ -60,16 +60,16 @@ TEST_CASE("Serialize IF Serialize", "[serialize-if-ser]") { SECTION("Explicit") { REQUIRE(simpleSer.SerializeIF::serialize(buf.data(), serLen, buf.size(), SerializeIF::Endianness::BIG) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } SECTION("Network 0") { REQUIRE(simpleSer.SerializeIF::serialize(buf.data(), serLen, buf.size(), SerializeIF::Endianness::NETWORK) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } SECTION("Network 1") { REQUIRE(simpleSer.SerializeIF::serializeBe(buf.data(), serLen, buf.size()) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } CHECK(buf[0] == 1); CHECK(buf[1] == 2); @@ -86,7 +86,7 @@ TEST_CASE("SerializeIF Deserialize", "[serialize-if-de]") { SECTION("Little Endian Normal") { REQUIRE(simpleSer.deSerialize(&ptr, &len, SerializeIF::Endianness::LITTLE) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); CHECK(simpleSer.getU8() == 5); CHECK(simpleSer.getU16() == 0x0100); CHECK(ptr == buf.data() + 3); @@ -97,7 +97,7 @@ TEST_CASE("SerializeIF Deserialize", "[serialize-if-de]") { size_t deserLen = 0xff; REQUIRE( simpleSer.SerializeIF::deSerialize(ptr, deserLen, len, SerializeIF::Endianness::LITTLE) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); CHECK(simpleSer.getU8() == 5); CHECK(simpleSer.getU16() == 0x0100); CHECK(deserLen == 3); @@ -106,14 +106,14 @@ TEST_CASE("SerializeIF Deserialize", "[serialize-if-de]") { SECTION("Big Endian Normal") { SECTION("Explicit") { REQUIRE(simpleSer.deSerialize(&ptr, &len, SerializeIF::Endianness::BIG) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } SECTION("Network 0") { REQUIRE(simpleSer.deSerialize(&ptr, &len, SerializeIF::Endianness::NETWORK) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } SECTION("Network 1") { - REQUIRE(simpleSer.SerializeIF::deSerializeBe(&ptr, &len) == HasReturnvaluesIF::RETURN_OK); + REQUIRE(simpleSer.SerializeIF::deSerializeBe(&ptr, &len) == returnvalue::OK); } CHECK(simpleSer.getU8() == 5); CHECK(simpleSer.getU16() == 1); @@ -126,16 +126,16 @@ TEST_CASE("SerializeIF Deserialize", "[serialize-if-de]") { SECTION("Explicit") { REQUIRE(simpleSer.SerializeIF::deSerialize(buf.data(), deserLen, buf.size(), SerializeIF::Endianness::BIG) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } SECTION("Network 0") { REQUIRE(simpleSer.SerializeIF::deSerialize(buf.data(), deserLen, buf.size(), SerializeIF::Endianness::NETWORK) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } SECTION("Network 1") { REQUIRE(simpleSer.SerializeIF::deSerializeBe(buf.data(), deserLen, buf.size()) == - HasReturnvaluesIF::RETURN_OK); + returnvalue::OK); } CHECK(simpleSer.getU8() == 5); CHECK(simpleSer.getU16() == 1); diff --git a/unittests/storagemanager/TestNewAccessor.cpp b/unittests/storagemanager/TestNewAccessor.cpp index 311ba44d..c2c1dafd 100644 --- a/unittests/storagemanager/TestNewAccessor.cpp +++ b/unittests/storagemanager/TestNewAccessor.cpp @@ -12,7 +12,7 @@ TEST_CASE("New Accessor", "[NewAccessor]") { std::array testDataArray; std::array receptionArray; store_address_t testStoreId; - ReturnValue_t result = result::FAILED; + ReturnValue_t result = returnvalue::FAILED; for (size_t i = 0; i < testDataArray.size(); i++) { testDataArray[i] = i; @@ -21,9 +21,9 @@ TEST_CASE("New Accessor", "[NewAccessor]") { SECTION("Simple tests getter functions") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); auto resultPair = SimplePool.getData(testStoreId); - REQUIRE(resultPair.first == result::OK); + REQUIRE(resultPair.first == returnvalue::OK); resultPair.second.getDataCopy(receptionArray.data(), 20); CHECK(resultPair.second.getId() == testStoreId); CHECK(resultPair.second.size() == 10); @@ -39,18 +39,18 @@ TEST_CASE("New Accessor", "[NewAccessor]") { { auto resultPairLoc = SimplePool.getData(testStoreId); - REQUIRE(resultPairLoc.first == result::OK); + REQUIRE(resultPairLoc.first == returnvalue::OK); // data should be deleted when accessor goes out of scope. } resultPair = SimplePool.getData(testStoreId); REQUIRE(resultPair.first == (int)StorageManagerIF::DATA_DOES_NOT_EXIST); result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); { ConstStorageAccessor constAccessor(testStoreId); result = SimplePool.getData(testStoreId, constAccessor); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); constAccessor.getDataCopy(receptionArray.data(), 20); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -63,12 +63,12 @@ TEST_CASE("New Accessor", "[NewAccessor]") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); { resultPair = SimplePool.getData(testStoreId); - REQUIRE(resultPair.first == result::OK); + REQUIRE(resultPair.first == returnvalue::OK); resultPair.second.release(); // now data should not be deleted anymore } resultPair = SimplePool.getData(testStoreId); - REQUIRE(resultPair.first == result::OK); + REQUIRE(resultPair.first == returnvalue::OK); resultPair.second.getDataCopy(receptionArray.data(), 20); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -77,11 +77,11 @@ TEST_CASE("New Accessor", "[NewAccessor]") { SECTION("Simple tests modify functions") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); { StorageAccessor accessor(testStoreId); result = SimplePool.modifyData(testStoreId, accessor); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(accessor.getId() == testStoreId); CHECK(accessor.size() == 10); accessor.getDataCopy(receptionArray.data(), 20); @@ -98,10 +98,10 @@ TEST_CASE("New Accessor", "[NewAccessor]") { REQUIRE(resultPair.first == (int)StorageManagerIF::DATA_DOES_NOT_EXIST); result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); { auto resultPairLoc = SimplePool.modifyData(testStoreId); - REQUIRE(resultPairLoc.first == result::OK); + REQUIRE(resultPairLoc.first == returnvalue::OK); CHECK(resultPairLoc.second.getId() == testStoreId); CHECK(resultPairLoc.second.size() == 10); resultPairLoc.second.getDataCopy(receptionArray.data(), 20); @@ -117,22 +117,22 @@ TEST_CASE("New Accessor", "[NewAccessor]") { // data should not be deleted when accessor goes out of scope } resultPair = SimplePool.getData(testStoreId); - REQUIRE(resultPair.first == result::OK); + REQUIRE(resultPair.first == returnvalue::OK); } SECTION("Write tests") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); { auto resultPair = SimplePool.modifyData(testStoreId); - REQUIRE(resultPair.first == result::OK); + REQUIRE(resultPair.first == returnvalue::OK); testDataArray[9] = 42; resultPair.second.write(testDataArray.data(), 10, 0); // now data should not be deleted resultPair.second.release(); } auto resultConstPair = SimplePool.getData(testStoreId); - REQUIRE(resultConstPair.first == result::OK); + REQUIRE(resultConstPair.first == returnvalue::OK); resultConstPair.second.getDataCopy(receptionArray.data(), 10); for (size_t i = 0; i < size - 1; i++) { @@ -141,15 +141,15 @@ TEST_CASE("New Accessor", "[NewAccessor]") { CHECK(receptionArray[9] == 42); auto resultPair = SimplePool.modifyData(testStoreId); - REQUIRE(resultPair.first == result::OK); + REQUIRE(resultPair.first == returnvalue::OK); result = resultPair.second.write(testDataArray.data(), 20, 0); - REQUIRE(result == result::FAILED); + REQUIRE(result == returnvalue::FAILED); result = resultPair.second.write(testDataArray.data(), 10, 5); - REQUIRE(result == result::FAILED); + REQUIRE(result == returnvalue::FAILED); std::memset(testDataArray.data(), 42, 5); result = resultPair.second.write(testDataArray.data(), 5, 5); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); resultConstPair = SimplePool.getData(testStoreId); resultPair.second.getDataCopy(receptionArray.data(), 20); for (size_t i = 5; i < 10; i++) { @@ -159,7 +159,7 @@ TEST_CASE("New Accessor", "[NewAccessor]") { SECTION("Operators") { result = SimplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); { StorageAccessor accessor(testStoreId); StorageAccessor accessor2(0); @@ -168,19 +168,19 @@ TEST_CASE("New Accessor", "[NewAccessor]") { std::array data; size_t size = 6; result = accessor.write(data.data(), data.size()); - REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED); + REQUIRE(result == returnvalue::FAILED); result = SimplePool.modifyData(testStoreId, accessor2); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); CHECK(accessor2.getId() == testStoreId); CHECK(accessor2.size() == 10); std::array newData; - // Expect data to be invalid so this must return RETURN_FAILED + // Expect data to be invalid so this must return returnvalue::FAILED result = accessor.getDataCopy(newData.data(), newData.size()); - REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED); + REQUIRE(result == returnvalue::FAILED); // Expect data to be too small result = accessor2.getDataCopy(data.data(), data.size()); - REQUIRE(result == HasReturnvaluesIF::RETURN_FAILED); + REQUIRE(result == returnvalue::FAILED); } } } diff --git a/unittests/storagemanager/TestPool.cpp b/unittests/storagemanager/TestPool.cpp index f3c4f330..6bffa5de 100644 --- a/unittests/storagemanager/TestPool.cpp +++ b/unittests/storagemanager/TestPool.cpp @@ -13,7 +13,7 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { std::array testDataArray; std::array receptionArray; store_address_t testStoreId; - ReturnValue_t result = result::FAILED; + ReturnValue_t result = returnvalue::FAILED; uint8_t* pointer = nullptr; const uint8_t* constPointer = nullptr; @@ -24,9 +24,9 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { SECTION("Basic tests") { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = simplePool.getData(testStoreId, &constPointer, &size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); memcpy(receptionArray.data(), constPointer, size); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -34,12 +34,12 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { memset(receptionArray.data(), 0, size); result = simplePool.modifyData(testStoreId, &pointer, &size); memcpy(receptionArray.data(), pointer, size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); } result = simplePool.deleteData(testStoreId); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = simplePool.addData(&testStoreId, testDataArray.data(), 15); CHECK(result == (int)StorageManagerIF::DATA_TOO_LARGE); } @@ -47,12 +47,12 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { SECTION("Reservation Tests ") { pointer = nullptr; result = simplePool.getFreeElement(&testStoreId, size, &pointer); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); memcpy(pointer, testDataArray.data(), size); constPointer = nullptr; result = simplePool.getData(testStoreId, &constPointer, &size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); memcpy(receptionArray.data(), constPointer, size); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -61,21 +61,21 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { SECTION("Add, delete, add, add when full") { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = simplePool.getData(testStoreId, &constPointer, &size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); memcpy(receptionArray.data(), constPointer, size); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); } result = simplePool.deleteData(testStoreId); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = simplePool.getData(testStoreId, &constPointer, &size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); memcpy(receptionArray.data(), constPointer, size); for (size_t i = 0; i < size; i++) { CHECK(receptionArray[i] == i); @@ -102,20 +102,20 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") { SECTION("Initialize and clear store, delete with pointer") { result = simplePool.initialize(); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); simplePool.clearStore(); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); result = simplePool.modifyData(testStoreId, &pointer, &size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); store_address_t newId; result = simplePool.deleteData(pointer, size, &testStoreId); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); REQUIRE(testStoreId.raw != (uint32_t)StorageManagerIF::INVALID_ADDRESS); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); } } @@ -141,7 +141,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { std::array testDataArray; std::array receptionArray; store_address_t testStoreId; - ReturnValue_t result = result::FAILED; + ReturnValue_t result = returnvalue::FAILED; for (size_t i = 0; i < testDataArray.size(); i++) { testDataArray[i] = i; } @@ -150,20 +150,20 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { SECTION("Basic tests") { size = 8; result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); // Should be on second page of the pool now for 8 bytes CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == 0); size = 15; result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); // Should be on third page of the pool now for 15 bytes CHECK(testStoreId.poolIndex == 2); CHECK(testStoreId.packetIndex == 0); result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); // Should be on third page of the pool now for 15 bytes CHECK(testStoreId.poolIndex == 2); CHECK(testStoreId.packetIndex == 1); @@ -174,7 +174,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { size = 8; result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); // Should still work CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == 1); @@ -182,7 +182,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { // fill the rest of the pool for (uint8_t idx = 2; idx < 5; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == idx); } @@ -203,21 +203,21 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { size = 5; for (uint8_t idx = 0; idx < 10; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(testStoreId.poolIndex == 0); CHECK(testStoreId.packetIndex == idx); } size = 10; for (uint8_t idx = 0; idx < 5; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == idx); } size = 20; for (uint8_t idx = 0; idx < 2; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(testStoreId.poolIndex == 2); CHECK(testStoreId.packetIndex == idx); } @@ -244,7 +244,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { size = 5; for (uint8_t idx = 0; idx < 10; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(testStoreId.poolIndex == 0); CHECK(testStoreId.packetIndex == idx); } @@ -261,7 +261,7 @@ TEST_CASE("Local Pool Extended Tests [3 Pools]", "[TestPool2]") { size = 10; for (uint8_t idx = 0; idx < 5; idx++) { result = simplePool.addData(&testStoreId, testDataArray.data(), size); - REQUIRE(result == result::OK); + REQUIRE(result == returnvalue::OK); CHECK(testStoreId.poolIndex == 1); CHECK(testStoreId.packetIndex == idx); } diff --git a/unittests/testcfg/pollingsequence/PollingSequenceFactory.cpp b/unittests/testcfg/pollingsequence/PollingSequenceFactory.cpp index 0c44f6a2..9559cca9 100644 --- a/unittests/testcfg/pollingsequence/PollingSequenceFactory.cpp +++ b/unittests/testcfg/pollingsequence/PollingSequenceFactory.cpp @@ -17,14 +17,14 @@ ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) thisSequence->addSlot(objects::TEST_DEVICE, 0.6 * length, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::TEST_DEVICE, 0.8 * length, DeviceHandlerIF::GET_READ); - if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { - return HasReturnvaluesIF::RETURN_OK; + if (thisSequence->checkSequence() == returnvalue::OK) { + return returnvalue::OK; } else { #if FSFW_CPP_OSTREAM_ENABLED sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" << std::endl; #else sif::printError("pst::pollingSequenceInitDefault: Sequence invalid!"); #endif - return HasReturnvaluesIF::RETURN_FAILED; + return returnvalue::FAILED; } } diff --git a/unittests/timemanager/TestCCSDSTime.cpp b/unittests/timemanager/TestCCSDSTime.cpp index 9c457dda..0b1b602c 100644 --- a/unittests/timemanager/TestCCSDSTime.cpp +++ b/unittests/timemanager/TestCCSDSTime.cpp @@ -20,7 +20,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { time.usecond = 123456; SECTION("Test CCS Time") { auto result = CCSDSTime::convertToCcsds(&cssMilliSecconds, &time); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(cssMilliSecconds.pField == 0x52); // 0b01010010 REQUIRE(cssMilliSecconds.yearMSB == 0x07); REQUIRE(cssMilliSecconds.yearLSB == 0xe4); @@ -36,7 +36,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { const uint8_t* dataPtr = reinterpret_cast(&cssMilliSecconds); size_t length = sizeof(CCSDSTime::Ccs_mseconds); result = CCSDSTime::convertFromCCS(&timeTo, dataPtr, &length, sizeof(CCSDSTime::Ccs_mseconds)); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(cssMilliSecconds.pField == 0x52); // 0b01010010 REQUIRE(cssMilliSecconds.yearMSB == 0x07); REQUIRE(cssMilliSecconds.yearLSB == 0xe4); @@ -59,7 +59,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { size_t length = ccsDayOfYear.size(); auto result = CCSDSTime::convertFromCCS(&timeTo, ccsDayOfYear.data(), &length, ccsDayOfYear.size()); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); // Check constness REQUIRE(ccsDayOfYear[0] == 0b01011000); REQUIRE(ccsDayOfYear[1] == 0x07); @@ -82,7 +82,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { Clock::TimeOfDay_t timeTo; const uint8_t* timeChar = reinterpret_cast(timeAscii.c_str()); auto result = CCSDSTime::convertFromASCII(&timeTo, timeChar, timeAscii.length()); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(timeTo.year == 2022); REQUIRE(timeTo.month == 12); REQUIRE(timeTo.day == 31); @@ -95,7 +95,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { const uint8_t* timeChar2 = reinterpret_cast(timeAscii2.c_str()); Clock::TimeOfDay_t timeTo2; result = CCSDSTime::convertFromCcsds(&timeTo2, timeChar2, timeAscii2.length()); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(timeTo2.year == 2022); REQUIRE(timeTo2.month == 12); REQUIRE(timeTo2.day == 31); @@ -117,14 +117,14 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { time.usecond = 123456; timeval timeAsTimeval; auto result = Clock::convertTimeOfDayToTimeval(&time, &timeAsTimeval); - CHECK(result == HasReturnvaluesIF::RETURN_OK); + CHECK(result == returnvalue::OK); CHECK(timeAsTimeval.tv_sec == 1582982685); CHECK(timeAsTimeval.tv_usec == 123456); // Conversion to CDS Short CCSDSTime::CDS_short cdsTime; result = CCSDSTime::convertToCcsds(&cdsTime, &timeAsTimeval); - CHECK(result == HasReturnvaluesIF::RETURN_OK); + CHECK(result == returnvalue::OK); // Days in CCSDS Epoch 22704 (0x58B0) CHECK(cdsTime.dayMSB == 0x58); CHECK(cdsTime.dayLSB == 0xB0); @@ -138,7 +138,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { // Conversion back to timeval timeval timeReturnAsTimeval; result = CCSDSTime::convertFromCDS(&timeReturnAsTimeval, &cdsTime); - CHECK(result == HasReturnvaluesIF::RETURN_OK); + CHECK(result == returnvalue::OK); // micro seconds precision is lost timeval difference = timeAsTimeval - timeReturnAsTimeval; CHECK(difference.tv_usec == 456); @@ -146,7 +146,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { Clock::TimeOfDay_t timeReturnAsTimeOfDay; result = CCSDSTime::convertFromCDS(&timeReturnAsTimeOfDay, &cdsTime); - CHECK(result == HasReturnvaluesIF::RETURN_OK); + CHECK(result == returnvalue::OK); CHECK(timeReturnAsTimeOfDay.year == 2020); CHECK(timeReturnAsTimeOfDay.month == 2); CHECK(timeReturnAsTimeOfDay.day == 29); @@ -159,7 +159,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { Clock::TimeOfDay_t timeReturnAsTodFromBuffer; const uint8_t* buffer = reinterpret_cast(&cdsTime); result = CCSDSTime::convertFromCDS(&timeReturnAsTodFromBuffer, buffer, sizeof(cdsTime)); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); CHECK(timeReturnAsTodFromBuffer.year == time.year); CHECK(timeReturnAsTodFromBuffer.month == time.month); CHECK(timeReturnAsTodFromBuffer.day == time.day); @@ -170,7 +170,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { Clock::TimeOfDay_t todFromCCSDS; result = CCSDSTime::convertFromCcsds(&todFromCCSDS, buffer, sizeof(cdsTime)); - CHECK(result == HasReturnvaluesIF::RETURN_OK); + CHECK(result == returnvalue::OK); CHECK(todFromCCSDS.year == time.year); CHECK(todFromCCSDS.month == time.month); CHECK(todFromCCSDS.day == time.day); @@ -189,7 +189,7 @@ TEST_CASE("CCSDSTime Tests", "[TestCCSDSTime]") { CCSDSTime::P_FIELD_CUC_6B_CCSDS, 0x77, 0x1E, 0x96, 0x0F, 0x91, 0x27}; size_t foundLength = 0; auto result = CCSDSTime::convertFromCUC(&to, cucBuffer.data(), &foundLength, cucBuffer.size()); - REQUIRE(result == HasReturnvaluesIF::RETURN_OK); + REQUIRE(result == returnvalue::OK); REQUIRE(foundLength == 7); REQUIRE(to.tv_sec == 1619801999); // TAI (no leap seconds) REQUIRE(to.tv_usec == 567001); diff --git a/unittests/timemanager/TestCountdown.cpp b/unittests/timemanager/TestCountdown.cpp index d0af659d..67f4ddb2 100644 --- a/unittests/timemanager/TestCountdown.cpp +++ b/unittests/timemanager/TestCountdown.cpp @@ -8,9 +8,9 @@ TEST_CASE("Countdown Tests", "[TestCountdown]") { INFO("Countdown Tests"); Countdown count(20); REQUIRE(count.timeout == 20); - REQUIRE(count.setTimeout(100) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(count.setTimeout(100) == static_cast(returnvalue::OK)); REQUIRE(count.timeout == 100); - REQUIRE(count.setTimeout(150) == static_cast(HasReturnvaluesIF::RETURN_OK)); + REQUIRE(count.setTimeout(150) == static_cast(returnvalue::OK)); REQUIRE(count.isBusy()); REQUIRE(not count.hasTimedOut()); uint32_t number = count.getRemainingMillis(); From 4224c3d00924ad1555e9fa299153c87f88d1c63a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 15 Aug 2022 20:29:23 +0200 Subject: [PATCH 05/10] bump changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f83c5078..67361a9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). # [unreleased] +## Changes + +- Removed `HasReturnvaluesIF` class in favor of `returnvalue` namespace with `OK` and `FAILED` + constants. + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/659 + # [v5.0.0] 25.07.2022 ## Changes From 7f9269b3871af38bd0eedaf247cbe2336b95d730 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 15 Aug 2022 20:30:59 +0200 Subject: [PATCH 06/10] fix for def cfg --- .../fsfwconfig/pollingsequence/PollingSequenceFactory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp b/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp index c8baaf34..81b927dd 100644 --- a/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp +++ b/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp @@ -11,15 +11,15 @@ ReturnValue_t pst::pollingSequenceInitDefault( /* Add polling sequence table here */ - if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { - return HasReturnvaluesIF::RETURN_OK; + if (thisSequence->checkSequence() == returnvalue::OK) { + return returnvalue::OK; } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" << std::endl; #endif - return HasReturnvaluesIF::returnvalue::FAILED; + return returnvalue::FAILED; } } From fc34d562398c1bb5db9c3fae3487340e30e528bf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 16 Aug 2022 01:12:50 +0200 Subject: [PATCH 07/10] cicd fix --- unittests/util/testUnsignedByteField.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unittests/util/testUnsignedByteField.cpp b/unittests/util/testUnsignedByteField.cpp index 9a67c092..e6d91ab9 100644 --- a/unittests/util/testUnsignedByteField.cpp +++ b/unittests/util/testUnsignedByteField.cpp @@ -28,28 +28,28 @@ TEST_CASE("Unsigned Byte Field", "[unsigned-byte-field]") { } SECTION("Serialize U32") { - CHECK(testByteField.serializeBe(buf.data(), serLen, buf.size()) == HasReturnvaluesIF::RETURN_OK); + CHECK(testByteField.serializeBe(buf.data(), serLen, buf.size()) == returnvalue::OK); CHECK(serLen == 4); CHECK(buf[0] == 0); CHECK(buf[3] == 10); } SECTION("Serialize U32 Concrete") { - CHECK(u32ByteField.serializeBe(buf.data(), serLen, buf.size()) == HasReturnvaluesIF::RETURN_OK); + CHECK(u32ByteField.serializeBe(buf.data(), serLen, buf.size()) == returnvalue::OK); CHECK(serLen == 4); CHECK(buf[0] == 0); CHECK(buf[3] == 10); } SECTION("Serialize U16 Concrete") { - CHECK(u16ByteField.serializeBe(buf.data(), serLen, buf.size()) == HasReturnvaluesIF::RETURN_OK); + CHECK(u16ByteField.serializeBe(buf.data(), serLen, buf.size()) == returnvalue::OK); CHECK(serLen == 2); CHECK(buf[0] == 0); CHECK(buf[1] == 5); } SECTION("Serialize U8 Concrete") { - CHECK(u8ByteField.serializeBe(buf.data(), serLen, buf.size()) == HasReturnvaluesIF::RETURN_OK); + CHECK(u8ByteField.serializeBe(buf.data(), serLen, buf.size()) == returnvalue::OK); CHECK(serLen == 1); CHECK(buf[0] == 2); } @@ -60,7 +60,7 @@ TEST_CASE("Unsigned Byte Field", "[unsigned-byte-field]") { buf[2] = 0x30; buf[3] = 0x20; size_t deserLen = 0; - CHECK(testByteField.deSerializeBe(buf.data(), deserLen, buf.size()) == HasReturnvaluesIF::RETURN_OK); + CHECK(testByteField.deSerializeBe(buf.data(), deserLen, buf.size()) == returnvalue::OK); CHECK(testByteField.getValue() == 0x50403020); } @@ -68,7 +68,7 @@ TEST_CASE("Unsigned Byte Field", "[unsigned-byte-field]") { buf[0] = 0x50; buf[1] = 0x40; size_t deserLen = 0; - CHECK(u16ByteField.deSerializeBe(buf.data(), deserLen, buf.size()) == HasReturnvaluesIF::RETURN_OK); + CHECK(u16ByteField.deSerializeBe(buf.data(), deserLen, buf.size()) == returnvalue::OK); CHECK(u16ByteField.getValue() == 0x5040); } } \ No newline at end of file From f63f3fa5645bbdec8bd5dfd7823c9bfd0df784cb Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 16 Aug 2022 12:12:21 +0200 Subject: [PATCH 08/10] more occurences in comments --- CHANGELOG.md | 2 +- docs/README-localpools.md | 4 +-- docs/devicehandlers.rst | 12 +++---- docs/localpools.rst | 4 +-- src/fsfw/action/ActionHelper.h | 6 ++-- src/fsfw/action/HasActionsIF.h | 2 +- src/fsfw/cfdp/pdu/HeaderDeserializer.h | 2 +- src/fsfw/cfdp/tlv/Tlv.h | 4 +-- src/fsfw/container/ArrayList.h | 2 +- src/fsfw/container/FIFOBase.h | 8 ++--- src/fsfw/container/FixedOrderedMultimap.h | 12 +++---- src/fsfw/container/PlacementFactory.h | 2 +- src/fsfw/container/SimpleRingBuffer.h | 4 +-- src/fsfw/datalinklayer/DataLinkLayer.h | 12 +++---- src/fsfw/datalinklayer/Farm1StateOpen.h | 2 +- src/fsfw/datalinklayer/MapPacketExtraction.h | 4 +-- .../datalinklayer/VirtualChannelReception.h | 6 ++-- .../datalinklayer/VirtualChannelReceptionIF.h | 4 +-- src/fsfw/datapool/PoolDataSetBase.h | 8 ++--- src/fsfw/devicehandlers/AssemblyBase.h | 2 +- .../devicehandlers/DeviceCommunicationIF.h | 10 +++--- src/fsfw/devicehandlers/DeviceHandlerBase.h | 36 +++++++++---------- src/fsfw/globalfunctions/DleEncoder.h | 4 +-- src/fsfw/health/HealthHelper.h | 4 +-- src/fsfw/ipc/MessageQueueIF.h | 12 +++---- src/fsfw/objectmanager/ObjectManagerIF.h | 4 +-- src/fsfw/objectmanager/SystemObjectIF.h | 4 +-- src/fsfw/osal/freertos/BinSemaphUsingTask.h | 6 ++-- src/fsfw/osal/freertos/BinarySemaphore.h | 10 +++--- .../osal/freertos/CountingSemaphUsingTask.h | 10 +++--- src/fsfw/osal/linux/BinarySemaphore.h | 4 +-- src/fsfw/parameters/ParameterWrapper.h | 2 +- src/fsfw/pus/Service11TelecommandScheduling.h | 14 ++++---- src/fsfw/returnvalues/HasReturnvaluesIF.h | 2 +- src/fsfw/rmap/RMAPChannelIF.h | 4 +-- src/fsfw/rmap/RmapDeviceCommunicationIF.h | 10 +++--- src/fsfw/serialize/SerializeAdapter.h | 8 ++--- src/fsfw/serialize/SerializeIF.h | 4 +-- src/fsfw/storagemanager/LocalPool.h | 6 ++-- src/fsfw/storagemanager/StorageManagerIF.h | 10 +++--- src/fsfw/subsystem/SubsystemBase.cpp | 6 ++-- src/fsfw/subsystem/SubsystemBase.h | 2 +- src/fsfw/tasks/FixedSlotSequence.cpp | 2 +- src/fsfw/tasks/PeriodicTaskIF.h | 4 +-- src/fsfw/tasks/SemaphoreIF.h | 4 +-- src/fsfw/tcdistribution/CCSDSDistributorIF.h | 4 +-- src/fsfw/tcdistribution/CFDPDistributor.cpp | 6 ++-- src/fsfw/tcdistribution/CFDPDistributorIF.h | 2 +- src/fsfw/tcdistribution/PUSDistributorIF.h | 2 +- src/fsfw/tcdistribution/TcDistributor.h | 4 +-- src/fsfw/tcdistribution/TcPacketCheckIF.h | 2 +- src/fsfw/timemanager/CCSDSTime.h | 10 +++--- src/fsfw/timemanager/Clock.h | 26 +++++++------- src/fsfw/tmstorage/TmStoreFrontendIF.h | 2 +- .../tmtcpacket/RedirectableDataPointerIF.h | 2 +- src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.h | 2 +- .../tmtcpacket/pus/tc/TcPacketStoredBase.h | 2 +- src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h | 2 +- .../tmtcservices/CommandingServiceBase.cpp | 2 +- src/fsfw/tmtcservices/CommandingServiceBase.h | 10 +++--- src/fsfw/tmtcservices/PusServiceBase.h | 6 ++-- src/fsfw/tmtcservices/SpacePacketParser.h | 4 +-- src/fsfw/tmtcservices/TmTcBridge.h | 4 +-- src/fsfw_hal/common/gpio/GpioIF.h | 2 +- src/fsfw_hal/linux/CommandExecutor.h | 6 ++-- src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h | 2 +- src/fsfw_hal/linux/i2c/I2cComIF.h | 2 +- .../integration/assemblies/TestAssembly.h | 2 +- 68 files changed, 195 insertions(+), 195 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22699114..1c78318c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - HAL Devicehandlers: Periodic printout is run-time configurable now - `oneShotAction` flag in the `TestTask` class is not static anymore - `SimpleRingBuffer::writeData` now checks if the amount is larger than the total size of the - Buffer and rejects such writeData calls with `HasReturnvaluesIF::RETURN_FAILED` + Buffer and rejects such writeData calls with `returnvalue::FAILED` PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/586 - Major update for version handling, using `git describe` to fetch version information with git. PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/601 diff --git a/docs/README-localpools.md b/docs/README-localpools.md index 2ee75189..1770efb9 100644 --- a/docs/README-localpools.md +++ b/docs/README-localpools.md @@ -144,7 +144,7 @@ ReturnValue_t GyroHandler::initializeLocalDataPool(localpool::DataPool &localDat new PoolEntry({0})); poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ``` @@ -154,7 +154,7 @@ in any case: ```cpp PoolReadGuard readHelper(&gyroData); -if(readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) { +if(readHelper.getReadResult() == returnvalue::OK) { if(not gyroData.isValid()) { gyroData.setValidity(true, true); } diff --git a/docs/devicehandlers.rst b/docs/devicehandlers.rst index 0008edb3..9c6929e8 100644 --- a/docs/devicehandlers.rst +++ b/docs/devicehandlers.rst @@ -75,11 +75,11 @@ and the respective source file with sensible default return values: void TestDeviceHandler::doShutDown() {} ReturnValue_t TestDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } void TestDeviceHandler::fillCommandAndReplyMap() {} @@ -87,17 +87,17 @@ and the respective source file with sensible default return values: ReturnValue_t TestDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, size_t commandDataLen) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } uint32_t TestDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { @@ -106,5 +106,5 @@ and the respective source file with sensible default return values: ReturnValue_t TestDeviceHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } diff --git a/docs/localpools.rst b/docs/localpools.rst index d2afd0a0..f7e1ca47 100644 --- a/docs/localpools.rst +++ b/docs/localpools.rst @@ -150,7 +150,7 @@ with a housekeeping service command. new PoolEntry({0})); poolManager.subscribeForPeriodicPacket(gyroData.getSid(), false, 4.0, false); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } Now, if we receive some sensor data and converted them into the right format, @@ -160,7 +160,7 @@ in any case: .. code-block:: cpp PoolReadGuard readHelper(&gyroData); - if(readHelper.getReadResult() == HasReturnvaluesIF::RETURN_OK) { + if(readHelper.getReadResult() == returnvalue::OK) { if(not gyroData.isValid()) { gyroData.setValidity(true, true); } diff --git a/src/fsfw/action/ActionHelper.h b/src/fsfw/action/ActionHelper.h index 16abb212..4bcecbae 100644 --- a/src/fsfw/action/ActionHelper.h +++ b/src/fsfw/action/ActionHelper.h @@ -45,7 +45,7 @@ class ActionHelper { * helper function * @param queueToUse_ Pointer to the messageQueue to be used, optional * if queue was set in constructor - * @return Returns RETURN_OK if successful + * @return Returns returnvalue::OK if successful */ ReturnValue_t initialize(MessageQueueIF* queueToUse_ = nullptr); /** @@ -75,7 +75,7 @@ class ActionHelper { * message to * @param replyId ID of the executed command * @param data Pointer to the data - * @return Returns RETURN_OK if successful, otherwise failure code + * @return Returns returnvalue::OK if successful, otherwise failure code */ ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, SerializeIF* data, bool hideSender = false); @@ -86,7 +86,7 @@ class ActionHelper { * message to * @param replyId ID of the executed command * @param data Pointer to the data - * @return Returns RETURN_OK if successful, otherwise failure code + * @return Returns returnvalue::OK if successful, otherwise failure code */ ReturnValue_t reportData(MessageQueueId_t reportTo, ActionId_t replyId, const uint8_t* data, size_t dataSize, bool hideSender = false); diff --git a/src/fsfw/action/HasActionsIF.h b/src/fsfw/action/HasActionsIF.h index 89e58add..45247d1a 100644 --- a/src/fsfw/action/HasActionsIF.h +++ b/src/fsfw/action/HasActionsIF.h @@ -53,7 +53,7 @@ class HasActionsIF { * * @return * -@c EXECUTION_FINISHED Finish reply will be generated - * -@c Not RETURN_OK Step failure reply will be generated + * -@c Not returnvalue::OK Step failure reply will be generated */ virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) = 0; diff --git a/src/fsfw/cfdp/pdu/HeaderDeserializer.h b/src/fsfw/cfdp/pdu/HeaderDeserializer.h index 70a7908c..4c237117 100644 --- a/src/fsfw/cfdp/pdu/HeaderDeserializer.h +++ b/src/fsfw/cfdp/pdu/HeaderDeserializer.h @@ -36,7 +36,7 @@ class HeaderDeserializer : public RedirectableDataPointerIF, public PduHeaderIF /** * This needs to be called before accessing the PDU fields to avoid segmentation faults. * @return - * - RETURN_OK on parse success + * - returnvalue::OK on parse success * - returnvalue::FAILED Invalid raw data * - SerializeIF::BUFFER_TOO_SHORT if buffer is shorter than expected */ diff --git a/src/fsfw/cfdp/tlv/Tlv.h b/src/fsfw/cfdp/tlv/Tlv.h index a67c6dd1..dded5652 100644 --- a/src/fsfw/cfdp/tlv/Tlv.h +++ b/src/fsfw/cfdp/tlv/Tlv.h @@ -23,7 +23,7 @@ class Tlv : public TlvIF { * @param maxSize * @param streamEndianness * @return - * - RETURN_OK on success + * - returnvalue::OK on success * - INVALID_TLV_TYPE * - SerializeIF returncode on wrong serialization parameters */ @@ -37,7 +37,7 @@ class Tlv : public TlvIF { * @param buffer Raw buffer including the size field * @param size * @param streamEndianness - * - RETURN_OK on success + * - returnvalue::OK on success * - INVALID_TLV_TYPE * - SerializeIF returncode on wrong deserialization parameters */ diff --git a/src/fsfw/container/ArrayList.h b/src/fsfw/container/ArrayList.h index 522ddf3b..608e7e55 100644 --- a/src/fsfw/container/ArrayList.h +++ b/src/fsfw/container/ArrayList.h @@ -183,7 +183,7 @@ class ArrayList { * @param entry * @return * -@c FULL if the List is full - * -@c RETURN_OK else + * -@c returnvalue::OK else */ ReturnValue_t insert(T entry) { if (size >= maxSize_) { diff --git a/src/fsfw/container/FIFOBase.h b/src/fsfw/container/FIFOBase.h index 25c75515..7c51bc39 100644 --- a/src/fsfw/container/FIFOBase.h +++ b/src/fsfw/container/FIFOBase.h @@ -20,24 +20,24 @@ class FIFOBase { /** * Insert value into FIFO * @param value - * @return RETURN_OK on success, FULL if full + * @return returnvalue::OK on success, FULL if full */ ReturnValue_t insert(T value); /** * Retrieve item from FIFO. This removes the item from the FIFO. * @param value Must point to a valid T - * @return RETURN_OK on success, EMPTY if empty and FAILED if nullptr check failed + * @return returnvalue::OK on success, EMPTY if empty and FAILED if nullptr check failed */ ReturnValue_t retrieve(T* value); /** * Retrieve item from FIFO without removing it from FIFO. * @param value Must point to a valid T - * @return RETURN_OK on success, EMPTY if empty and FAILED if nullptr check failed + * @return returnvalue::OK on success, EMPTY if empty and FAILED if nullptr check failed */ ReturnValue_t peek(T* value); /** * Remove item from FIFO. - * @return RETURN_OK on success, EMPTY if empty + * @return returnvalue::OK on success, EMPTY if empty */ ReturnValue_t pop(); diff --git a/src/fsfw/container/FixedOrderedMultimap.h b/src/fsfw/container/FixedOrderedMultimap.h index f402d622..73b010ed 100644 --- a/src/fsfw/container/FixedOrderedMultimap.h +++ b/src/fsfw/container/FixedOrderedMultimap.h @@ -100,7 +100,7 @@ class FixedOrderedMultimap { * @param[in] value Value of the new element * @param[in/out] (optional) storedValue On success this points to the new value, otherwise a * nullptr - * @return RETURN_OK if insert was successful, MAP_FULL if no space is available + * @return returnvalue::OK if insert was successful, MAP_FULL if no space is available */ ReturnValue_t insert(key_t key, T value, Iterator* storedValue = nullptr); @@ -108,14 +108,14 @@ class FixedOrderedMultimap { * Used to insert new pair instead of single values * * @param pair Pair to be inserted - * @return RETURN_OK if insert was successful, MAP_FULL if no space is available + * @return returnvalue::OK if insert was successful, MAP_FULL if no space is available */ ReturnValue_t insert(std::pair pair); /*** * Can be used to check if a certain key is in the map * @param key Key to be checked - * @return RETURN_OK if the key exists KEY_DOES_NOT_EXIST otherwise + * @return returnvalue::OK if the key exists KEY_DOES_NOT_EXIST otherwise */ ReturnValue_t exists(key_t key) const; @@ -127,14 +127,14 @@ class FixedOrderedMultimap { * * @warning The iterator needs to be valid and dereferenceable * @param[in/out] iter Pointer to iterator to the element that needs to be ereased - * @return RETURN_OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this + * @return returnvalue::OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this */ ReturnValue_t erase(Iterator* iter); /*** * Used to erase by key * @param key Key to be erased - * @return RETURN_OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this + * @return returnvalue::OK if erased, KEY_DOES_NOT_EXIST if the there is no element like this */ ReturnValue_t erase(key_t key); @@ -160,7 +160,7 @@ class FixedOrderedMultimap { * * @param key Key to search for * @param value Found value - * @return RETURN_OK if it points to the value, + * @return returnvalue::OK if it points to the value, * KEY_DOES_NOT_EXIST if the key is not in the map */ ReturnValue_t find(key_t key, T** value) const; diff --git a/src/fsfw/container/PlacementFactory.h b/src/fsfw/container/PlacementFactory.h index e59fc134..668e71b8 100644 --- a/src/fsfw/container/PlacementFactory.h +++ b/src/fsfw/container/PlacementFactory.h @@ -51,7 +51,7 @@ class PlacementFactory { * This must be called by the user. * * @param thisElement Element to be destroyed - * @return RETURN_OK if the element was destroyed, different errors on failure + * @return returnvalue::OK if the element was destroyed, different errors on failure */ template ReturnValue_t destroy(T* thisElement) { diff --git a/src/fsfw/container/SimpleRingBuffer.h b/src/fsfw/container/SimpleRingBuffer.h index 7495e31c..a9892c0c 100644 --- a/src/fsfw/container/SimpleRingBuffer.h +++ b/src/fsfw/container/SimpleRingBuffer.h @@ -47,7 +47,7 @@ class SimpleRingBuffer : public RingBufferBase<> { * Write to circular buffer and increment write pointer by amount. * @param data * @param amount - * @return -@c RETURN_OK if write operation was successful + * @return -@c returnvalue::OK if write operation was successful * -@c returnvalue::FAILED if */ ReturnValue_t writeData(const uint8_t* data, size_t amount); @@ -95,7 +95,7 @@ class SimpleRingBuffer : public RingBufferBase<> { * If readRemaining was set to true, the true amount read will be assigned * to the passed value. * @return - * - @c RETURN_OK if data was read successfully + * - @c returnvalue::OK if data was read successfully * - @c returnvalue::FAILED if not enough data was available and readRemaining * was set to false. */ diff --git a/src/fsfw/datalinklayer/DataLinkLayer.h b/src/fsfw/datalinklayer/DataLinkLayer.h index 64d33016..64d2f96b 100644 --- a/src/fsfw/datalinklayer/DataLinkLayer.h +++ b/src/fsfw/datalinklayer/DataLinkLayer.h @@ -51,7 +51,7 @@ class DataLinkLayer : public CCSDSReturnValuesIF { * This method tries to process a frame that is placed in #frameBuffer. * The procedures described in the Standard are performed. * @param length Length of the incoming frame candidate. - * @return @c RETURN_OK on successful handling, otherwise the return codes of the higher + * @return @c returnvalue::OK on successful handling, otherwise the return codes of the higher * methods. */ ReturnValue_t processFrame(uint16_t length); @@ -61,12 +61,12 @@ class DataLinkLayer : public CCSDSReturnValuesIF { * handle Frames directed to this VC. * @param virtualChannelId Id of the VC. Shall be smaller than 64. * @param object Reference to the object that handles the Frame. - * @return @c RETURN_OK on success, @c returnvalue::FAILED otherwise. + * @return @c returnvalue::OK on success, @c returnvalue::FAILED otherwise. */ ReturnValue_t addVirtualChannel(uint8_t virtualChannelId, VirtualChannelReceptionIF* object); /** * The initialization method calls the @c initialize routine of all virtual channels. - * @return The return code of the first failed VC initialization or @c RETURN_OK. + * @return The return code of the first failed VC initialization or @c returnvalue::OK. */ ReturnValue_t initialize(); @@ -91,19 +91,19 @@ class DataLinkLayer : public CCSDSReturnValuesIF { virtualChannels; //!< Map of all virtual channels assigned. /** * Method that performs all possible frame validity checks (as specified). - * @return Various error codes or @c RETURN_OK on success. + * @return Various error codes or @c returnvalue::OK on success. */ ReturnValue_t frameValidationCheck(); /** * First method to call. * Removes start sequence bytes and checks if the complete frame was received. * SHOULDDO: Maybe handling the start sequence must be done more variable. - * @return @c RETURN_OK or @c TOO_SHORT. + * @return @c returnvalue::OK or @c TOO_SHORT. */ ReturnValue_t frameDelimitingAndFillRemoval(); /** * Small helper method to check the CRC of the Frame. - * @return @c RETURN_OK or @c CRC_FAILED. + * @return @c returnvalue::OK or @c CRC_FAILED. */ ReturnValue_t frameCheckCRC(); /** diff --git a/src/fsfw/datalinklayer/Farm1StateOpen.h b/src/fsfw/datalinklayer/Farm1StateOpen.h index 0bca931d..f0a8ad40 100644 --- a/src/fsfw/datalinklayer/Farm1StateOpen.h +++ b/src/fsfw/datalinklayer/Farm1StateOpen.h @@ -37,7 +37,7 @@ class Farm1StateOpen : public Farm1StateIF { * change to Farm1StateLockout. * @param frame The frame to handle. * @param clcw Any changes to the CLCW shall be done with the help of this interface. - * @return If the Sequence Number is ok, it returns #RETURN_OK. Otherwise either #NS_POSITIVE_W, + * @return If the Sequence Number is ok, it returns returnvalue::OK. Otherwise either #NS_POSITIVE_W, * #NS_NEGATIVE_W or NS_LOCKOUT is returned. */ ReturnValue_t handleADFrame(TcTransferFrame* frame, ClcwIF* clcw); diff --git a/src/fsfw/datalinklayer/MapPacketExtraction.h b/src/fsfw/datalinklayer/MapPacketExtraction.h index 54faaf04..6586722c 100644 --- a/src/fsfw/datalinklayer/MapPacketExtraction.h +++ b/src/fsfw/datalinklayer/MapPacketExtraction.h @@ -36,7 +36,7 @@ class MapPacketExtraction : public MapPacketExtractionIF { * Method that is called if the segmentation flag is @c NO_SEGMENTATION. * The method extracts one or more packets within the frame and forwards them to the OBSW. * @param frame The TC Transfer Frame to work on. - * @return @c RETURN_OK if all Packets were extracted. If something is entirely wrong, + * @return @c returnvalue::OK if all Packets were extracted. If something is entirely wrong, * @c DATA_CORRUPTED is returned, if some bytes are left over @c RESIDUAL_DATA. */ ReturnValue_t unpackBlockingPackets(TcTransferFrame* frame); @@ -63,7 +63,7 @@ class MapPacketExtraction : public MapPacketExtractionIF { ReturnValue_t extractPackets(TcTransferFrame* frame); /** * The #packetStore and the default destination of #tcQueue are initialized here. - * @return @c RETURN_OK on success, @c returnvalue::FAILED otherwise. + * @return @c returnvalue::OK on success, @c returnvalue::FAILED otherwise. */ ReturnValue_t initialize(); /** diff --git a/src/fsfw/datalinklayer/VirtualChannelReception.h b/src/fsfw/datalinklayer/VirtualChannelReception.h index d425123a..88ec6886 100644 --- a/src/fsfw/datalinklayer/VirtualChannelReception.h +++ b/src/fsfw/datalinklayer/VirtualChannelReception.h @@ -77,7 +77,7 @@ class VirtualChannelReception : public VirtualChannelReceptionIF, public CCSDSRe * required. * @param frame The Tc Transfer Frame to handle. * @param clcw Any changes on the CLCW shall be done with this method. - * @return Always returns @c RETURN_OK. + * @return Always returns @c returnvalue::OK. */ ReturnValue_t handleBDFrame(TcTransferFrame* frame, ClcwIF* clcw); /** @@ -102,13 +102,13 @@ class VirtualChannelReception : public VirtualChannelReceptionIF, public CCSDSRe * Helper method to simplify adding a mapChannel during construction. * @param mapId The mapId of the object to add. * @param object Pointer to the MapPacketExtraction object itself. - * @return @c RETURN_OK if the channel was successfully inserted, @c returnvalue::FAILED otherwise. + * @return @c returnvalue::OK if the channel was successfully inserted, @c returnvalue::FAILED otherwise. */ ReturnValue_t addMapChannel(uint8_t mapId, MapPacketExtractionIF* object); /** * The initialization routine checks the set #slidingWindowWidth and initializes all MAP * channels. - * @return @c RETURN_OK on successful initialization, @c returnvalue::FAILED otherwise. + * @return @c returnvalue::OK on successful initialization, @c returnvalue::FAILED otherwise. */ ReturnValue_t initialize(); /** diff --git a/src/fsfw/datalinklayer/VirtualChannelReceptionIF.h b/src/fsfw/datalinklayer/VirtualChannelReceptionIF.h index 3426f21c..8874909b 100644 --- a/src/fsfw/datalinklayer/VirtualChannelReceptionIF.h +++ b/src/fsfw/datalinklayer/VirtualChannelReceptionIF.h @@ -33,13 +33,13 @@ class VirtualChannelReceptionIF { * Handling the Frame includes forwarding to higher-level procedures. * @param frame The Tc Transfer Frame that was received and checked. * @param clcw Any changes to the CLCW value are forwarded by using this parameter. - * @return The return Value shall indicate successful processing with @c RETURN_OK. + * @return The return Value shall indicate successful processing with @c returnvalue::OK. */ virtual ReturnValue_t frameAcceptanceAndReportingMechanism(TcTransferFrame* frame, ClcwIF* clcw) = 0; /** * If any other System Objects are required for operation they shall be initialized here. - * @return @c RETURN_OK for successful initialization. + * @return @c returnvalue::OK for successful initialization. */ virtual ReturnValue_t initialize() = 0; /** diff --git a/src/fsfw/datapool/PoolDataSetBase.h b/src/fsfw/datapool/PoolDataSetBase.h index 79a1095b..3e7e30c5 100644 --- a/src/fsfw/datapool/PoolDataSetBase.h +++ b/src/fsfw/datapool/PoolDataSetBase.h @@ -58,7 +58,7 @@ class PoolDataSetBase : public PoolDataSetIF, public SerializeIF { * freed afterwards. It is mandatory to call commit after a read call, * even if the read operation is not successful! * @return - * - @c RETURN_OK if all variables were read successfully. + * - @c returnvalue::OK if all variables were read successfully. * - @c INVALID_PARAMETER_DEFINITION if a pool entry does not exist or there * is a type conflict. * - @c SET_WAS_ALREADY_READ if read() is called twice without calling @@ -80,7 +80,7 @@ class PoolDataSetBase : public PoolDataSetIF, public SerializeIF { * commit() can only be called after read(). If the set only contains * variables which are write only, commit() can be called without a * preceding read() call. Every read call must be followed by a commit call! - * @return - @c RETURN_OK if all variables were read successfully. + * @return - @c returnvalue::OK if all variables were read successfully. * - @c COMMITING_WITHOUT_READING if set was not read yet and * contains non write-only variables */ @@ -97,7 +97,7 @@ class PoolDataSetBase : public PoolDataSetIF, public SerializeIF { /** * Provides the means to lock the underlying data structure to ensure * thread-safety. Default implementation is empty - * @return Always returns -@c RETURN_OK + * @return Always returns -@c returnvalue::OK */ virtual ReturnValue_t lockDataPool( MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING, @@ -105,7 +105,7 @@ class PoolDataSetBase : public PoolDataSetIF, public SerializeIF { /** * Provides the means to unlock the underlying data structure to ensure * thread-safety. Default implementation is empty - * @return Always returns -@c RETURN_OK + * @return Always returns -@c returnvalue::OK */ virtual ReturnValue_t unlockDataPool() override; diff --git a/src/fsfw/devicehandlers/AssemblyBase.h b/src/fsfw/devicehandlers/AssemblyBase.h index 92feb6ae..ec0847f1 100644 --- a/src/fsfw/devicehandlers/AssemblyBase.h +++ b/src/fsfw/devicehandlers/AssemblyBase.h @@ -53,7 +53,7 @@ class AssemblyBase : public SubsystemBase { * @param mode * @param submode * @return - * - @c RETURN_OK if ok + * - @c returnvalue::OK if ok * - @c NEED_SECOND_STEP if children need to be commanded again */ virtual ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) = 0; diff --git a/src/fsfw/devicehandlers/DeviceCommunicationIF.h b/src/fsfw/devicehandlers/DeviceCommunicationIF.h index 5af3f3f0..cf00a8e2 100644 --- a/src/fsfw/devicehandlers/DeviceCommunicationIF.h +++ b/src/fsfw/devicehandlers/DeviceCommunicationIF.h @@ -61,7 +61,7 @@ class DeviceCommunicationIF { * initialization. * @param cookie * @return - * - @c RETURN_OK if initialization was successfull + * - @c returnvalue::OK if initialization was successfull * - Everything else triggers failure event with returnvalue as parameter 1 */ virtual ReturnValue_t initializeInterface(CookieIF *cookie) = 0; @@ -74,7 +74,7 @@ class DeviceCommunicationIF { * @param data * @param len If this is 0, nothing shall be sent. * @return - * - @c RETURN_OK for successfull send + * - @c returnvalue::OK for successfull send * - Everything else triggers failure event with returnvalue as parameter 1 */ virtual ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t *sendData, size_t sendLen) = 0; @@ -84,7 +84,7 @@ class DeviceCommunicationIF { * Get send confirmation that the data in sendMessage() was sent successfully. * @param cookie * @return - * - @c RETURN_OK if data was sent successfully but a reply is expected + * - @c returnvalue::OK if data was sent successfully but a reply is expected * - NO_REPLY_EXPECTED if data was sent successfully and no reply is expected * - Everything else to indicate failure */ @@ -99,7 +99,7 @@ class DeviceCommunicationIF { * * @param cookie * @param requestLen Size of data to read - * @return - @c RETURN_OK to confirm the request for data has been sent. + * @return - @c returnvalue::OK to confirm the request for data has been sent. * - Everything else triggers failure event with * returnvalue as parameter 1 */ @@ -113,7 +113,7 @@ class DeviceCommunicationIF { * @param buffer [out] Set reply here (by using *buffer = ...) * @param size [out] size pointer to set (by using *size = ...). * Set to 0 if no reply was received - * @return - @c RETURN_OK for successfull receive + * @return - @c returnvalue::OK for successfull receive * - @c NO_REPLY_RECEIVED if not reply was received. Setting size to * 0 has the same effect * - Everything else triggers failure event with diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.h b/src/fsfw/devicehandlers/DeviceHandlerBase.h index 35a33eab..a37a4740 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -144,7 +144,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * 4. Decrements counter for timeout of replies by calling * decrementDeviceReplyMap() * 5. Performs FDIR check for failures - * 6. If the device mode is MODE_OFF, return RETURN_OK. + * 6. If the device mode is MODE_OFF, return returnvalue::OK. * Otherwise, perform the Action property and performs depending * on value specified by input value counter (incremented in PST). * The child class tells base class what to do by setting this value. @@ -160,7 +160,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * - GET_READ: Access requested reading data by calling doGetRead() * which calls readReceivedMessage of #communicationInterface * @param counter Specifies which Action to perform - * @return RETURN_OK for successful execution + * @return returnvalue::OK for successful execution */ virtual ReturnValue_t performOperation(uint8_t counter) override; @@ -281,7 +281,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * * @param[out] id the device command id that has been built * @return - * - @c RETURN_OK to send command after setting #rawPacket and + * - @c returnvalue::OK to send command after setting #rawPacket and * #rawPacketLen. * - @c NOTHING_TO_SEND when no command is to be sent. * - Anything else triggers an even with the returnvalue as a parameter. @@ -305,7 +305,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * * @param[out] id the device command id built * @return - * - @c RETURN_OK when a command is to be sent + * - @c returnvalue::OK when a command is to be sent * - @c NOTHING_TO_SEND when no command is to be sent * - Anything else triggers an even with the returnvalue as a parameter */ @@ -327,7 +327,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param commandData Pointer to the data from the direct command * @param commandDataLen Length of commandData * @return - * - @c RETURN_OK to send command after #rawPacket and #rawPacketLen + * - @c returnvalue::OK to send command after #rawPacket and #rawPacketLen * have been set. * - @c HasActionsIF::EXECUTION_COMPLETE to generate a finish reply immediately. This can * be used if no reply is expected @@ -357,7 +357,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param[out] foundLen length of the data found. Is to be set in function, * buffer is scanned at previous position + foundLen. * @return - * - @c RETURN_OK a valid packet was found at @c start, @c foundLen is valid + * - @c returnvalue::OK a valid packet was found at @c start, @c foundLen is valid * - @c returnvalue::FAILED no reply could be found starting at @c start, * implies @c foundLen is not valid, base class will call scanForReply() * again with ++start @@ -387,7 +387,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param id the id found by scanForReply() * @param packet * @return - * - @c RETURN_OK when the reply was interpreted. + * - @c returnvalue::OK when the reply was interpreted. * - @c IGNORE_REPLY_DATA Ignore the reply and don't reset reply cycle * counter. * - @c returnvalue::FAILED when the reply could not be interpreted, @@ -450,7 +450,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param countdown Instead of using maxDelayCycles to timeout a device reply it is also possible * to provide a pointer to a Countdown object which will signal the timeout * when expired - * @return - @c RETURN_OK when the command was successfully inserted, + * @return - @c returnvalue::OK when the command was successfully inserted, * - @c returnvalue::FAILED else. */ ReturnValue_t insertInCommandAndReplyMap(DeviceCommandId_t deviceCommand, uint16_t maxDelayCycles, @@ -471,7 +471,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param countdown Instead of using maxDelayCycles to timeout a device reply it is also possible * to provide a pointer to a Countdown object which will signal the timeout * when expired - * @return - @c RETURN_OK when the command was successfully inserted, + * @return - @c returnvalue::OK when the command was successfully inserted, * - @c returnvalue::FAILED else. */ ReturnValue_t insertInReplyMap(DeviceCommandId_t deviceCommand, uint16_t maxDelayCycles, @@ -481,7 +481,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, /** * @brief A simple command to add a command to the commandList. * @param deviceCommand The command to add - * @return - @c RETURN_OK when the command was successfully inserted, + * @return - @c returnvalue::OK when the command was successfully inserted, * - @c returnvalue::FAILED else. */ ReturnValue_t insertInCommandMap(DeviceCommandId_t deviceCommand, @@ -518,7 +518,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param periodic Indicates if the command is periodic (i.e. it is sent * by the device repeatedly without request) or not. Default is aperiodic (0). * Warning: The setting always overrides the value that was entered in the map. - * @return - @c RETURN_OK when the command was successfully inserted, + * @return - @c returnvalue::OK when the command was successfully inserted, * - @c returnvalue::FAILED else. */ ReturnValue_t updateReplyMapEntry(DeviceCommandId_t deviceReply, uint16_t delayCycles, @@ -602,7 +602,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param mode * @param submode * @return - * - @c RETURN_OK if valid + * - @c returnvalue::OK if valid * - @c returnvalue::FAILED if invalid */ virtual ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode); @@ -622,7 +622,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param[out] switches pointer to an array of switches * @param[out] numberOfSwitches length of returned array * @return - * - @c RETURN_OK if the parameters were set + * - @c returnvalue::OK if the parameters were set * - @c returnvalue::FAILED if no switches exist */ virtual ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches); @@ -977,7 +977,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * - A failure code may be returned if something went fundamentally wrong. * * @param deviceCommand - * @return - RETURN_OK if a reply was activated. + * @return - returnvalue::OK if a reply was activated. * - NO_REPLY_EXPECTED if there was no reply found. This is not an * error case as many commands do not expect a reply. */ @@ -1004,7 +1004,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, * * @param[out] id the device command id built * @return - * - @c RETURN_OK when a command is to be sent + * - @c returnvalue::OK when a command is to be sent * - not @c NOTHING_TO_SEND when no command is to be sent */ virtual ReturnValue_t buildChildRawCommand(); @@ -1085,7 +1085,7 @@ class DeviceHandlerBase : public DeviceHandlerIF, /** * Checks if current handler state allows reception of external device commands. * Default implementation allows commands only in plain MODE_ON and MODE_NORMAL. - * @return RETURN_OK if commands are accepted, anything else otherwise. + * @return returnvalue::OK if commands are accepted, anything else otherwise. */ virtual ReturnValue_t acceptExternalDeviceCommands(); @@ -1273,9 +1273,9 @@ class DeviceHandlerBase : public DeviceHandlerIF, * @param[out] data * @param[out] len * @return - * - @c RETURN_OK @c data is valid + * - @c returnvalue::OK @c data is valid * - @c returnvalue::FAILED IPCStore is nullptr - * - the return value from the IPCStore if it was not @c RETURN_OK + * - the return value from the IPCStore if it was not @c returnvalue::OK */ ReturnValue_t getStorageData(store_address_t storageAddress, uint8_t **data, size_t *len); diff --git a/src/fsfw/globalfunctions/DleEncoder.h b/src/fsfw/globalfunctions/DleEncoder.h index a18527fb..85656b37 100644 --- a/src/fsfw/globalfunctions/DleEncoder.h +++ b/src/fsfw/globalfunctions/DleEncoder.h @@ -72,7 +72,7 @@ class DleEncoder { * @param addStxEtx Adding STX start marker and ETX end marker can be omitted, * if they are added manually * @return - * - RETURN_OK for successful encoding operation + * - returnvalue::OK for successful encoding operation * - STREAM_TOO_SHORT if the destination stream is too short */ ReturnValue_t encode(const uint8_t *sourceStream, size_t sourceLen, uint8_t *destStream, @@ -87,7 +87,7 @@ class DleEncoder { * @param maxDestStreamlen * @param decodedLen * @return - * - RETURN_OK for successful decode operation + * - returnvalue::OK for successful decode operation * - DECODE_ERROR if the source stream is invalid * - STREAM_TOO_SHORT if the destination stream is too short */ diff --git a/src/fsfw/health/HealthHelper.h b/src/fsfw/health/HealthHelper.h index 0b9a9c78..84985559 100644 --- a/src/fsfw/health/HealthHelper.h +++ b/src/fsfw/health/HealthHelper.h @@ -55,7 +55,7 @@ class HealthHelper { * * @param message * @return - * -@c RETURN_OK if the message was handled + * -@c returnvalue::OK if the message was handled * -@c returnvalue::FAILED if the message could not be handled * (ie it was not a @c HEALTH_SET or @c HEALTH_READ message) */ @@ -88,7 +88,7 @@ class HealthHelper { * @param parentQueue The queue ID of the parent object. * Set to 0 if no parent present * @return - * -@c RETURN_OK if the Health Table was found and the object + * -@c returnvalue::OK if the Health Table was found and the object * could be registered * -@c returnvalue::FAILED else */ diff --git a/src/fsfw/ipc/MessageQueueIF.h b/src/fsfw/ipc/MessageQueueIF.h index 9532b2d6..b229747e 100644 --- a/src/fsfw/ipc/MessageQueueIF.h +++ b/src/fsfw/ipc/MessageQueueIF.h @@ -40,7 +40,7 @@ class MessageQueueIF { * @param message * A pointer to a previously created message, which is sent. * @return - * -@c RETURN_OK if ok + * -@c returnvalue::OK if ok * -@c NO_REPLY_PARTNER Should return NO_REPLY_PARTNER if partner was found. */ virtual ReturnValue_t reply(MessageQueueMessageIF* message) = 0; @@ -69,14 +69,14 @@ class MessageQueueIF { * function returns immediately. * @param message * A pointer to a message in which the received data is stored. - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c MessageQueueIF::EMPTY if queue is empty */ virtual ReturnValue_t receiveMessage(MessageQueueMessageIF* message) = 0; /** * Deletes all pending messages in the queue. * @param count The number of flushed messages. - * @return RETURN_OK on success. + * @return returnvalue::OK on success. */ virtual ReturnValue_t flush(uint32_t* count) = 0; /** @@ -104,7 +104,7 @@ class MessageQueueIF { * @param ignoreFault * If set to true, the internal software fault counter is not incremented * if queue is full (if implemented). - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c MessageQueueIF::FULL if queue is full */ virtual ReturnValue_t sendMessageFrom(MessageQueueId_t sendTo, MessageQueueMessageIF* message, @@ -136,7 +136,7 @@ class MessageQueueIF { * @param sentFrom * The sentFrom information can be set to inject the sender's queue id * into the message. This variable is set to zero by default. - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c MessageQueueIF::FULL if queue is full */ virtual ReturnValue_t sendToDefaultFrom(MessageQueueMessageIF* message, MessageQueueId_t sentFrom, @@ -148,7 +148,7 @@ class MessageQueueIF { * call of the Implementation class and adds its queue id as * "sentFrom" information. * @param message A pointer to a previously created message, which is sent. - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c MessageQueueIF::FULL if queue is full */ virtual ReturnValue_t sendToDefault(MessageQueueMessageIF* message) = 0; diff --git a/src/fsfw/objectmanager/ObjectManagerIF.h b/src/fsfw/objectmanager/ObjectManagerIF.h index 58ee9ab4..eae35319 100644 --- a/src/fsfw/objectmanager/ObjectManagerIF.h +++ b/src/fsfw/objectmanager/ObjectManagerIF.h @@ -48,14 +48,14 @@ class ObjectManagerIF { * @param id The new id to be added to the list. * @param object A pointer to the object to be added. * @return @li INSERTION_FAILED in case the object could not be inserted. - * @li RETURN_OK in case the object was successfully inserted + * @li returnvalue::OK in case the object was successfully inserted */ virtual ReturnValue_t insert(object_id_t id, SystemObjectIF* object) = 0; /** * @brief With this call, an object is removed from the list. * @param id The object id of the object to be removed. * @return @li NOT_FOUND in case the object was not found - * @li RETURN_OK in case the object was successfully removed + * @li returnvalue::OK in case the object was successfully removed */ virtual ReturnValue_t remove(object_id_t id) = 0; virtual void initialize() = 0; diff --git a/src/fsfw/objectmanager/SystemObjectIF.h b/src/fsfw/objectmanager/SystemObjectIF.h index 02f24837..25065662 100644 --- a/src/fsfw/objectmanager/SystemObjectIF.h +++ b/src/fsfw/objectmanager/SystemObjectIF.h @@ -45,7 +45,7 @@ class SystemObjectIF : public EventReportingProxyIF { * which might not have been built yet. * Therefore, a two-step initialization resolves this problem and prevents * circular dependencies of not-fully initialized objects on start up. - * @return - @c RETURN_OK in case the initialization was successful + * @return - @c returnvalue::OK in case the initialization was successful * - @c returnvalue::FAILED otherwise */ virtual ReturnValue_t initialize() = 0; @@ -54,7 +54,7 @@ class SystemObjectIF : public EventReportingProxyIF { * for operation. * Some objects need certain other objects (or a certain number), to be * registered as children. These checks can be done in this method. - * @return - @c RETURN_OK in case the check was successful + * @return - @c returnvalue::OK in case the check was successful * - @c any other code otherwise */ virtual ReturnValue_t checkObjectConnections() = 0; diff --git a/src/fsfw/osal/freertos/BinSemaphUsingTask.h b/src/fsfw/osal/freertos/BinSemaphUsingTask.h index a88863c9..b29ecdc9 100644 --- a/src/fsfw/osal/freertos/BinSemaphUsingTask.h +++ b/src/fsfw/osal/freertos/BinSemaphUsingTask.h @@ -50,7 +50,7 @@ class BinarySemaphoreUsingTask : public SemaphoreIF, public HasReturnvaluesIF { /** * Same as acquire() with timeout in FreeRTOS ticks. * @param timeoutTicks - * @return - @c RETURN_OK on success + * @return - @c returnvalue::OK on success * - @c returnvalue::FAILED on failure */ ReturnValue_t acquireWithTickTimeout(TimeoutType timeoutType = TimeoutType::BLOCKING, @@ -65,7 +65,7 @@ class BinarySemaphoreUsingTask : public SemaphoreIF, public HasReturnvaluesIF { /** * Wrapper function to give back semaphore from handle * @param semaphore - * @return - @c RETURN_OK on success + * @return - @c returnvalue::OK on success * - @c returnvalue::FAILED on failure */ static ReturnValue_t release(TaskHandle_t taskToNotify); @@ -76,7 +76,7 @@ class BinarySemaphoreUsingTask : public SemaphoreIF, public HasReturnvaluesIF { * @param higherPriorityTaskWoken This will be set to pdPASS if a task with * a higher priority was unblocked. A context switch should be requested * from an ISR if this is the case (see TaskManagement functions) - * @return - @c RETURN_OK on success + * @return - @c returnvalue::OK on success * - @c returnvalue::FAILED on failure */ static ReturnValue_t releaseFromISR(TaskHandle_t taskToNotify, diff --git a/src/fsfw/osal/freertos/BinarySemaphore.h b/src/fsfw/osal/freertos/BinarySemaphore.h index e2ca3c9d..d7fbf351 100644 --- a/src/fsfw/osal/freertos/BinarySemaphore.h +++ b/src/fsfw/osal/freertos/BinarySemaphore.h @@ -47,7 +47,7 @@ class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { * for a maximum of #timeoutMs or until the semaphore is given back, * for example by an ISR or another task. * @param timeoutMs - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_TIMEOUT on timeout */ ReturnValue_t acquire(TimeoutType timeoutType = TimeoutType::BLOCKING, @@ -56,7 +56,7 @@ class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { /** * Same as lockBinarySemaphore() with timeout in FreeRTOS ticks. * @param timeoutTicks - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_TIMEOUT on timeout */ ReturnValue_t acquireWithTickTimeout(TimeoutType timeoutType = TimeoutType::BLOCKING, @@ -64,7 +64,7 @@ class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { /** * Release the binary semaphore. - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_NOT_OWNED if the semaphores is * already available. */ @@ -79,7 +79,7 @@ class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { /** * Wrapper function to give back semaphore from handle * @param semaphore - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_NOT_OWNED if the semaphores is * already available. */ @@ -91,7 +91,7 @@ class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { * @param higherPriorityTaskWoken This will be set to pdPASS if a task with * a higher priority was unblocked. A context switch from an ISR should * then be requested (see TaskManagement functions) - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_NOT_OWNED if the semaphores is * already available. */ diff --git a/src/fsfw/osal/freertos/CountingSemaphUsingTask.h b/src/fsfw/osal/freertos/CountingSemaphUsingTask.h index 86b27267..4426f29b 100644 --- a/src/fsfw/osal/freertos/CountingSemaphUsingTask.h +++ b/src/fsfw/osal/freertos/CountingSemaphUsingTask.h @@ -30,7 +30,7 @@ class CountingSemaphoreUsingTask : public SemaphoreIF { * for a maximum of #timeoutMs or until one is given back, * for example by an ISR or another task. * @param timeoutMs - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_TIMEOUT on timeout */ ReturnValue_t acquire(TimeoutType timeoutType = TimeoutType::BLOCKING, @@ -39,7 +39,7 @@ class CountingSemaphoreUsingTask : public SemaphoreIF { /** * Release a semaphore, increasing the number of available counting * semaphores up to the #maxCount value. - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_NOT_OWNED if #maxCount semaphores are * already available. */ @@ -59,7 +59,7 @@ class CountingSemaphoreUsingTask : public SemaphoreIF { /** * Acquire with a timeout value in ticks * @param timeoutTicks - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_TIMEOUT on timeout */ ReturnValue_t acquireWithTickTimeout(TimeoutType timeoutType = TimeoutType::BLOCKING, @@ -74,7 +74,7 @@ class CountingSemaphoreUsingTask : public SemaphoreIF { /** * Release semaphore of task by supplying task handle * @param taskToNotify - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_NOT_OWNED if #maxCount semaphores are * already available. */ @@ -85,7 +85,7 @@ class CountingSemaphoreUsingTask : public SemaphoreIF { * @param higherPriorityTaskWoken This will be set to pdPASS if a task with * a higher priority was unblocked. A context switch should be requested * from an ISR if this is the case (see TaskManagement functions) - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_NOT_OWNED if #maxCount semaphores are * already available. */ diff --git a/src/fsfw/osal/linux/BinarySemaphore.h b/src/fsfw/osal/linux/BinarySemaphore.h index f75618a6..c7289712 100644 --- a/src/fsfw/osal/linux/BinarySemaphore.h +++ b/src/fsfw/osal/linux/BinarySemaphore.h @@ -45,7 +45,7 @@ class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { * for a maximum of #timeoutMs or until the semaphore is given back, * for example by an ISR or another task. * @param timeoutMs - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_TIMEOUT on timeout */ ReturnValue_t acquire(TimeoutType timeoutType = TimeoutType::BLOCKING, @@ -53,7 +53,7 @@ class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { /** * Release the binary semaphore. - * @return -@c RETURN_OK on success + * @return -@c returnvalue::OK on success * -@c SemaphoreIF::SEMAPHORE_NOT_OWNED if the semaphores is * already available. */ diff --git a/src/fsfw/parameters/ParameterWrapper.h b/src/fsfw/parameters/ParameterWrapper.h index 3b04199a..5a8e20a4 100644 --- a/src/fsfw/parameters/ParameterWrapper.h +++ b/src/fsfw/parameters/ParameterWrapper.h @@ -58,7 +58,7 @@ class ParameterWrapper : public SerializeIF { * @param row * @param column * @return - * -@c RETURN_OK if element was retrieved successfully + * -@c returnvalue::OK if element was retrieved successfully * -@c NOT_SET data has not been set yet * -@c DATATYPE_MISSMATCH Invalid supplied type * -@c OUT_OF_BOUNDS Invalid row and/or column. diff --git a/src/fsfw/pus/Service11TelecommandScheduling.h b/src/fsfw/pus/Service11TelecommandScheduling.h index 0fed8bca..35ae59e0 100644 --- a/src/fsfw/pus/Service11TelecommandScheduling.h +++ b/src/fsfw/pus/Service11TelecommandScheduling.h @@ -123,31 +123,31 @@ class Service11TelecommandScheduling final : public PusServiceBase { ReturnValue_t handleResetCommand(); /** * @brief Logic to be performed on an incoming TC[11,4]. - * @return RETURN_OK if successful + * @return returnvalue::OK if successful */ ReturnValue_t doInsertActivity(const uint8_t* data, size_t size); /** * @brief Logic to be performed on an incoming TC[11,5]. - * @return RETURN_OK if successful + * @return returnvalue::OK if successful */ ReturnValue_t doDeleteActivity(const uint8_t* data, size_t size); /** * @brief Logic to be performed on an incoming TC[11,6]. - * @return RETURN_OK if successful + * @return returnvalue::OK if successful */ ReturnValue_t doFilterDeleteActivity(const uint8_t* data, size_t size); /** * @brief Logic to be performed on an incoming TC[11,7]. - * @return RETURN_OK if successful + * @return returnvalue::OK if successful */ ReturnValue_t doTimeshiftActivity(const uint8_t* data, size_t size); /** * @brief Logic to be performed on an incoming TC[11,8]. - * @return RETURN_OK if successful + * @return returnvalue::OK if successful */ ReturnValue_t doFilterTimeshiftActivity(const uint8_t* data, size_t size); @@ -167,7 +167,7 @@ class Service11TelecommandScheduling final : public PusServiceBase { * @param data Pointer to first byte described data * @param dataSize Remaining size of data NOTE: non-const, this is modified by the function * @param [out] requestId Request ID - * @return RETURN_OK if successful + * @return returnvalue::OK if successful */ ReturnValue_t getRequestIdFromData(const uint8_t*& data, size_t& dataSize, uint64_t& requestId); @@ -186,7 +186,7 @@ class Service11TelecommandScheduling final : public PusServiceBase { * @param dataSize TC data size * @param [out] itBegin Begin of filter range * @param [out] itEnd End of filter range - * @return RETURN_OK if successful + * @return returnvalue::OK if successful */ ReturnValue_t getMapFilterFromData(const uint8_t*& data, size_t& size, TcMapIter& itBegin, TcMapIter& itEnd); diff --git a/src/fsfw/returnvalues/HasReturnvaluesIF.h b/src/fsfw/returnvalues/HasReturnvaluesIF.h index 45574056..79a0d9bd 100644 --- a/src/fsfw/returnvalues/HasReturnvaluesIF.h +++ b/src/fsfw/returnvalues/HasReturnvaluesIF.h @@ -17,7 +17,7 @@ namespace returnvalue { /** * It is discouraged to use the input parameters 0,0 and 0,1 as this - * will generate the RETURN_OK and returnvalue::FAILED returnvalues. + * will generate the returnvalue::OK and returnvalue::FAILED returnvalues. * @param interfaceId * @param number * @return diff --git a/src/fsfw/rmap/RMAPChannelIF.h b/src/fsfw/rmap/RMAPChannelIF.h index 9e666dfb..aea08c86 100644 --- a/src/fsfw/rmap/RMAPChannelIF.h +++ b/src/fsfw/rmap/RMAPChannelIF.h @@ -21,7 +21,7 @@ class RMAPChannelIF { * @return * - @c LINK_DOWN when the link is down and all replies were missed * - @c COMMAND_CHANNEL_DEACTIVATED if the channel's port is NULL - * - @c RETURN_OK else + * - @c returnvalue::OK else */ virtual ReturnValue_t reset() = 0; @@ -72,7 +72,7 @@ class RMAPChannelIF { * @param data data to be sent * @param datalen length of data * @return - * - @c RETURN_OK + * - @c returnvalue::OK * - @c COMMAND_NO_DESCRIPTORS_AVAILABLE no descriptors available for sending * command; command was not sent * - @c COMMAND_BUFFER_FULL no receiver buffer available for diff --git a/src/fsfw/rmap/RmapDeviceCommunicationIF.h b/src/fsfw/rmap/RmapDeviceCommunicationIF.h index abe94685..9bbf8466 100644 --- a/src/fsfw/rmap/RmapDeviceCommunicationIF.h +++ b/src/fsfw/rmap/RmapDeviceCommunicationIF.h @@ -25,7 +25,7 @@ class RmapDeviceCommunicationIF : public DeviceCommunicationIF { * this can be performed in this function, which is called on device handler * initialization. * @param cookie - * @return -@c RETURN_OK if initialization was successfull + * @return -@c returnvalue::OK if initialization was successfull * - Everything else triggers failure event with returnvalue as parameter 1 */ virtual ReturnValue_t initializeInterface(CookieIF *cookie) = 0; @@ -37,7 +37,7 @@ class RmapDeviceCommunicationIF : public DeviceCommunicationIF { * @param cookie * @param data * @param len - * @return -@c RETURN_OK for successfull send + * @return -@c returnvalue::OK for successfull send * - Everything else triggers failure event with returnvalue as parameter 1 */ virtual ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t *sendData, size_t sendLen); @@ -46,7 +46,7 @@ class RmapDeviceCommunicationIF : public DeviceCommunicationIF { * Called by DHB in the GET_WRITE doGetWrite(). * Get send confirmation that the data in sendMessage() was sent successfully. * @param cookie - * @return -@c RETURN_OK if data was sent successfull + * @return -@c returnvalue::OK if data was sent successfull * - Everything else triggers falure event with returnvalue as parameter 1 */ virtual ReturnValue_t getSendSuccess(CookieIF *cookie); @@ -57,7 +57,7 @@ class RmapDeviceCommunicationIF : public DeviceCommunicationIF { * from a device. * * @param cookie - * @return -@c RETURN_OK to confirm the request for data has been sent. + * @return -@c returnvalue::OK to confirm the request for data has been sent. * -@c NO_READ_REQUEST if no request shall be made. readReceivedMessage() * will not be called in the respective communication cycle. * - Everything else triggers failure event with returnvalue as parameter 1 @@ -71,7 +71,7 @@ class RmapDeviceCommunicationIF : public DeviceCommunicationIF { * @param cookie * @param data * @param len - * @return @c RETURN_OK for successfull receive + * @return @c returnvalue::OK for successfull receive * - Everything else triggers failure event with returnvalue as parameter 1 */ virtual ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size); diff --git a/src/fsfw/serialize/SerializeAdapter.h b/src/fsfw/serialize/SerializeAdapter.h index 31259b0f..cc06aa80 100644 --- a/src/fsfw/serialize/SerializeAdapter.h +++ b/src/fsfw/serialize/SerializeAdapter.h @@ -40,7 +40,7 @@ class SerializeAdapter { * @return * - @c BUFFER_TOO_SHORT The given buffer in is too short * - @c returnvalue::FAILED Generic Error - * - @c RETURN_OK Successful serialization + * - @c returnvalue::OK Successful serialization */ template static ReturnValue_t serialize(const T *object, uint8_t **buffer, size_t *size, size_t maxSize, @@ -65,7 +65,7 @@ class SerializeAdapter { * @return * - @c BUFFER_TOO_SHORT The given buffer in is too short * - @c returnvalue::FAILED Generic Error - * - @c RETURN_OK Successful serialization + * - @c returnvalue::OK Successful serialization */ template static ReturnValue_t serialize(const T *object, uint8_t *const buffer, size_t *serSize, @@ -114,7 +114,7 @@ class SerializeAdapter { * - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object * - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected * - @c returnvalue::FAILED Generic Error - * - @c RETURN_OK Successful deserialization + * - @c returnvalue::OK Successful deserialization */ template static ReturnValue_t deSerialize(T *object, const uint8_t **buffer, size_t *size, @@ -137,7 +137,7 @@ class SerializeAdapter { * - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object * - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected * - @c returnvalue::FAILED Generic Error - * - @c RETURN_OK Successful deserialization + * - @c returnvalue::OK Successful deserialization */ template static ReturnValue_t deSerialize(T *object, const uint8_t *buffer, size_t *deserSize, diff --git a/src/fsfw/serialize/SerializeIF.h b/src/fsfw/serialize/SerializeIF.h index a02b5f9e..0e9840eb 100644 --- a/src/fsfw/serialize/SerializeIF.h +++ b/src/fsfw/serialize/SerializeIF.h @@ -57,7 +57,7 @@ class SerializeIF { * @return * - @c BUFFER_TOO_SHORT The given buffer in is too short * - @c returnvalue::FAILED Generic error - * - @c RETURN_OK Successful serialization + * - @c returnvalue::OK Successful serialization */ [[nodiscard]] virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize, Endianness streamEndianness) const = 0; @@ -93,7 +93,7 @@ class SerializeIF { * - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object * - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected * - @c returnvalue::FAILED Generic Error - * - @c RETURN_OK Successful deserialization + * - @c returnvalue::OK Successful deserialization */ virtual ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size, Endianness streamEndianness) = 0; diff --git a/src/fsfw/storagemanager/LocalPool.h b/src/fsfw/storagemanager/LocalPool.h index 01706e9c..ebdcba9f 100644 --- a/src/fsfw/storagemanager/LocalPool.h +++ b/src/fsfw/storagemanager/LocalPool.h @@ -138,7 +138,7 @@ class LocalPool : public SystemObject, public StorageManagerIF { * With this helper method, a free element of @c size is reserved. * @param size The minimum packet size that shall be reserved. * @param[out] address Storage ID of the reserved data. - * @return - #RETURN_OK on success, + * @return - returnvalue::OK on success, * - the return codes of #getPoolIndex or #findEmpty otherwise. */ virtual ReturnValue_t reserveSpace(const size_t size, store_address_t* address, bool ignoreFault); @@ -210,7 +210,7 @@ class LocalPool : public SystemObject, public StorageManagerIF { * fits is used. * @param packet_size The size of the data to be stored. * @param[out] poolIndex The fitting pool index found. - * @return - @c RETURN_OK on success, + * @return - @c returnvalue::OK on success, * - @c DATA_TOO_LARGE otherwise. */ ReturnValue_t getSubPoolIndex(size_t packetSize, uint16_t* subpoolIndex, @@ -230,7 +230,7 @@ class LocalPool : public SystemObject, public StorageManagerIF { * duration grows with the fill level of the pool. * @param pool_index The pool in which the search is performed. * @param[out] element The first found element in the pool. - * @return - #RETURN_OK on success, + * @return - returnvalue::OK on success, * - #DATA_STORAGE_FULL if the store is full */ ReturnValue_t findEmpty(n_pool_elem_t poolIndex, uint16_t* element); diff --git a/src/fsfw/storagemanager/StorageManagerIF.h b/src/fsfw/storagemanager/StorageManagerIF.h index 24ef2e45..66002ca9 100644 --- a/src/fsfw/storagemanager/StorageManagerIF.h +++ b/src/fsfw/storagemanager/StorageManagerIF.h @@ -63,7 +63,7 @@ class StorageManagerIF { * @param storageId A pointer to the storageId to retrieve. * @param data The data to be stored in the StorageManager. * @param size The amount of data to be stored. - * @return Returns @li RETURN_OK if data was added. + * @return Returns @li returnvalue::OK if data was added. * @li returnvalue::FAILED if data could not be added. * storageId is unchanged then. */ @@ -73,7 +73,7 @@ class StorageManagerIF { * @brief With deleteData, the storageManager frees the memory region * identified by packet_id. * @param packet_id The identifier of the memory region to be freed. - * @return @li RETURN_OK on success. + * @return @li returnvalue::OK on success. * @li returnvalue::FAILED if deletion did not work * (e.g. an illegal packet_id was passed). */ @@ -84,7 +84,7 @@ class StorageManagerIF { * @param buffer Pointer to the data. * @param size Size of data to be stored. * @param storeId Store id of the deleted element (optional) - * @return @li RETURN_OK on success. + * @return @li returnvalue::OK on success. * @li failure code if deletion did not work */ virtual ReturnValue_t deleteData(uint8_t* buffer, size_t size, @@ -116,7 +116,7 @@ class StorageManagerIF { * @param packet_ptr The passed pointer address is set to the the memory * position * @param size The exact size of the stored data is returned here. - * @return @li RETURN_OK on success. + * @return @li returnvalue::OK on success. * @li returnvalue::FAILED if fetching data did not work * (e.g. an illegal packet_id was passed). */ @@ -156,7 +156,7 @@ class StorageManagerIF { * @param storageId A pointer to the storageId to retrieve. * @param size The size of the space to be reserved. * @param p_data A pointer to the element data is returned here. - * @return Returns @li RETURN_OK if data was added. + * @return Returns @li returnvalue::OK if data was added. * @li returnvalue::FAILED if data could not be added. * storageId is unchanged then. */ diff --git a/src/fsfw/subsystem/SubsystemBase.cpp b/src/fsfw/subsystem/SubsystemBase.cpp index 17bbdf46..86ee251a 100644 --- a/src/fsfw/subsystem/SubsystemBase.cpp +++ b/src/fsfw/subsystem/SubsystemBase.cpp @@ -223,14 +223,14 @@ ReturnValue_t SubsystemBase::handleModeReply(CommandMessage* message) { return returnvalue::OK; // case ModeMessage::CMD_MODE_COMMAND: // handleCommandedMode(message); - // return RETURN_OK; + // return returnvalue::OK; // case ModeMessage::CMD_MODE_ANNOUNCE: // triggerEvent(MODE_INFO, mode, submode); - // return RETURN_OK; + // return returnvalue::OK; // case ModeMessage::CMD_MODE_ANNOUNCE_RECURSIVELY: // triggerEvent(MODE_INFO, mode, submode); // commandAllChildren(message); - // return RETURN_OK; + // return returnvalue::OK; default: return returnvalue::FAILED; } diff --git a/src/fsfw/subsystem/SubsystemBase.h b/src/fsfw/subsystem/SubsystemBase.h index ad341b80..f61340ac 100644 --- a/src/fsfw/subsystem/SubsystemBase.h +++ b/src/fsfw/subsystem/SubsystemBase.h @@ -42,7 +42,7 @@ class SubsystemBase : public SystemObject, * Also adds them to the internal childrenMap. * * @param objectId - * @return RETURN_OK if successful + * @return returnvalue::OK if successful * CHILD_DOESNT_HAVE_MODES if Child is no HasHealthIF and no HasModesIF * COULD_NOT_INSERT_CHILD If the Child could not be added to the ChildrenMap */ diff --git a/src/fsfw/tasks/FixedSlotSequence.cpp b/src/fsfw/tasks/FixedSlotSequence.cpp index e538c9fc..cba7a87a 100644 --- a/src/fsfw/tasks/FixedSlotSequence.cpp +++ b/src/fsfw/tasks/FixedSlotSequence.cpp @@ -16,7 +16,7 @@ FixedSlotSequence::~FixedSlotSequence() { void FixedSlotSequence::executeAndAdvance() { current->executableObject->performOperation(current->opcode); - // if (returnValue != RETURN_OK) { + // if (returnValue != returnvalue::OK) { // this->sendErrorMessage( returnValue ); // } // Increment the polling Sequence iterator diff --git a/src/fsfw/tasks/PeriodicTaskIF.h b/src/fsfw/tasks/PeriodicTaskIF.h index 04415533..d1bbf456 100644 --- a/src/fsfw/tasks/PeriodicTaskIF.h +++ b/src/fsfw/tasks/PeriodicTaskIF.h @@ -29,7 +29,7 @@ class PeriodicTaskIF { * The objects are executed in the order added. The object needs to implement * ExecutableObjectIF * @param object Id of the object to add. - * @return RETURN_OK on success, returnvalue::FAILED if the object could not be added. + * @return returnvalue::OK on success, returnvalue::FAILED if the object could not be added. */ virtual ReturnValue_t addComponent(object_id_t object, uint8_t opCode) = 0; virtual ReturnValue_t addComponent(object_id_t object) { return addComponent(object, 0); }; @@ -38,7 +38,7 @@ class PeriodicTaskIF { * Adds an object to the list of objects to be executed. * The objects are executed in the order added. * @param object pointer to the object to add. - * @return RETURN_OK on success, returnvalue::FAILED if the object could not be added. + * @return returnvalue::OK on success, returnvalue::FAILED if the object could not be added. */ virtual ReturnValue_t addComponent(ExecutableObjectIF* object, uint8_t opCode) = 0; virtual ReturnValue_t addComponent(ExecutableObjectIF* object) { return addComponent(object, 0); } diff --git a/src/fsfw/tasks/SemaphoreIF.h b/src/fsfw/tasks/SemaphoreIF.h index 3f544de8..37275529 100644 --- a/src/fsfw/tasks/SemaphoreIF.h +++ b/src/fsfw/tasks/SemaphoreIF.h @@ -46,14 +46,14 @@ class SemaphoreIF { * for a maximum of timeoutMs while trying to acquire the semaphore. * This can be used to achieve task synchrnization. * @param timeoutMs - * @return - c RETURN_OK for successfull acquisition + * @return - c returnvalue::OK for successfull acquisition */ virtual ReturnValue_t acquire(TimeoutType timeoutType = TimeoutType::BLOCKING, uint32_t timeoutMs = 0) = 0; /** * Corrensponding call to release a semaphore. - * @return -@c RETURN_OK for successfull release + * @return -@c returnvalue::OK for successfull release */ virtual ReturnValue_t release() = 0; diff --git a/src/fsfw/tcdistribution/CCSDSDistributorIF.h b/src/fsfw/tcdistribution/CCSDSDistributorIF.h index a57379ea..9d512549 100644 --- a/src/fsfw/tcdistribution/CCSDSDistributorIF.h +++ b/src/fsfw/tcdistribution/CCSDSDistributorIF.h @@ -17,7 +17,7 @@ class CCSDSDistributorIF { * With this call, a class implementing the CCSDSApplicationIF can register * at the distributor. * @param application A pointer to the Application to register. - * @return - @c RETURN_OK on success, + * @return - @c returnvalue::OK on success, * - @c returnvalue::FAILED on failure. */ virtual ReturnValue_t registerApplication(AcceptsTelecommandsIF* application) = 0; @@ -27,7 +27,7 @@ class CCSDSDistributorIF { * @param apid The APID to register. * @param id The MessageQueueId of the message queue to send the * TC Packets to. - * @return - @c RETURN_OK on success, + * @return - @c returnvalue::OK on success, * - @c returnvalue::FAILED on failure. */ virtual ReturnValue_t registerApplication(uint16_t apid, MessageQueueId_t id) = 0; diff --git a/src/fsfw/tcdistribution/CFDPDistributor.cpp b/src/fsfw/tcdistribution/CFDPDistributor.cpp index 20edc0f4..5f5f3904 100644 --- a/src/fsfw/tcdistribution/CFDPDistributor.cpp +++ b/src/fsfw/tcdistribution/CFDPDistributor.cpp @@ -101,10 +101,10 @@ ReturnValue_t CFDPDistributor::registerHandler(AcceptsTelecommandsIF* handler) { MessageQueueId_t CFDPDistributor::getRequestQueue() { return tcQueue->getId(); } // ReturnValue_t CFDPDistributor::callbackAfterSending(ReturnValue_t queueStatus) { -// if (queueStatus != RETURN_OK) { +// if (queueStatus != returnvalue::OK) { // tcStatus = queueStatus; // } -// if (tcStatus != RETURN_OK) { +// if (tcStatus != returnvalue::OK) { // this->verifyChannel.sendFailureReport(tc_verification::ACCEPTANCE_FAILURE, // currentPacket, tcStatus); // // A failed packet is deleted immediately after reporting, @@ -114,7 +114,7 @@ MessageQueueId_t CFDPDistributor::getRequestQueue() { return tcQueue->getId(); } // } else { // this->verifyChannel.sendSuccessReport(tc_verification::ACCEPTANCE_SUCCESS, // currentPacket); -// return RETURN_OK; +// return returnvalue::OK; // } // } diff --git a/src/fsfw/tcdistribution/CFDPDistributorIF.h b/src/fsfw/tcdistribution/CFDPDistributorIF.h index 57cf9fde..8ee5568f 100644 --- a/src/fsfw/tcdistribution/CFDPDistributorIF.h +++ b/src/fsfw/tcdistribution/CFDPDistributorIF.h @@ -17,7 +17,7 @@ class CFDPDistributorIF { /** * With this method, Handlers can register themselves at the CFDP Distributor. * @param handler A pointer to the registering Handler. - * @return - @c RETURN_OK on success, + * @return - @c returnvalue::OK on success, * - @c returnvalue::FAILED on failure. */ virtual ReturnValue_t registerHandler(AcceptsTelecommandsIF* handler) = 0; diff --git a/src/fsfw/tcdistribution/PUSDistributorIF.h b/src/fsfw/tcdistribution/PUSDistributorIF.h index 85619fee..e3bff93f 100644 --- a/src/fsfw/tcdistribution/PUSDistributorIF.h +++ b/src/fsfw/tcdistribution/PUSDistributorIF.h @@ -17,7 +17,7 @@ class PUSDistributorIF { /** * With this method, Services can register themselves at the PUS Distributor. * @param service A pointer to the registering Service. - * @return - @c RETURN_OK on success, + * @return - @c returnvalue::OK on success, * - @c returnvalue::FAILED on failure. */ virtual ReturnValue_t registerService(AcceptsTelecommandsIF* service) = 0; diff --git a/src/fsfw/tcdistribution/TcDistributor.h b/src/fsfw/tcdistribution/TcDistributor.h index 7c7e539c..62cd5dc9 100644 --- a/src/fsfw/tcdistribution/TcDistributor.h +++ b/src/fsfw/tcdistribution/TcDistributor.h @@ -101,10 +101,10 @@ class TcDistributor : public SystemObject, public ExecutableObjectIF { * This method gives the child class a chance to perform some kind of * operation after the parent tried to forward the message. * A typically application would be sending success/failure messages. - * The default implementation just returns @c RETURN_OK. + * The default implementation just returns @c returnvalue::OK. * @param queueStatus The status of the message queue after an attempt * to send the TC. - * @return - @c RETURN_OK on success + * @return - @c returnvalue::OK on success * - @c returnvalue::FAILED on failure */ virtual ReturnValue_t callbackAfterSending(ReturnValue_t queueStatus); diff --git a/src/fsfw/tcdistribution/TcPacketCheckIF.h b/src/fsfw/tcdistribution/TcPacketCheckIF.h index 858c3093..4846195a 100644 --- a/src/fsfw/tcdistribution/TcPacketCheckIF.h +++ b/src/fsfw/tcdistribution/TcPacketCheckIF.h @@ -20,7 +20,7 @@ class TcPacketCheckIF { * This is the actual method to formally check a certain Packet. * The packet's Application Data can not be checked here. * @param current_packet The packet to check - * @return - @c RETURN_OK on success. + * @return - @c returnvalue::OK on success. * - @c INCORRECT_CHECKSUM if checksum is invalid. * - @c ILLEGAL_APID if APID does not match. */ diff --git a/src/fsfw/timemanager/CCSDSTime.h b/src/fsfw/timemanager/CCSDSTime.h index c0db1d6e..622f42ec 100644 --- a/src/fsfw/timemanager/CCSDSTime.h +++ b/src/fsfw/timemanager/CCSDSTime.h @@ -105,7 +105,7 @@ class CCSDSTime { * @param to pointer to a CCS struct * @param from pointer to a TimeOfDay Struct * @return - * - @c RETURN_OK if OK + * - @c returnvalue::OK if OK * - @c INVALID_TIMECODE if not OK */ static ReturnValue_t convertToCcsds(Ccs_seconds *to, Clock::TimeOfDay_t const *from); @@ -115,7 +115,7 @@ class CCSDSTime { * @param to pointer to the CDS struct to generate * @param from pointer to a timeval struct which comprises a time of day since UNIX epoch. * @return - * - @c RETURN_OK as it assumes a valid timeval. + * - @c returnvalue::OK as it assumes a valid timeval. */ static ReturnValue_t convertToCcsds(CDS_short *to, timeval const *from); @@ -129,7 +129,7 @@ class CCSDSTime { * @param to pointer to a CCS struct * @param from pointer to a TimeOfDay Struct * @return - * - @c RETURN_OK if OK + * - @c returnvalue::OK if OK * - @c INVALID_TIMECODE if not OK */ static ReturnValue_t convertToCcsds(Ccs_mseconds *to, Clock::TimeOfDay_t const *from); @@ -145,7 +145,7 @@ class CCSDSTime { * @param from pointer to an CCSDS Time code * @param length length of the Time code * @return - * - @c RETURN_OK if successful + * - @c returnvalue::OK if successful * - @c UNSUPPORTED_TIME_FORMAT if a (possibly valid) time code is not supported * - @c LENGTH_MISMATCH if the length does not match the P Field * - @c INVALID_TIME_FORMAT if the format or a value is invalid @@ -182,7 +182,7 @@ class CCSDSTime { * @param from Buffer to read from * @param foundLength Length found by this function (can be nullptr if unused) * @param maxLength Max length of the buffer to be read - * @return ReturnValue_t - RETURN_OK if successful + * @return ReturnValue_t - returnvalue::OK if successful * - LENGTH_MISMATCH if expected length is larger than maxLength */ static ReturnValue_t convertFromCUC(timeval *to, uint8_t const *from, size_t *foundLength, diff --git a/src/fsfw/timemanager/Clock.h b/src/fsfw/timemanager/Clock.h index 6df6e12b..f27c2211 100644 --- a/src/fsfw/timemanager/Clock.h +++ b/src/fsfw/timemanager/Clock.h @@ -38,7 +38,7 @@ class Clock { * This system call sets the system time. * To set the time, it uses a TimeOfDay_t struct. * @param time The struct with the time settings to set. - * @return -@c RETURN_OK on success. Otherwise, the OS failure code + * @return -@c returnvalue::OK on success. Otherwise, the OS failure code * is returned. */ static ReturnValue_t setClock(const TimeOfDay_t *time); @@ -46,7 +46,7 @@ class Clock { * This system call sets the system time. * To set the time, it uses a timeval struct. * @param time The struct with the time settings to set. - * @return -@c RETURN_OK on success. Otherwise, the OS failure code is returned. + * @return -@c returnvalue::OK on success. Otherwise, the OS failure code is returned. */ static ReturnValue_t setClock(const timeval *time); /** @@ -54,7 +54,7 @@ class Clock { * The timval format has the fields @c tv_sec with seconds and @c tv_usec with * microseconds since an OS-defined epoch. * @param time A pointer to a timeval struct where the current time is stored. - * @return @c RETURN_OK on success. Otherwise, the OS failure code is returned. + * @return @c returnvalue::OK on success. Otherwise, the OS failure code is returned. */ static ReturnValue_t getClock_timeval(timeval *time); @@ -62,7 +62,7 @@ class Clock { * Get the time since boot in a timeval struct * * @param[out] time A pointer to a timeval struct where the uptime is stored. - * @return @c RETURN_OK on success. Otherwise, the OS failure code is returned. + * @return @c returnvalue::OK on success. Otherwise, the OS failure code is returned. * * @deprecated, I do not think this should be able to fail, use timeval getUptime() */ @@ -77,7 +77,7 @@ class Clock { * between two calls up to 49 days by always using uint32_t in the calculation * * @param ms uptime in ms - * @return RETURN_OK on success. Otherwise, the OS failure code is returned. + * @return returnvalue::OK on success. Otherwise, the OS failure code is returned. */ static ReturnValue_t getUptime(uint32_t *uptimeMs); @@ -86,7 +86,7 @@ class Clock { * The time is returned in a 64 bit unsigned integer. * @param time A pointer to a 64 bit unisigned integer where the data is stored. * @return - * - @c RETURN_OK on success. + * - @c returnvalue::OK on success. * - Otherwise, the OS failure code is returned. */ static ReturnValue_t getClock_usecs(uint64_t *time); @@ -94,7 +94,7 @@ class Clock { * Returns the time in a TimeOfDay_t struct. * @param time A pointer to a TimeOfDay_t struct. * @return - * - @c RETURN_OK on success. + * - @c returnvalue::OK on success. * - Otherwise, the OS failure code is returned. */ static ReturnValue_t getDateAndTime(TimeOfDay_t *time); @@ -111,7 +111,7 @@ class Clock { * @param time The time of day as input * @param timeval The corresponding seconds since the epoch. * @return - * - @c RETURN_OK on success. + * - @c returnvalue::OK on success. * - Otherwise, the OS failure code is returned. */ static ReturnValue_t convertTimeOfDayToTimeval(const TimeOfDay_t *from, timeval *to); @@ -122,7 +122,7 @@ class Clock { * * @param time seconds since unix epoch * @param[out] JD2000 days since J2000 - * @return @c RETURN_OK + * @return @c returnvalue::OK */ static ReturnValue_t convertTimevalToJD2000(timeval time, double *JD2000); @@ -136,7 +136,7 @@ class Clock { * @param utc timeval, corresponding to UTC time * @param[out] tt timeval, corresponding to Terrestial Time * @return - * - @c RETURN_OK on success + * - @c returnvalue::OK on success * - @c returnvalue::FAILED if leapSeconds are not set */ static ReturnValue_t convertUTCToTT(timeval utc, timeval *tt); @@ -146,7 +146,7 @@ class Clock { * * @param leapSeconds_ * @return - * - @c RETURN_OK on success. + * - @c returnvalue::OK on success. */ static ReturnValue_t setLeapSeconds(const uint16_t leapSeconds_); @@ -157,7 +157,7 @@ class Clock { * * @param[out] leapSeconds_ * @return - * - @c RETURN_OK on success. + * - @c returnvalue::OK on success. * - @c returnvalue::FAILED on error */ static ReturnValue_t getLeapSeconds(uint16_t *leapSeconds_); @@ -166,7 +166,7 @@ class Clock { /** * Function to check and create the Mutex for the clock * @return - * - @c RETURN_OK on success. + * - @c returnvalue::OK on success. * - Otherwise @c returnvalue::FAILED if not able to create one */ static ReturnValue_t checkOrCreateClockMutex(); diff --git a/src/fsfw/tmstorage/TmStoreFrontendIF.h b/src/fsfw/tmstorage/TmStoreFrontendIF.h index 3ab93ba1..4665a299 100644 --- a/src/fsfw/tmstorage/TmStoreFrontendIF.h +++ b/src/fsfw/tmstorage/TmStoreFrontendIF.h @@ -28,7 +28,7 @@ class TmStoreFrontendIF { * @param packet Pointer to the newly received Space Packet. * @param address Start address of the packet found * @param isLastPacket Indicates if no more packets can be fetched. - * @return If more packets shall be fetched, RETURN_OK must be returned. + * @return If more packets shall be fetched, returnvalue::OK must be returned. * Any other code stops fetching packets. */ virtual ReturnValue_t packetRetrieved(TmPacketMinimal* packet, uint32_t address) = 0; diff --git a/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h b/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h index a1fc77e8..1a74e63d 100644 --- a/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h +++ b/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h @@ -22,7 +22,7 @@ class RedirectableDataPointerIF { * large enough * @param args Any additional user arguments required to set the data pointer * @return - * - RETURN_OK if the pointer was set successfully + * - returnvalue::OK if the pointer was set successfully * - returnvalue::FAILED on general error of if the maximum size is too small */ virtual ReturnValue_t setData(uint8_t* dataPtr, size_t maxSize, void* args = nullptr) = 0; diff --git a/src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.h b/src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.h index f9c73bdd..329b62ff 100644 --- a/src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.h +++ b/src/fsfw/tmtcpacket/cfdp/CFDPPacketStored.h @@ -25,7 +25,7 @@ class CFDPPacketStored : public CFDPPacket, public TcPacketStoredBase { * Getter function for the raw data. * @param dataPtr [out] Pointer to the data pointer to set * @param dataSize [out] Address of size to set. - * @return -@c RETURN_OK if data was retrieved successfully. + * @return -@c returnvalue::OK if data was retrieved successfully. */ ReturnValue_t getData(const uint8_t** dataPtr, size_t* dataSize); diff --git a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredBase.h b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredBase.h index ece0e482..6602eeca 100644 --- a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredBase.h +++ b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredBase.h @@ -34,7 +34,7 @@ class TcPacketStoredBase : public TcPacketStoredIF { * Getter function for the raw data. * @param dataPtr [out] Pointer to the data pointer to set * @param dataSize [out] Address of size to set. - * @return -@c RETURN_OK if data was retrieved successfully. + * @return -@c returnvalue::OK if data was retrieved successfully. */ ReturnValue_t getData(const uint8_t** dataPtr, size_t* dataSize) override; diff --git a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h index 7ac8c331..e7c4f9f0 100644 --- a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h +++ b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h @@ -25,7 +25,7 @@ class TcPacketStoredIF { * Getter function for the raw data. * @param dataPtr [out] Pointer to the data pointer to set * @param dataSize [out] Address of size to set. - * @return -@c RETURN_OK if data was retrieved successfully. + * @return -@c returnvalue::OK if data was retrieved successfully. */ virtual ReturnValue_t getData(const uint8_t** dataPtr, size_t* dataSize) = 0; }; diff --git a/src/fsfw/tmtcservices/CommandingServiceBase.cpp b/src/fsfw/tmtcservices/CommandingServiceBase.cpp index 4cecf53b..d61bf77f 100644 --- a/src/fsfw/tmtcservices/CommandingServiceBase.cpp +++ b/src/fsfw/tmtcservices/CommandingServiceBase.cpp @@ -184,7 +184,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/tmtcservices/CommandingServiceBase.h b/src/fsfw/tmtcservices/CommandingServiceBase.h index 73b42259..1de1f977 100644 --- a/src/fsfw/tmtcservices/CommandingServiceBase.h +++ b/src/fsfw/tmtcservices/CommandingServiceBase.h @@ -90,7 +90,7 @@ class CommandingServiceBase : public SystemObject, * Handle request queue for external commands. * Handle command Queue for internal commands. * @param opCode is unused here at the moment - * @return RETURN_OK + * @return returnvalue::OK */ virtual ReturnValue_t performOperation(uint8_t opCode) override; @@ -128,7 +128,7 @@ class CommandingServiceBase : public SystemObject, * Check the target subservice * @param subservice[in] * @return - * -@c RETURN_OK Subservice valid, continue message handling + * -@c returnvalue::OK Subservice valid, continue message handling * -@c INVALID_SUBSERVICE if service is not known, rejects packet. */ virtual ReturnValue_t isValidSubservice(uint8_t subservice) = 0; @@ -143,7 +143,7 @@ class CommandingServiceBase : public SystemObject, * @param id MessageQueue ID is stored here * @param objectId Object ID is extracted and stored here * @return - * - @c RETURN_OK Cotinue message handling + * - @c returnvalue::OK Cotinue message handling * - @c returnvalue::FAILED Reject the packet and generates a start failure * verification */ @@ -164,7 +164,7 @@ class CommandingServiceBase : public SystemObject, * communication * @param objectId Target object ID * @return - * - @c RETURN_OK to generate a verification start message + * - @c returnvalue::OK to generate a verification start message * - @c EXECUTION_COMPLETE Fire-and-forget command. Generate a completion * verification message. * - @c Anything else rejects the packets and generates a start failure @@ -189,7 +189,7 @@ class CommandingServiceBase : public SystemObject, * @param objectId Source object ID * @param isStep Flag value to mark steps of command execution * @return - * - @c RETURN_OK, @c EXECUTION_COMPLETE or @c NO_STEP_MESSAGE to + * - @c returnvalue::OK, @c EXECUTION_COMPLETE or @c NO_STEP_MESSAGE to * generate TC verification success * - @c INVALID_REPLY Calls handleUnrequestedReply * - Anything else triggers a TC verification failure. If returnvalue::FAILED or diff --git a/src/fsfw/tmtcservices/PusServiceBase.h b/src/fsfw/tmtcservices/PusServiceBase.h index 6271f267..97351994 100644 --- a/src/fsfw/tmtcservices/PusServiceBase.h +++ b/src/fsfw/tmtcservices/PusServiceBase.h @@ -75,14 +75,14 @@ class PusServiceBase : public ExecutableObjectIF, * * @return The returned status_code is directly taken as main error code * in the Verification Report. - * On success, RETURN_OK shall be returned. + * On success, returnvalue::OK shall be returned. */ virtual ReturnValue_t handleRequest(uint8_t subservice) = 0; /** * In performService, implementations can handle periodic, * non-TC-triggered activities. * The performService method is always called. - * @return Currently, everything other that RETURN_OK only triggers + * @return Currently, everything other that returnvalue::OK only triggers * diagnostic output. */ virtual ReturnValue_t performService() = 0; @@ -92,7 +92,7 @@ class PusServiceBase : public ExecutableObjectIF, * completion verification messages and deletes * the TC requests afterwards. * performService is always executed afterwards. - * @return @c RETURN_OK if the periodic performService was successful. + * @return @c returnvalue::OK if the periodic performService was successful. * @c returnvalue::FAILED else. */ ReturnValue_t performOperation(uint8_t opCode) override; diff --git a/src/fsfw/tmtcservices/SpacePacketParser.h b/src/fsfw/tmtcservices/SpacePacketParser.h index f0a9e8e2..93f90afe 100644 --- a/src/fsfw/tmtcservices/SpacePacketParser.h +++ b/src/fsfw/tmtcservices/SpacePacketParser.h @@ -51,7 +51,7 @@ class SpacePacketParser { * will be set to the detected packet size and startIndex will be set to the start of the * detected packet. buffer and read length will not be incremented but the found length * will be assigned. - * -@c RETURN_OK if a packet was found + * -@c returnvalue::OK if a packet was found */ ReturnValue_t parseSpacePackets(const uint8_t** buffer, const size_t maxSize, size_t& startIndex, size_t& foundSize, size_t& readLen); @@ -67,7 +67,7 @@ class SpacePacketParser { * -@c SPLIT_PACKET if a packet was found but the detected size exceeds maxSize. foundSize * will be set to the detected packet size and startIndex will be set to the start of the * detected packet - * -@c RETURN_OK if a packet was found + * -@c returnvalue::OK if a packet was found */ ReturnValue_t parseSpacePackets(const uint8_t* buffer, const size_t maxSize, size_t& startIndex, size_t& foundSize); diff --git a/src/fsfw/tmtcservices/TmTcBridge.h b/src/fsfw/tmtcservices/TmTcBridge.h index 3ebdac95..e2e5bfa5 100644 --- a/src/fsfw/tmtcservices/TmTcBridge.h +++ b/src/fsfw/tmtcservices/TmTcBridge.h @@ -30,7 +30,7 @@ class TmTcBridge : public AcceptsTelemetryIF, * Set number of packets sent per performOperation().Please note that this * value must be smaller than MAX_STORED_DATA_SENT_PER_CYCLE * @param sentPacketsPerCycle - * @return -@c RETURN_OK if value was set successfully + * @return -@c returnvalue::OK if value was set successfully * -@c returnvalue::FAILED otherwise, stored value stays the same */ ReturnValue_t setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerCycle); @@ -39,7 +39,7 @@ class TmTcBridge : public AcceptsTelemetryIF, * Set number of packets sent per performOperation().Please note that this * value must be smaller than MAX_DOWNLINK_PACKETS_STORED * @param sentPacketsPerCycle - * @return -@c RETURN_OK if value was set successfully + * @return -@c returnvalue::OK if value was set successfully * -@c returnvalue::FAILED otherwise, stored value stays the same */ ReturnValue_t setMaxNumberOfPacketsStored(uint8_t maxNumberOfPacketsStored); diff --git a/src/fsfw_hal/common/gpio/GpioIF.h b/src/fsfw_hal/common/gpio/GpioIF.h index feb356f4..3e947b84 100644 --- a/src/fsfw_hal/common/gpio/GpioIF.h +++ b/src/fsfw_hal/common/gpio/GpioIF.h @@ -29,7 +29,7 @@ class GpioIF { * functionality to pull a certain GPIO to high logic level. * * @param gpioId A unique number which specifies the GPIO to drive. - * @return Returns RETURN_OK for success. This should never return returnvalue::FAILED. + * @return Returns returnvalue::OK for success. This should never return returnvalue::FAILED. */ virtual ReturnValue_t pullHigh(gpioId_t gpioId) = 0; diff --git a/src/fsfw_hal/linux/CommandExecutor.h b/src/fsfw_hal/linux/CommandExecutor.h index f817b0c2..11b8ccbb 100644 --- a/src/fsfw_hal/linux/CommandExecutor.h +++ b/src/fsfw_hal/linux/CommandExecutor.h @@ -68,7 +68,7 @@ class CommandExecutor { * the result of the system call was not 0. The error value can be accessed using * getLastError * - In non-blocking mode, this call will start - * the execution and then return RETURN_OK + * the execution and then return returnvalue::OK */ ReturnValue_t execute(); /** @@ -77,7 +77,7 @@ class CommandExecutor { * @return * - BYTES_READ if bytes have been read from the executing process. It is recommended to call * check again after this - * - RETURN_OK execution is pending, but no bytes have been read from the executing process + * - returnvalue::OK execution is pending, but no bytes have been read from the executing process * - returnvalue::FAILED if execution has failed, error value can be accessed using getLastError * - EXECUTION_FINISHED if the process was executed successfully * - NO_COMMAND_LOADED_OR_PENDING self-explanatory @@ -87,7 +87,7 @@ class CommandExecutor { /** * Abort the current command. Should normally not be necessary, check can be used to find * out whether command execution was successful - * @return RETURN_OK + * @return returnvalue::OK */ ReturnValue_t close(); diff --git a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h index f9ba680b..fff7e3c2 100644 --- a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +++ b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h @@ -71,7 +71,7 @@ class LinuxLibgpioIF : public GpioIF, public SystemObject { * * @param mapToAdd The GPIOs which shall be added to the gpioMap. * - * @return RETURN_OK if successful, otherwise returnvalue::FAILED + * @return returnvalue::OK if successful, otherwise returnvalue::FAILED */ ReturnValue_t checkForConflicts(GpioMap& mapToAdd); diff --git a/src/fsfw_hal/linux/i2c/I2cComIF.h b/src/fsfw_hal/linux/i2c/I2cComIF.h index 7101b9b6..0a15c3a4 100644 --- a/src/fsfw_hal/linux/i2c/I2cComIF.h +++ b/src/fsfw_hal/linux/i2c/I2cComIF.h @@ -49,7 +49,7 @@ class I2cComIF : public DeviceCommunicationIF, public SystemObject { * @param deviceFile The name of the device file. E.g. i2c-0 * @param i2cAddress The address of the i2c slave device. * @param fileDescriptor Pointer to device descriptor. - * @return RETURN_OK if successful, otherwise returnvalue::FAILED. + * @return returnvalue::OK if successful, otherwise returnvalue::FAILED. */ ReturnValue_t openDevice(std::string deviceFile, address_t i2cAddress, int *fileDescriptor); }; diff --git a/src/fsfw_tests/integration/assemblies/TestAssembly.h b/src/fsfw_tests/integration/assemblies/TestAssembly.h index 6042f54e..91ffbf60 100644 --- a/src/fsfw_tests/integration/assemblies/TestAssembly.h +++ b/src/fsfw_tests/integration/assemblies/TestAssembly.h @@ -22,7 +22,7 @@ class TestAssembly : public AssemblyBase { * @param mode * @param submode * @return - * - @c RETURN_OK if ok + * - @c returnvalue::OK if ok * - @c NEED_SECOND_STEP if children need to be commanded again */ ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override; From d2ac3603a5857d4f08c7238b24fb195d8d1f0f3f Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 16 Aug 2022 12:29:53 +0200 Subject: [PATCH 09/10] some more occurences --- docs/README-highlevel.md | 2 +- docs/highlevel.rst | 2 +- src/fsfw/osal/linux/Clock.cpp | 2 +- src/fsfw/pus/Service11TelecommandScheduling.h | 6 +++--- src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h | 12 ++++++------ src/fsfw_hal/linux/spi/SpiComIF.h | 6 +++--- src/fsfw_hal/linux/uart/UartComIF.h | 6 +++--- src/fsfw_hal/stm32h7/spi/spiDefinitions.h | 6 +++--- unittests/container/TestDynamicFifo.cpp | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/README-highlevel.md b/docs/README-highlevel.md index 262138a7..9005af8d 100644 --- a/docs/README-highlevel.md +++ b/docs/README-highlevel.md @@ -14,7 +14,7 @@ FSFW to achieve that. The fsfw uses run-time type information but exceptions are # Failure Handling Functions should return a defined `ReturnValue_t` to signal to the caller that something has -gone wrong. Returnvalues must be unique. For this the function `HasReturnvaluesIF::makeReturnCode` +gone wrong. Returnvalues must be unique. For this the function `returnvalue::makeCode` or the macro `MAKE_RETURN` can be used. The `CLASS_ID` is a unique id for that type of object. See `returnvalues/FwClassIds` folder. The user can add custom `CLASS_ID`s via the `fsfwconfig` folder. diff --git a/docs/highlevel.rst b/docs/highlevel.rst index 04eb5e7b..3c9baae2 100644 --- a/docs/highlevel.rst +++ b/docs/highlevel.rst @@ -18,7 +18,7 @@ Failure Handling ----------------- Functions should return a defined :cpp:type:`ReturnValue_t` to signal to the caller that something has -gone wrong. Returnvalues must be unique. For this the function :cpp:func:`HasReturnvaluesIF::makeReturnCode` +gone wrong. Returnvalues must be unique. For this the function :cpp:func:`returnvalue::makeCode` or the :ref:`macro MAKE_RETURN_CODE ` can be used. The ``CLASS_ID`` is a unique ID for that type of object. See the :ref:`FSFW Class IDs file `. The user can add custom ``CLASS_ID``\s via the ``fsfwconfig`` folder. diff --git a/src/fsfw/osal/linux/Clock.cpp b/src/fsfw/osal/linux/Clock.cpp index 2b914f75..a2b6f5bf 100644 --- a/src/fsfw/osal/linux/Clock.cpp +++ b/src/fsfw/osal/linux/Clock.cpp @@ -93,7 +93,7 @@ ReturnValue_t Clock::getUptime(timeval* uptime) { // struct sysinfo sysInfo; // int result = sysinfo(&sysInfo); // if(result != 0){ -// return HasReturnvaluesIF::returnvalue::FAILED; +// return returnvalue::FAILED; // } // return sysInfo.uptime; //} diff --git a/src/fsfw/pus/Service11TelecommandScheduling.h b/src/fsfw/pus/Service11TelecommandScheduling.h index 35ae59e0..2ceacbf7 100644 --- a/src/fsfw/pus/Service11TelecommandScheduling.h +++ b/src/fsfw/pus/Service11TelecommandScheduling.h @@ -38,11 +38,11 @@ class Service11TelecommandScheduling final : public PusServiceBase { static constexpr uint8_t CLASS_ID = CLASS_ID::PUS_SERVICE_11; static constexpr ReturnValue_t INVALID_TYPE_TIME_WINDOW = - HasReturnvaluesIF::makeReturnCode(CLASS_ID, 1); + returnvalue::makeCode(CLASS_ID, 1); static constexpr ReturnValue_t TIMESHIFTING_NOT_POSSIBLE = - HasReturnvaluesIF::makeReturnCode(CLASS_ID, 2); + returnvalue::makeCode(CLASS_ID, 2); static constexpr ReturnValue_t INVALID_RELATIVE_TIME = - HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3); + returnvalue::makeCode(CLASS_ID, 3); static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_11; diff --git a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h index fff7e3c2..49b15b83 100644 --- a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +++ b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h @@ -20,17 +20,17 @@ class LinuxLibgpioIF : public GpioIF, public SystemObject { static const uint8_t gpioRetvalId = CLASS_ID::HAL_GPIO; static constexpr ReturnValue_t UNKNOWN_GPIO_ID = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 1); + returnvalue::makeCode(gpioRetvalId, 1); static constexpr ReturnValue_t DRIVE_GPIO_FAILURE = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 2); + returnvalue::makeCode(gpioRetvalId, 2); static constexpr ReturnValue_t GPIO_TYPE_FAILURE = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 3); + returnvalue::makeCode(gpioRetvalId, 3); static constexpr ReturnValue_t GPIO_INVALID_INSTANCE = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 4); + returnvalue::makeCode(gpioRetvalId, 4); static constexpr ReturnValue_t GPIO_DUPLICATE_DETECTED = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 5); + returnvalue::makeCode(gpioRetvalId, 5); static constexpr ReturnValue_t GPIO_INIT_FAILED = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 6); + returnvalue::makeCode(gpioRetvalId, 6); LinuxLibgpioIF(object_id_t objectId); virtual ~LinuxLibgpioIF(); diff --git a/src/fsfw_hal/linux/spi/SpiComIF.h b/src/fsfw_hal/linux/spi/SpiComIF.h index 357afa2f..d3b361a9 100644 --- a/src/fsfw_hal/linux/spi/SpiComIF.h +++ b/src/fsfw_hal/linux/spi/SpiComIF.h @@ -24,13 +24,13 @@ class SpiComIF : public DeviceCommunicationIF, public SystemObject { public: static constexpr uint8_t spiRetvalId = CLASS_ID::HAL_SPI; static constexpr ReturnValue_t OPENING_FILE_FAILED = - HasReturnvaluesIF::makeReturnCode(spiRetvalId, 0); + returnvalue::makeCode(spiRetvalId, 0); /* Full duplex (ioctl) transfer failure */ static constexpr ReturnValue_t FULL_DUPLEX_TRANSFER_FAILED = - HasReturnvaluesIF::makeReturnCode(spiRetvalId, 1); + returnvalue::makeCode(spiRetvalId, 1); /* Half duplex (read/write) transfer failure */ static constexpr ReturnValue_t HALF_DUPLEX_TRANSFER_FAILED = - HasReturnvaluesIF::makeReturnCode(spiRetvalId, 2); + returnvalue::makeCode(spiRetvalId, 2); SpiComIF(object_id_t objectId, GpioIF* gpioComIF); diff --git a/src/fsfw_hal/linux/uart/UartComIF.h b/src/fsfw_hal/linux/uart/UartComIF.h index 224f1e77..870d02c5 100644 --- a/src/fsfw_hal/linux/uart/UartComIF.h +++ b/src/fsfw_hal/linux/uart/UartComIF.h @@ -23,11 +23,11 @@ class UartComIF : public DeviceCommunicationIF, public SystemObject { static constexpr uint8_t uartRetvalId = CLASS_ID::HAL_UART; static constexpr ReturnValue_t UART_READ_FAILURE = - HasReturnvaluesIF::makeReturnCode(uartRetvalId, 1); + returnvalue::makeCode(uartRetvalId, 1); static constexpr ReturnValue_t UART_READ_SIZE_MISSMATCH = - HasReturnvaluesIF::makeReturnCode(uartRetvalId, 2); + returnvalue::makeCode(uartRetvalId, 2); static constexpr ReturnValue_t UART_RX_BUFFER_TOO_SMALL = - HasReturnvaluesIF::makeReturnCode(uartRetvalId, 3); + returnvalue::makeCode(uartRetvalId, 3); UartComIF(object_id_t objectId); diff --git a/src/fsfw_hal/stm32h7/spi/spiDefinitions.h b/src/fsfw_hal/stm32h7/spi/spiDefinitions.h index 12c3bf4e..809f5c74 100644 --- a/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +++ b/src/fsfw_hal/stm32h7/spi/spiDefinitions.h @@ -11,9 +11,9 @@ namespace spi { static constexpr uint8_t HAL_SPI_ID = CLASS_ID::HAL_SPI; static constexpr ReturnValue_t HAL_TIMEOUT_RETVAL = - HasReturnvaluesIF::makeReturnCode(HAL_SPI_ID, 0); -static constexpr ReturnValue_t HAL_BUSY_RETVAL = HasReturnvaluesIF::makeReturnCode(HAL_SPI_ID, 1); -static constexpr ReturnValue_t HAL_ERROR_RETVAL = HasReturnvaluesIF::makeReturnCode(HAL_SPI_ID, 2); + returnvalue::makeCode(HAL_SPI_ID, 0); +static constexpr ReturnValue_t HAL_BUSY_RETVAL = returnvalue::makeCode(HAL_SPI_ID, 1); +static constexpr ReturnValue_t HAL_ERROR_RETVAL = returnvalue::makeCode(HAL_SPI_ID, 2); enum class TransferStates { IDLE, WAIT, SUCCESS, FAILURE }; diff --git a/unittests/container/TestDynamicFifo.cpp b/unittests/container/TestDynamicFifo.cpp index 1475b0dc..a3347215 100644 --- a/unittests/container/TestDynamicFifo.cpp +++ b/unittests/container/TestDynamicFifo.cpp @@ -82,8 +82,8 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { REQUIRE(fifo.size() == 0); REQUIRE(fifo.empty()); // struct Test* ptr = nullptr; - // REQUIRE(fifo.retrieve(ptr) == static_cast(HasReturnvaluesIF::returnvalue::FAILED)); - // REQUIRE(fifo.peek(ptr) == static_cast(HasReturnvaluesIF::returnvalue::FAILED)); + // REQUIRE(fifo.retrieve(ptr) == static_cast(returnvalue::FAILED)); + // REQUIRE(fifo.peek(ptr) == static_cast(returnvalue::FAILED)); }; SECTION("Copy Test") { REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK)); From 217276d50c0248c88485811ff6bb0ed0fb71a4c1 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 16 Aug 2022 12:48:22 +0200 Subject: [PATCH 10/10] renamed returnvalue header --- docs/api/returnvalue.rst | 2 +- .../fsfwconfig/pollingsequence/PollingSequenceFactory.h | 2 +- src/fsfw/action/CommandActionHelper.h | 2 +- src/fsfw/action/CommandsActionsIF.h | 2 +- src/fsfw/action/HasActionsIF.h | 2 +- src/fsfw/cfdp/CFDPHandler.h | 2 +- src/fsfw/cfdp/definitions.h | 2 +- src/fsfw/container/ArrayList.h | 2 +- src/fsfw/container/FIFOBase.h | 2 +- src/fsfw/container/FixedMap.h | 2 +- src/fsfw/container/IndexedRingMemoryArray.h | 2 +- src/fsfw/container/RingBufferBase.h | 2 +- src/fsfw/coordinates/Sgp4Propagator.h | 2 +- src/fsfw/datalinklayer/CCSDSReturnValuesIF.h | 4 ++-- src/fsfw/datalinklayer/MapPacketExtraction.h | 2 +- src/fsfw/datalinklayer/VirtualChannelReceptionIF.h | 2 +- src/fsfw/datapool/DataSetIF.h | 2 +- src/fsfw/datapool/PoolVariableIF.h | 2 +- src/fsfw/datapool/ReadCommitIF.h | 2 +- src/fsfw/datapool/ReadCommitIFAttorney.h | 2 +- src/fsfw/datapoollocal/LocalPoolObjectBase.h | 2 +- src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h | 2 +- src/fsfw/devicehandlers/DeviceCommunicationIF.h | 2 +- src/fsfw/devicehandlers/DeviceHandlerBase.h | 2 +- src/fsfw/events/eventmatching/EventMatchTree.h | 2 +- src/fsfw/fdir/ConfirmsFailuresIF.h | 2 +- src/fsfw/fdir/FailureIsolationBase.h | 2 +- src/fsfw/globalfunctions/AsciiConverter.h | 2 +- src/fsfw/globalfunctions/DleEncoder.h | 2 +- src/fsfw/globalfunctions/Type.h | 2 +- src/fsfw/health/HasHealthIF.h | 2 +- src/fsfw/health/HealthHelper.h | 2 +- src/fsfw/health/HealthTableIF.h | 2 +- src/fsfw/ipc/CommandMessageIF.h | 2 +- src/fsfw/ipc/MessageQueueIF.h | 2 +- src/fsfw/ipc/MutexIF.h | 2 +- src/fsfw/memory/HasFileSystemIF.h | 2 +- src/fsfw/memory/HasMemoryIF.h | 2 +- src/fsfw/memory/MemoryHelper.h | 2 +- src/fsfw/modes/HasModesIF.h | 2 +- src/fsfw/modes/ModeHelper.h | 2 +- src/fsfw/monitoring/LimitViolationReporter.h | 2 +- src/fsfw/objectmanager/ObjectManagerIF.h | 2 +- src/fsfw/objectmanager/SystemObjectIF.h | 2 +- src/fsfw/osal/InternalErrorCodes.h | 2 +- src/fsfw/osal/common/TcpIpBase.h | 2 +- src/fsfw/osal/freertos/BinSemaphUsingTask.h | 4 ++-- src/fsfw/osal/freertos/BinarySemaphore.h | 4 ++-- src/fsfw/osal/freertos/TaskFactory.cpp | 2 +- src/fsfw/osal/freertos/TaskManagement.h | 2 +- src/fsfw/osal/host/TaskFactory.cpp | 2 +- src/fsfw/osal/host/taskHelpers.h | 2 +- src/fsfw/osal/linux/BinarySemaphore.h | 4 ++-- src/fsfw/osal/linux/PosixThread.h | 2 +- src/fsfw/osal/linux/TaskFactory.cpp | 2 +- src/fsfw/osal/rtems/FixedTimeslotTask.cpp | 2 +- src/fsfw/osal/rtems/RtemsBasic.h | 2 +- src/fsfw/osal/rtems/TaskFactory.cpp | 2 +- src/fsfw/parameters/HasParametersIF.h | 2 +- src/fsfw/parameters/ParameterWrapper.h | 2 +- src/fsfw/power/Fuse.h | 2 +- src/fsfw/power/PowerSwitchIF.h | 4 ++-- src/fsfw/power/PowerSwitcher.h | 2 +- src/fsfw/pus/Service1TelecommandVerification.h | 2 +- .../returnvalues/{HasReturnvaluesIF.h => returnvalue.h} | 6 +++--- src/fsfw/rmap/RMAP.h | 4 ++-- src/fsfw/rmap/RMAPChannelIF.h | 2 +- src/fsfw/serialize/SerializeAdapter.h | 2 +- src/fsfw/serialize/SerializeIF.h | 2 +- src/fsfw/serviceinterface/ServiceInterfaceBuffer.h | 2 +- src/fsfw/storagemanager/ConstStorageAccessor.h | 2 +- src/fsfw/storagemanager/StorageManagerIF.h | 2 +- src/fsfw/subsystem/SubsystemBase.h | 2 +- src/fsfw/subsystem/modes/ModeStoreIF.h | 2 +- src/fsfw/tasks/ExecutableObjectIF.h | 2 +- src/fsfw/tasks/SemaphoreIF.h | 2 +- src/fsfw/tcdistribution/CFDPDistributor.h | 2 +- src/fsfw/tcdistribution/PUSDistributor.h | 2 +- src/fsfw/tcdistribution/TcDistributor.h | 2 +- src/fsfw/tcdistribution/TcPacketCheckIF.h | 2 +- src/fsfw/tcdistribution/TcPacketCheckPUS.h | 2 +- src/fsfw/thermal/Heater.h | 2 +- src/fsfw/thermal/ThermalComponentIF.h | 2 +- src/fsfw/timemanager/CCSDSTime.h | 2 +- src/fsfw/timemanager/Clock.h | 2 +- src/fsfw/timemanager/TimeStamperIF.h | 2 +- src/fsfw/tmstorage/TmStoreBackendIF.h | 2 +- src/fsfw/tmstorage/TmStoreFrontendIF.h | 2 +- src/fsfw/tmtcpacket/RedirectableDataPointerIF.h | 2 +- src/fsfw/tmtcpacket/SpacePacketBase.h | 2 +- src/fsfw/tmtcpacket/pus/PacketTimestampInterpreterIF.h | 2 +- src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h | 2 +- src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.h | 2 +- src/fsfw/tmtcservices/PusServiceBase.h | 2 +- src/fsfw/tmtcservices/PusVerificationReport.h | 2 +- src/fsfw_hal/common/gpio/GpioCookie.h | 2 +- src/fsfw_hal/common/gpio/GpioIF.h | 2 +- src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp | 2 +- src/fsfw_hal/linux/CommandExecutor.h | 2 +- src/fsfw_hal/linux/UnixFileGuard.h | 2 +- src/fsfw_hal/linux/rpi/GpioRPi.h | 2 +- src/fsfw_hal/linux/spi/spiDefinitions.h | 2 +- src/fsfw_hal/linux/uio/UioMapper.h | 2 +- src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h | 2 +- src/fsfw_hal/stm32h7/spi/spiDefinitions.h | 2 +- src/fsfw_tests/integration/task/TestTask.h | 2 +- src/fsfw_tests/internal/InternalUnitTester.h | 2 +- src/fsfw_tests/internal/UnittDefinitions.h | 2 +- src/fsfw_tests/internal/serialize/IntTestSerialization.h | 2 +- unittests/CatchDefinitions.h | 2 +- unittests/container/TestArrayList.cpp | 2 +- unittests/container/TestDynamicFifo.cpp | 2 +- unittests/container/TestFifo.cpp | 2 +- unittests/container/TestFixedArrayList.cpp | 2 +- unittests/container/TestFixedMap.cpp | 2 +- unittests/container/TestFixedOrderedMultimap.cpp | 2 +- unittests/container/TestPlacementFactory.cpp | 2 +- unittests/devicehandler/DeviceHandlerCommander.h | 2 +- unittests/testcfg/pollingsequence/PollingSequenceFactory.h | 2 +- 119 files changed, 127 insertions(+), 127 deletions(-) rename src/fsfw/returnvalues/{HasReturnvaluesIF.h => returnvalue.h} (81%) diff --git a/docs/api/returnvalue.rst b/docs/api/returnvalue.rst index b0d43916..da65c141 100644 --- a/docs/api/returnvalue.rst +++ b/docs/api/returnvalue.rst @@ -3,7 +3,7 @@ Returnvalue API ================== -.. doxygenfile:: HasReturnvaluesIF.h +.. doxygenfile:: returnvalue.h .. _fwclassids: diff --git a/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.h b/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.h index c5d41b7d..622cc49a 100644 --- a/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.h +++ b/misc/defaultcfg/fsfwconfig/pollingsequence/PollingSequenceFactory.h @@ -1,7 +1,7 @@ #ifndef POLLINGSEQUENCEFACTORY_H_ #define POLLINGSEQUENCEFACTORY_H_ -#include +#include class FixedTimeslotTaskIF; diff --git a/src/fsfw/action/CommandActionHelper.h b/src/fsfw/action/CommandActionHelper.h index a6ec0ca7..55176e09 100644 --- a/src/fsfw/action/CommandActionHelper.h +++ b/src/fsfw/action/CommandActionHelper.h @@ -4,7 +4,7 @@ #include "ActionMessage.h" #include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/objectmanager/ObjectManagerIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/serialize/SerializeIF.h" #include "fsfw/storagemanager/StorageManagerIF.h" diff --git a/src/fsfw/action/CommandsActionsIF.h b/src/fsfw/action/CommandsActionsIF.h index 94d9a7c4..a183051d 100644 --- a/src/fsfw/action/CommandsActionsIF.h +++ b/src/fsfw/action/CommandsActionsIF.h @@ -3,7 +3,7 @@ #include "CommandActionHelper.h" #include "fsfw/ipc/MessageQueueIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * Interface to separate commanding actions of other objects. diff --git a/src/fsfw/action/HasActionsIF.h b/src/fsfw/action/HasActionsIF.h index 45247d1a..29e267a0 100644 --- a/src/fsfw/action/HasActionsIF.h +++ b/src/fsfw/action/HasActionsIF.h @@ -5,7 +5,7 @@ #include "ActionMessage.h" #include "SimpleActionHelper.h" #include "fsfw/ipc/MessageQueueIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * @brief diff --git a/src/fsfw/cfdp/CFDPHandler.h b/src/fsfw/cfdp/CFDPHandler.h index 6888f9d7..53a8a009 100644 --- a/src/fsfw/cfdp/CFDPHandler.h +++ b/src/fsfw/cfdp/CFDPHandler.h @@ -3,7 +3,7 @@ #include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/objectmanager/SystemObject.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw/tcdistribution/CFDPDistributor.h" #include "fsfw/tmtcservices/AcceptsTelecommandsIF.h" diff --git a/src/fsfw/cfdp/definitions.h b/src/fsfw/cfdp/definitions.h index b8827f63..7aad21e7 100644 --- a/src/fsfw/cfdp/definitions.h +++ b/src/fsfw/cfdp/definitions.h @@ -7,7 +7,7 @@ #include #include "fsfw/returnvalues/FwClassIds.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" namespace cfdp { diff --git a/src/fsfw/container/ArrayList.h b/src/fsfw/container/ArrayList.h index 608e7e55..f5f74cf1 100644 --- a/src/fsfw/container/ArrayList.h +++ b/src/fsfw/container/ArrayList.h @@ -1,7 +1,7 @@ #ifndef FSFW_CONTAINER_ARRAYLIST_H_ #define FSFW_CONTAINER_ARRAYLIST_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../serialize/SerializeAdapter.h" #include "../serialize/SerializeIF.h" diff --git a/src/fsfw/container/FIFOBase.h b/src/fsfw/container/FIFOBase.h index 7c51bc39..bb92790c 100644 --- a/src/fsfw/container/FIFOBase.h +++ b/src/fsfw/container/FIFOBase.h @@ -4,7 +4,7 @@ #include #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" template class FIFOBase { diff --git a/src/fsfw/container/FixedMap.h b/src/fsfw/container/FixedMap.h index c6b2c9b5..def219d1 100644 --- a/src/fsfw/container/FixedMap.h +++ b/src/fsfw/container/FixedMap.h @@ -4,7 +4,7 @@ #include #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "ArrayList.h" /** diff --git a/src/fsfw/container/IndexedRingMemoryArray.h b/src/fsfw/container/IndexedRingMemoryArray.h index 4ad72592..127ed5d7 100644 --- a/src/fsfw/container/IndexedRingMemoryArray.h +++ b/src/fsfw/container/IndexedRingMemoryArray.h @@ -4,7 +4,7 @@ #include #include "../globalfunctions/CRC.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../serialize/SerialArrayListAdapter.h" #include "../serviceinterface/ServiceInterfaceStream.h" #include "ArrayList.h" diff --git a/src/fsfw/container/RingBufferBase.h b/src/fsfw/container/RingBufferBase.h index 77a0583b..e86f0ee1 100644 --- a/src/fsfw/container/RingBufferBase.h +++ b/src/fsfw/container/RingBufferBase.h @@ -3,7 +3,7 @@ #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" template class RingBufferBase { diff --git a/src/fsfw/coordinates/Sgp4Propagator.h b/src/fsfw/coordinates/Sgp4Propagator.h index 0edaf459..5cbeb3f2 100644 --- a/src/fsfw/coordinates/Sgp4Propagator.h +++ b/src/fsfw/coordinates/Sgp4Propagator.h @@ -7,7 +7,7 @@ #ifndef PLATFORM_WIN #include #endif -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw_contrib/sgp4/sgp4unit.h" class Sgp4Propagator { diff --git a/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h b/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h index 22ff12e4..71d14e60 100644 --- a/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +++ b/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h @@ -9,12 +9,12 @@ #define CCSDSRETURNVALUESIF_H_ #include "dllConf.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * This is a helper class to collect special return values that come up during CCSDS Handling. * @ingroup ccsds_handling */ -class CCSDSReturnValuesIF : public HasReturnvaluesIF { +class CCSDSReturnValuesIF { public: static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_HANDLER_IF; //!< Basic ID of the interface. diff --git a/src/fsfw/datalinklayer/MapPacketExtraction.h b/src/fsfw/datalinklayer/MapPacketExtraction.h index 6586722c..fab7f3c3 100644 --- a/src/fsfw/datalinklayer/MapPacketExtraction.h +++ b/src/fsfw/datalinklayer/MapPacketExtraction.h @@ -5,7 +5,7 @@ #include "dllConf.h" #include "fsfw/ipc/MessageQueueSenderIF.h" #include "fsfw/objectmanager/ObjectManagerIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" class StorageManagerIF; diff --git a/src/fsfw/datalinklayer/VirtualChannelReceptionIF.h b/src/fsfw/datalinklayer/VirtualChannelReceptionIF.h index 8874909b..9239ee0e 100644 --- a/src/fsfw/datalinklayer/VirtualChannelReceptionIF.h +++ b/src/fsfw/datalinklayer/VirtualChannelReceptionIF.h @@ -11,7 +11,7 @@ #include "ClcwIF.h" #include "TcTransferFrame.h" #include "dllConf.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * This is the interface for Virtual Channel reception classes. diff --git a/src/fsfw/datapool/DataSetIF.h b/src/fsfw/datapool/DataSetIF.h index 492bcf29..3d4be351 100644 --- a/src/fsfw/datapool/DataSetIF.h +++ b/src/fsfw/datapool/DataSetIF.h @@ -1,7 +1,7 @@ #ifndef FSFW_DATAPOOL_DATASETIF_H_ #define FSFW_DATAPOOL_DATASETIF_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../timemanager/Clock.h" class PoolVariableIF; diff --git a/src/fsfw/datapool/PoolVariableIF.h b/src/fsfw/datapool/PoolVariableIF.h index 95cf898e..69074310 100644 --- a/src/fsfw/datapool/PoolVariableIF.h +++ b/src/fsfw/datapool/PoolVariableIF.h @@ -1,7 +1,7 @@ #ifndef FSFW_DATAPOOL_POOLVARIABLEIF_H_ #define FSFW_DATAPOOL_POOLVARIABLEIF_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../serialize/SerializeIF.h" #include "ReadCommitIF.h" diff --git a/src/fsfw/datapool/ReadCommitIF.h b/src/fsfw/datapool/ReadCommitIF.h index 08554be1..ca074dec 100644 --- a/src/fsfw/datapool/ReadCommitIF.h +++ b/src/fsfw/datapool/ReadCommitIF.h @@ -2,7 +2,7 @@ #define FSFW_DATAPOOL_READCOMMITIF_H_ #include "../ipc/MutexIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" /** * @brief Common interface for all software objects which employ read-commit diff --git a/src/fsfw/datapool/ReadCommitIFAttorney.h b/src/fsfw/datapool/ReadCommitIFAttorney.h index 361ac6e4..cca76c97 100644 --- a/src/fsfw/datapool/ReadCommitIFAttorney.h +++ b/src/fsfw/datapool/ReadCommitIFAttorney.h @@ -2,7 +2,7 @@ #define FSFW_DATAPOOL_READCOMMITIFATTORNEY_H_ #include -#include +#include /** * @brief This class determines which members are allowed to access protected members diff --git a/src/fsfw/datapoollocal/LocalPoolObjectBase.h b/src/fsfw/datapoollocal/LocalPoolObjectBase.h index f454fea3..a4ecbd55 100644 --- a/src/fsfw/datapoollocal/LocalPoolObjectBase.h +++ b/src/fsfw/datapoollocal/LocalPoolObjectBase.h @@ -4,7 +4,7 @@ #include "MarkChangedIF.h" #include "fsfw/datapool/PoolVariableIF.h" #include "fsfw/objectmanager/SystemObjectIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "localPoolDefinitions.h" class LocalDataPoolManager; diff --git a/src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h b/src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h index 1f13a09d..eb4e55b7 100644 --- a/src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h +++ b/src/fsfw/datapoollocal/ProvidesDataPoolSubscriptionIF.h @@ -2,7 +2,7 @@ #define FSFW_DATAPOOLLOCAL_PROVIDESDATAPOOLSUBSCRIPTION_H_ #include "../ipc/messageQueueDefinitions.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "localPoolDefinitions.h" class ProvidesDataPoolSubscriptionIF { diff --git a/src/fsfw/devicehandlers/DeviceCommunicationIF.h b/src/fsfw/devicehandlers/DeviceCommunicationIF.h index cf00a8e2..a5546a36 100644 --- a/src/fsfw/devicehandlers/DeviceCommunicationIF.h +++ b/src/fsfw/devicehandlers/DeviceCommunicationIF.h @@ -1,7 +1,7 @@ #ifndef FSFW_DEVICES_DEVICECOMMUNICATIONIF_H_ #define FSFW_DEVICES_DEVICECOMMUNICATIONIF_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "CookieIF.h" #include "DeviceHandlerIF.h" /** diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.h b/src/fsfw/devicehandlers/DeviceHandlerBase.h index a37a4740..a20eae0c 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -18,7 +18,7 @@ #include "fsfw/objectmanager/SystemObject.h" #include "fsfw/parameters/ParameterHelper.h" #include "fsfw/power/PowerSwitchIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/serviceInterfaceDefintions.h" #include "fsfw/tasks/ExecutableObjectIF.h" diff --git a/src/fsfw/events/eventmatching/EventMatchTree.h b/src/fsfw/events/eventmatching/EventMatchTree.h index 7561e27d..0d06f0c2 100644 --- a/src/fsfw/events/eventmatching/EventMatchTree.h +++ b/src/fsfw/events/eventmatching/EventMatchTree.h @@ -4,7 +4,7 @@ #include "../../container/PlacementFactory.h" #include "../../events/EventMessage.h" #include "../../globalfunctions/matching/MatchTree.h" -#include "../../returnvalues/HasReturnvaluesIF.h" +#include "../../returnvalues/returnvalue.h" class StorageManagerIF; class EventMatchTree : public MatchTree { diff --git a/src/fsfw/fdir/ConfirmsFailuresIF.h b/src/fsfw/fdir/ConfirmsFailuresIF.h index e4d26907..4424747e 100644 --- a/src/fsfw/fdir/ConfirmsFailuresIF.h +++ b/src/fsfw/fdir/ConfirmsFailuresIF.h @@ -2,7 +2,7 @@ #define FRAMEWORK_FDIR_CONFIRMSFAILURESIF_H_ #include "../ipc/MessageQueueSenderIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" class ConfirmsFailuresIF { public: diff --git a/src/fsfw/fdir/FailureIsolationBase.h b/src/fsfw/fdir/FailureIsolationBase.h index 543d9fca..7ebfa9af 100644 --- a/src/fsfw/fdir/FailureIsolationBase.h +++ b/src/fsfw/fdir/FailureIsolationBase.h @@ -5,7 +5,7 @@ #include "../health/HealthMessage.h" #include "../ipc/MessageQueueIF.h" #include "../parameters/HasParametersIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "ConfirmsFailuresIF.h" #include "FaultCounter.h" diff --git a/src/fsfw/globalfunctions/AsciiConverter.h b/src/fsfw/globalfunctions/AsciiConverter.h index 7eb28882..e6cd60a7 100644 --- a/src/fsfw/globalfunctions/AsciiConverter.h +++ b/src/fsfw/globalfunctions/AsciiConverter.h @@ -1,7 +1,7 @@ #ifndef ASCIICONVERTER_H_ #define ASCIICONVERTER_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" class AsciiConverter { public: diff --git a/src/fsfw/globalfunctions/DleEncoder.h b/src/fsfw/globalfunctions/DleEncoder.h index 85656b37..b7242ebe 100644 --- a/src/fsfw/globalfunctions/DleEncoder.h +++ b/src/fsfw/globalfunctions/DleEncoder.h @@ -3,7 +3,7 @@ #include -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * @brief This DLE Encoder (Data Link Encoder) can be used to encode and diff --git a/src/fsfw/globalfunctions/Type.h b/src/fsfw/globalfunctions/Type.h index 385d7219..918ba4e8 100644 --- a/src/fsfw/globalfunctions/Type.h +++ b/src/fsfw/globalfunctions/Type.h @@ -3,7 +3,7 @@ #include -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/serialize/SerializeIF.h" /** diff --git a/src/fsfw/health/HasHealthIF.h b/src/fsfw/health/HasHealthIF.h index 41abeef3..77a1c12f 100644 --- a/src/fsfw/health/HasHealthIF.h +++ b/src/fsfw/health/HasHealthIF.h @@ -3,7 +3,7 @@ #include "../events/Event.h" #include "../ipc/MessageQueueSenderIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" class HasHealthIF { public: diff --git a/src/fsfw/health/HealthHelper.h b/src/fsfw/health/HealthHelper.h index 84985559..6b550f90 100644 --- a/src/fsfw/health/HealthHelper.h +++ b/src/fsfw/health/HealthHelper.h @@ -5,7 +5,7 @@ #include "../events/EventReportingProxyIF.h" #include "../ipc/MessageQueueIF.h" #include "../objectmanager/ObjectManagerIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "HasHealthIF.h" #include "HealthMessage.h" #include "HealthTableIF.h" diff --git a/src/fsfw/health/HealthTableIF.h b/src/fsfw/health/HealthTableIF.h index aab3f0eb..0b993691 100644 --- a/src/fsfw/health/HealthTableIF.h +++ b/src/fsfw/health/HealthTableIF.h @@ -4,7 +4,7 @@ #include #include "../objectmanager/ObjectManagerIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "ManagesHealthIF.h" class HealthTableIF : public ManagesHealthIF { diff --git a/src/fsfw/ipc/CommandMessageIF.h b/src/fsfw/ipc/CommandMessageIF.h index aea08203..dc8f7109 100644 --- a/src/fsfw/ipc/CommandMessageIF.h +++ b/src/fsfw/ipc/CommandMessageIF.h @@ -1,7 +1,7 @@ #ifndef FSFW_IPC_COMMANDMESSAGEIF_H_ #define FSFW_IPC_COMMANDMESSAGEIF_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "FwMessageTypes.h" #include "MessageQueueMessageIF.h" diff --git a/src/fsfw/ipc/MessageQueueIF.h b/src/fsfw/ipc/MessageQueueIF.h index b229747e..4fe8a63b 100644 --- a/src/fsfw/ipc/MessageQueueIF.h +++ b/src/fsfw/ipc/MessageQueueIF.h @@ -5,7 +5,7 @@ #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "MessageQueueMessageIF.h" #include "messageQueueDefinitions.h" diff --git a/src/fsfw/ipc/MutexIF.h b/src/fsfw/ipc/MutexIF.h index 0bdfa1f4..30992f7b 100644 --- a/src/fsfw/ipc/MutexIF.h +++ b/src/fsfw/ipc/MutexIF.h @@ -1,7 +1,7 @@ #ifndef FRAMEWORK_IPC_MUTEXIF_H_ #define FRAMEWORK_IPC_MUTEXIF_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" /** * @brief Common interface for OS Mutex objects which provide MUTual EXclusion. diff --git a/src/fsfw/memory/HasFileSystemIF.h b/src/fsfw/memory/HasFileSystemIF.h index 88a7db83..4c081e26 100644 --- a/src/fsfw/memory/HasFileSystemIF.h +++ b/src/fsfw/memory/HasFileSystemIF.h @@ -6,7 +6,7 @@ #include "FileSystemArgsIF.h" #include "fsfw/ipc/messageQueueDefinitions.h" #include "fsfw/returnvalues/FwClassIds.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * @brief Generic interface for objects which expose a file system to enable diff --git a/src/fsfw/memory/HasMemoryIF.h b/src/fsfw/memory/HasMemoryIF.h index 342f7115..b39032af 100644 --- a/src/fsfw/memory/HasMemoryIF.h +++ b/src/fsfw/memory/HasMemoryIF.h @@ -1,7 +1,7 @@ #ifndef HASMEMORYIF_H_ #define HASMEMORYIF_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" class HasMemoryIF { public: diff --git a/src/fsfw/memory/MemoryHelper.h b/src/fsfw/memory/MemoryHelper.h index 3a51f7dc..095b366f 100644 --- a/src/fsfw/memory/MemoryHelper.h +++ b/src/fsfw/memory/MemoryHelper.h @@ -3,7 +3,7 @@ #include "../ipc/CommandMessage.h" #include "../ipc/MessageQueueIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../storagemanager/StorageManagerIF.h" #include "AcceptsMemoryMessagesIF.h" diff --git a/src/fsfw/modes/HasModesIF.h b/src/fsfw/modes/HasModesIF.h index 03cc45bf..599975f8 100644 --- a/src/fsfw/modes/HasModesIF.h +++ b/src/fsfw/modes/HasModesIF.h @@ -4,7 +4,7 @@ #include #include "../events/Event.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "ModeHelper.h" #include "ModeMessage.h" diff --git a/src/fsfw/modes/ModeHelper.h b/src/fsfw/modes/ModeHelper.h index 4d0479db..a84408a2 100644 --- a/src/fsfw/modes/ModeHelper.h +++ b/src/fsfw/modes/ModeHelper.h @@ -3,7 +3,7 @@ #include "ModeMessage.h" #include "fsfw/ipc/MessageQueueIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/timemanager/Countdown.h" class HasModesIF; diff --git a/src/fsfw/monitoring/LimitViolationReporter.h b/src/fsfw/monitoring/LimitViolationReporter.h index 06b3ba74..12747725 100644 --- a/src/fsfw/monitoring/LimitViolationReporter.h +++ b/src/fsfw/monitoring/LimitViolationReporter.h @@ -8,7 +8,7 @@ #define LIMITVIOLATIONREPORTER_H_ #include "../ipc/MessageQueueSenderIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../serialize/SerializeIF.h" #include "../storagemanager/StorageManagerIF.h" #include "monitoringConf.h" diff --git a/src/fsfw/objectmanager/ObjectManagerIF.h b/src/fsfw/objectmanager/ObjectManagerIF.h index eae35319..81ddd95a 100644 --- a/src/fsfw/objectmanager/ObjectManagerIF.h +++ b/src/fsfw/objectmanager/ObjectManagerIF.h @@ -1,7 +1,7 @@ #ifndef FSFW_OBJECTMANAGER_OBJECTMANAGERIF_H_ #define FSFW_OBJECTMANAGER_OBJECTMANAGERIF_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../serviceinterface/ServiceInterface.h" #include "SystemObjectIF.h" #include "frameworkObjects.h" diff --git a/src/fsfw/objectmanager/SystemObjectIF.h b/src/fsfw/objectmanager/SystemObjectIF.h index 25065662..490de20b 100644 --- a/src/fsfw/objectmanager/SystemObjectIF.h +++ b/src/fsfw/objectmanager/SystemObjectIF.h @@ -4,7 +4,7 @@ #include #include "../events/EventReportingProxyIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" /** * @defgroup system_objects Software System Object Management * The classes to create System Objects and classes to manage these are diff --git a/src/fsfw/osal/InternalErrorCodes.h b/src/fsfw/osal/InternalErrorCodes.h index 5924d4c9..abec460f 100644 --- a/src/fsfw/osal/InternalErrorCodes.h +++ b/src/fsfw/osal/InternalErrorCodes.h @@ -1,7 +1,7 @@ #ifndef INTERNALERRORCODES_H_ #define INTERNALERRORCODES_H_ -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" class InternalErrorCodes { public: diff --git a/src/fsfw/osal/common/TcpIpBase.h b/src/fsfw/osal/common/TcpIpBase.h index ccbd12ca..6cc71fbf 100644 --- a/src/fsfw/osal/common/TcpIpBase.h +++ b/src/fsfw/osal/common/TcpIpBase.h @@ -2,7 +2,7 @@ #define FSFW_OSAL_COMMON_TCPIPIF_H_ #include "../../platform.h" -#include "../../returnvalues/HasReturnvaluesIF.h" +#include "../../returnvalues/returnvalue.h" #ifdef PLATFORM_WIN #include diff --git a/src/fsfw/osal/freertos/BinSemaphUsingTask.h b/src/fsfw/osal/freertos/BinSemaphUsingTask.h index b29ecdc9..480296ee 100644 --- a/src/fsfw/osal/freertos/BinSemaphUsingTask.h +++ b/src/fsfw/osal/freertos/BinSemaphUsingTask.h @@ -2,7 +2,7 @@ #define FSFW_OSAL_FREERTOS_BINSEMAPHUSINGTASK_H_ #include "FreeRTOS.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/SemaphoreIF.h" #include "task.h" @@ -20,7 +20,7 @@ * (for example in the initializeAfterTaskCreation() function) or * by calling refreshTaskHandle() with the correct executing task. */ -class BinarySemaphoreUsingTask : public SemaphoreIF, public HasReturnvaluesIF { +class BinarySemaphoreUsingTask : public SemaphoreIF { public: static const uint8_t INTERFACE_ID = CLASS_ID::SEMAPHORE_IF; diff --git a/src/fsfw/osal/freertos/BinarySemaphore.h b/src/fsfw/osal/freertos/BinarySemaphore.h index d7fbf351..bd1148ec 100644 --- a/src/fsfw/osal/freertos/BinarySemaphore.h +++ b/src/fsfw/osal/freertos/BinarySemaphore.h @@ -2,7 +2,7 @@ #define FSFW_OSAL_FREERTOS_BINARYSEMPAHORE_H_ #include "FreeRTOS.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/SemaphoreIF.h" #include "semphr.h" @@ -22,7 +22,7 @@ * @author R. Mueller * @ingroup osal */ -class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { +class BinarySemaphore : public SemaphoreIF { public: static const uint8_t INTERFACE_ID = CLASS_ID::SEMAPHORE_IF; diff --git a/src/fsfw/osal/freertos/TaskFactory.cpp b/src/fsfw/osal/freertos/TaskFactory.cpp index c79a6cf1..688069cf 100644 --- a/src/fsfw/osal/freertos/TaskFactory.cpp +++ b/src/fsfw/osal/freertos/TaskFactory.cpp @@ -2,7 +2,7 @@ #include "fsfw/osal/freertos/FixedTimeslotTask.h" #include "fsfw/osal/freertos/PeriodicTask.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" TaskFactory* TaskFactory::factoryInstance = new TaskFactory(); diff --git a/src/fsfw/osal/freertos/TaskManagement.h b/src/fsfw/osal/freertos/TaskManagement.h index 825d8865..6dec15cc 100644 --- a/src/fsfw/osal/freertos/TaskManagement.h +++ b/src/fsfw/osal/freertos/TaskManagement.h @@ -3,7 +3,7 @@ #include -#include "../../returnvalues/HasReturnvaluesIF.h" +#include "../../returnvalues/returnvalue.h" #include "FreeRTOS.h" #include "task.h" diff --git a/src/fsfw/osal/host/TaskFactory.cpp b/src/fsfw/osal/host/TaskFactory.cpp index e9415f5a..0a27241b 100644 --- a/src/fsfw/osal/host/TaskFactory.cpp +++ b/src/fsfw/osal/host/TaskFactory.cpp @@ -5,7 +5,7 @@ #include "fsfw/osal/host/FixedTimeslotTask.h" #include "fsfw/osal/host/PeriodicTask.h" #include "fsfw/osal/host/taskHelpers.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/tasks/PeriodicTaskIF.h" diff --git a/src/fsfw/osal/host/taskHelpers.h b/src/fsfw/osal/host/taskHelpers.h index 13a71d16..7d9ff33c 100644 --- a/src/fsfw/osal/host/taskHelpers.h +++ b/src/fsfw/osal/host/taskHelpers.h @@ -1,7 +1,7 @@ #ifndef FSFW_OSAL_HOST_TASKHELPERS_H_ #define FSFW_OSAL_HOST_TASKHELPERS_H_ -#include +#include #include diff --git a/src/fsfw/osal/linux/BinarySemaphore.h b/src/fsfw/osal/linux/BinarySemaphore.h index c7289712..fe2c0db0 100644 --- a/src/fsfw/osal/linux/BinarySemaphore.h +++ b/src/fsfw/osal/linux/BinarySemaphore.h @@ -1,7 +1,7 @@ #ifndef FRAMEWORK_OSAL_LINUX_BINARYSEMPAHORE_H_ #define FRAMEWORK_OSAL_LINUX_BINARYSEMPAHORE_H_ -#include "../../returnvalues/HasReturnvaluesIF.h" +#include "../../returnvalues/returnvalue.h" #include "../../tasks/SemaphoreIF.h" extern "C" { @@ -17,7 +17,7 @@ extern "C" { * @author R. Mueller * @ingroup osal */ -class BinarySemaphore : public SemaphoreIF, public HasReturnvaluesIF { +class BinarySemaphore : public SemaphoreIF { public: static const uint8_t INTERFACE_ID = CLASS_ID::SEMAPHORE_IF; diff --git a/src/fsfw/osal/linux/PosixThread.h b/src/fsfw/osal/linux/PosixThread.h index 78fdfa2b..add41bf6 100644 --- a/src/fsfw/osal/linux/PosixThread.h +++ b/src/fsfw/osal/linux/PosixThread.h @@ -7,7 +7,7 @@ #include -#include "../../returnvalues/HasReturnvaluesIF.h" +#include "../../returnvalues/returnvalue.h" class PosixThread { public: diff --git a/src/fsfw/osal/linux/TaskFactory.cpp b/src/fsfw/osal/linux/TaskFactory.cpp index 2cd4fd67..bacc4311 100644 --- a/src/fsfw/osal/linux/TaskFactory.cpp +++ b/src/fsfw/osal/linux/TaskFactory.cpp @@ -2,7 +2,7 @@ #include "fsfw/osal/linux/FixedTimeslotTask.h" #include "fsfw/osal/linux/PeriodicPosixTask.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/serviceinterface/ServiceInterface.h" // TODO: Different variant than the lazy loading in QueueFactory. What's better and why? diff --git a/src/fsfw/osal/rtems/FixedTimeslotTask.cpp b/src/fsfw/osal/rtems/FixedTimeslotTask.cpp index 77582d75..c1cc4460 100644 --- a/src/fsfw/osal/rtems/FixedTimeslotTask.cpp +++ b/src/fsfw/osal/rtems/FixedTimeslotTask.cpp @@ -6,7 +6,7 @@ #include #include "fsfw/osal/rtems/RtemsBasic.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/serviceinterface/ServiceInterface.h" #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/src/fsfw/osal/rtems/RtemsBasic.h b/src/fsfw/osal/rtems/RtemsBasic.h index 3525799c..ea97c3af 100644 --- a/src/fsfw/osal/rtems/RtemsBasic.h +++ b/src/fsfw/osal/rtems/RtemsBasic.h @@ -8,7 +8,7 @@ #include -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" class RtemsBasic { public: diff --git a/src/fsfw/osal/rtems/TaskFactory.cpp b/src/fsfw/osal/rtems/TaskFactory.cpp index f10e5cf3..4dbd254e 100644 --- a/src/fsfw/osal/rtems/TaskFactory.cpp +++ b/src/fsfw/osal/rtems/TaskFactory.cpp @@ -3,7 +3,7 @@ #include "fsfw/osal/rtems/FixedTimeslotTask.h" #include "fsfw/osal/rtems/PeriodicTask.h" #include "fsfw/osal/rtems/RtemsBasic.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" // TODO: Different variant than the lazy loading in QueueFactory. What's better and why? TaskFactory* TaskFactory::factoryInstance = new TaskFactory(); diff --git a/src/fsfw/parameters/HasParametersIF.h b/src/fsfw/parameters/HasParametersIF.h index 48557b4a..d586ceba 100644 --- a/src/fsfw/parameters/HasParametersIF.h +++ b/src/fsfw/parameters/HasParametersIF.h @@ -3,7 +3,7 @@ #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "ParameterWrapper.h" /** diff --git a/src/fsfw/parameters/ParameterWrapper.h b/src/fsfw/parameters/ParameterWrapper.h index 5a8e20a4..7767255e 100644 --- a/src/fsfw/parameters/ParameterWrapper.h +++ b/src/fsfw/parameters/ParameterWrapper.h @@ -4,7 +4,7 @@ #include #include "../globalfunctions/Type.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../serialize/SerializeAdapter.h" #include "../serialize/SerializeIF.h" diff --git a/src/fsfw/power/Fuse.h b/src/fsfw/power/Fuse.h index 1f880f3a..e8b86cfd 100644 --- a/src/fsfw/power/Fuse.h +++ b/src/fsfw/power/Fuse.h @@ -7,7 +7,7 @@ #include "../devicehandlers/HealthDevice.h" #include "../monitoring/AbsLimitMonitor.h" #include "../parameters/ParameterHelper.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "PowerComponentIF.h" #include "PowerSwitchIF.h" namespace Factory { diff --git a/src/fsfw/power/PowerSwitchIF.h b/src/fsfw/power/PowerSwitchIF.h index 054923f4..e8c9aff4 100644 --- a/src/fsfw/power/PowerSwitchIF.h +++ b/src/fsfw/power/PowerSwitchIF.h @@ -2,7 +2,7 @@ #define FSFW_POWER_POWERSWITCHIF_H_ #include "../events/Event.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "definitions.h" /** * @@ -20,7 +20,7 @@ class PowerSwitchIF { */ virtual ~PowerSwitchIF() {} /** - * The Returnvalues id of this class, required by HasReturnvaluesIF + * The Returnvalues id of this class */ static const uint8_t INTERFACE_ID = CLASS_ID::POWER_SWITCH_IF; static const ReturnValue_t SWITCH_ON = MAKE_RETURN_CODE(1); diff --git a/src/fsfw/power/PowerSwitcher.h b/src/fsfw/power/PowerSwitcher.h index 7aa60494..7a38336c 100644 --- a/src/fsfw/power/PowerSwitcher.h +++ b/src/fsfw/power/PowerSwitcher.h @@ -2,7 +2,7 @@ #define FSFW_POWER_POWERSWITCHER_H_ #include "../objectmanager/SystemObjectIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../timemanager/Countdown.h" #include "PowerSwitchIF.h" diff --git a/src/fsfw/pus/Service1TelecommandVerification.h b/src/fsfw/pus/Service1TelecommandVerification.h index 02a5e513..d921b48c 100644 --- a/src/fsfw/pus/Service1TelecommandVerification.h +++ b/src/fsfw/pus/Service1TelecommandVerification.h @@ -3,7 +3,7 @@ #include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/objectmanager/SystemObject.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw/tmtcservices/AcceptsVerifyMessageIF.h" #include "fsfw/tmtcservices/PusVerificationReport.h" diff --git a/src/fsfw/returnvalues/HasReturnvaluesIF.h b/src/fsfw/returnvalues/returnvalue.h similarity index 81% rename from src/fsfw/returnvalues/HasReturnvaluesIF.h rename to src/fsfw/returnvalues/returnvalue.h index 79a0d9bd..c7927a8d 100644 --- a/src/fsfw/returnvalues/HasReturnvaluesIF.h +++ b/src/fsfw/returnvalues/returnvalue.h @@ -1,5 +1,5 @@ -#ifndef FSFW_RETURNVALUES_HASRETURNVALUESIF_H_ -#define FSFW_RETURNVALUES_HASRETURNVALUESIF_H_ +#ifndef FSFW_RETURNVALUES_RETURNVALUE_H_ +#define FSFW_RETURNVALUES_RETURNVALUE_H_ #include @@ -29,4 +29,4 @@ static constexpr ReturnValue_t makeCode( } -#endif /* FSFW_RETURNVALUES_HASRETURNVALUESIF_H_ */ +#endif /* FSFW_RETURNVALUES_RETURNVALUE_H_ */ diff --git a/src/fsfw/rmap/RMAP.h b/src/fsfw/rmap/RMAP.h index d274fb15..df6eaf5e 100644 --- a/src/fsfw/rmap/RMAP.h +++ b/src/fsfw/rmap/RMAP.h @@ -1,7 +1,7 @@ #ifndef FSFW_RMAP_RMAP_H_ #define FSFW_RMAP_RMAP_H_ -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/rmap/RMAPCookie.h" #include "rmapConf.h" @@ -36,7 +36,7 @@ * assignment can be changed at runtime to allow for example redundancy switching. This API is * static as the information which channel to use is contained within the cookie. */ -class RMAP : public HasReturnvaluesIF { +class RMAP { public: static const uint8_t INTERFACE_ID = CLASS_ID::RMAP_CHANNEL; diff --git a/src/fsfw/rmap/RMAPChannelIF.h b/src/fsfw/rmap/RMAPChannelIF.h index aea08c86..60d439d0 100644 --- a/src/fsfw/rmap/RMAPChannelIF.h +++ b/src/fsfw/rmap/RMAPChannelIF.h @@ -4,7 +4,7 @@ #include #include "RMAPCookie.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "rmapConf.h" class RMAPChannelIF { diff --git a/src/fsfw/serialize/SerializeAdapter.h b/src/fsfw/serialize/SerializeAdapter.h index cc06aa80..bca0e637 100644 --- a/src/fsfw/serialize/SerializeAdapter.h +++ b/src/fsfw/serialize/SerializeAdapter.h @@ -4,7 +4,7 @@ #include #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "EndianConverter.h" #include "SerializeIF.h" diff --git a/src/fsfw/serialize/SerializeIF.h b/src/fsfw/serialize/SerializeIF.h index 0e9840eb..85c29827 100644 --- a/src/fsfw/serialize/SerializeIF.h +++ b/src/fsfw/serialize/SerializeIF.h @@ -3,7 +3,7 @@ #include -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * @defgroup serialize Serialization diff --git a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.h b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.h index 9cda75c6..2ecf88d8 100644 --- a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.h +++ b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.h @@ -3,7 +3,7 @@ #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/src/fsfw/storagemanager/ConstStorageAccessor.h b/src/fsfw/storagemanager/ConstStorageAccessor.h index a2ddad6c..9cad346c 100644 --- a/src/fsfw/storagemanager/ConstStorageAccessor.h +++ b/src/fsfw/storagemanager/ConstStorageAccessor.h @@ -3,7 +3,7 @@ #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "storeAddress.h" class StorageManagerIF; diff --git a/src/fsfw/storagemanager/StorageManagerIF.h b/src/fsfw/storagemanager/StorageManagerIF.h index 66002ca9..4041c84b 100644 --- a/src/fsfw/storagemanager/StorageManagerIF.h +++ b/src/fsfw/storagemanager/StorageManagerIF.h @@ -5,7 +5,7 @@ #include #include "../events/Event.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "StorageAccessor.h" #include "storeAddress.h" diff --git a/src/fsfw/subsystem/SubsystemBase.h b/src/fsfw/subsystem/SubsystemBase.h index f61340ac..6db9efa5 100644 --- a/src/fsfw/subsystem/SubsystemBase.h +++ b/src/fsfw/subsystem/SubsystemBase.h @@ -9,7 +9,7 @@ #include "../ipc/MessageQueueIF.h" #include "../modes/HasModesIF.h" #include "../objectmanager/SystemObject.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../tasks/ExecutableObjectIF.h" #include "modes/HasModeSequenceIF.h" diff --git a/src/fsfw/subsystem/modes/ModeStoreIF.h b/src/fsfw/subsystem/modes/ModeStoreIF.h index 79215971..3d56f992 100644 --- a/src/fsfw/subsystem/modes/ModeStoreIF.h +++ b/src/fsfw/subsystem/modes/ModeStoreIF.h @@ -7,7 +7,7 @@ #include "../../container/ArrayList.h" #include "../../container/SinglyLinkedList.h" -#include "../../returnvalues/HasReturnvaluesIF.h" +#include "../../returnvalues/returnvalue.h" #include "ModeDefinitions.h" class ModeStoreIF { diff --git a/src/fsfw/tasks/ExecutableObjectIF.h b/src/fsfw/tasks/ExecutableObjectIF.h index 60f38259..1e3f19e4 100644 --- a/src/fsfw/tasks/ExecutableObjectIF.h +++ b/src/fsfw/tasks/ExecutableObjectIF.h @@ -5,7 +5,7 @@ class PeriodicTaskIF; #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" /** * @brief The interface provides a method to execute objects within a task. * @details The performOperation method, that is required by the interface is diff --git a/src/fsfw/tasks/SemaphoreIF.h b/src/fsfw/tasks/SemaphoreIF.h index 37275529..9a692e9b 100644 --- a/src/fsfw/tasks/SemaphoreIF.h +++ b/src/fsfw/tasks/SemaphoreIF.h @@ -3,7 +3,7 @@ #include #include "../returnvalues/FwClassIds.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" /** * @brief Generic interface for semaphores, which can be used to achieve diff --git a/src/fsfw/tcdistribution/CFDPDistributor.h b/src/fsfw/tcdistribution/CFDPDistributor.h index 2a901021..18c139ff 100644 --- a/src/fsfw/tcdistribution/CFDPDistributor.h +++ b/src/fsfw/tcdistribution/CFDPDistributor.h @@ -3,7 +3,7 @@ #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "../tmtcpacket/cfdp/CFDPPacketStored.h" #include "../tmtcservices/AcceptsTelecommandsIF.h" #include "../tmtcservices/VerificationReporter.h" diff --git a/src/fsfw/tcdistribution/PUSDistributor.h b/src/fsfw/tcdistribution/PUSDistributor.h index c069c81b..8cef0f46 100644 --- a/src/fsfw/tcdistribution/PUSDistributor.h +++ b/src/fsfw/tcdistribution/PUSDistributor.h @@ -4,7 +4,7 @@ #include "PUSDistributorIF.h" #include "TcDistributor.h" #include "TcPacketCheckPUS.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tmtcpacket/pus/tc.h" #include "fsfw/tmtcservices/AcceptsTelecommandsIF.h" #include "fsfw/tmtcservices/VerificationReporter.h" diff --git a/src/fsfw/tcdistribution/TcDistributor.h b/src/fsfw/tcdistribution/TcDistributor.h index 62cd5dc9..d018cad4 100644 --- a/src/fsfw/tcdistribution/TcDistributor.h +++ b/src/fsfw/tcdistribution/TcDistributor.h @@ -6,7 +6,7 @@ #include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/objectmanager/ObjectManagerIF.h" #include "fsfw/objectmanager/SystemObject.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/storagemanager/StorageManagerIF.h" #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw/tmtcservices/TmTcMessage.h" diff --git a/src/fsfw/tcdistribution/TcPacketCheckIF.h b/src/fsfw/tcdistribution/TcPacketCheckIF.h index 4846195a..e583cb0f 100644 --- a/src/fsfw/tcdistribution/TcPacketCheckIF.h +++ b/src/fsfw/tcdistribution/TcPacketCheckIF.h @@ -1,7 +1,7 @@ #ifndef FSFW_TCDISTRIBUTION_TCPACKETCHECKIF_H_ #define FSFW_TCDISTRIBUTION_TCPACKETCHECKIF_H_ -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" class SpacePacketBase; diff --git a/src/fsfw/tcdistribution/TcPacketCheckPUS.h b/src/fsfw/tcdistribution/TcPacketCheckPUS.h index 5b02bbc0..1ecd1007 100644 --- a/src/fsfw/tcdistribution/TcPacketCheckPUS.h +++ b/src/fsfw/tcdistribution/TcPacketCheckPUS.h @@ -3,7 +3,7 @@ #include "TcPacketCheckIF.h" #include "fsfw/FSFW.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tmtcservices/PusVerificationReport.h" class TcPacketStoredBase; diff --git a/src/fsfw/thermal/Heater.h b/src/fsfw/thermal/Heater.h index 61d3776f..d535f54a 100644 --- a/src/fsfw/thermal/Heater.h +++ b/src/fsfw/thermal/Heater.h @@ -6,7 +6,7 @@ #include "fsfw/devicehandlers/HealthDevice.h" #include "fsfw/parameters/ParameterHelper.h" #include "fsfw/power/PowerSwitchIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/timemanager/Countdown.h" class Heater : public HealthDevice, public ReceivesParameterMessagesIF { diff --git a/src/fsfw/thermal/ThermalComponentIF.h b/src/fsfw/thermal/ThermalComponentIF.h index 0c50fbad..0ab22d85 100644 --- a/src/fsfw/thermal/ThermalComponentIF.h +++ b/src/fsfw/thermal/ThermalComponentIF.h @@ -4,7 +4,7 @@ #include "../events/Event.h" #include "../objectmanager/SystemObjectIF.h" #include "../parameters/HasParametersIF.h" -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" class ThermalComponentIF : public HasParametersIF { public: diff --git a/src/fsfw/timemanager/CCSDSTime.h b/src/fsfw/timemanager/CCSDSTime.h index 622f42ec..c52d7e87 100644 --- a/src/fsfw/timemanager/CCSDSTime.h +++ b/src/fsfw/timemanager/CCSDSTime.h @@ -6,7 +6,7 @@ #include #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" #include "Clock.h" #include "clockDefinitions.h" diff --git a/src/fsfw/timemanager/Clock.h b/src/fsfw/timemanager/Clock.h index f27c2211..88436b8b 100644 --- a/src/fsfw/timemanager/Clock.h +++ b/src/fsfw/timemanager/Clock.h @@ -6,7 +6,7 @@ #include "clockDefinitions.h" #include "fsfw/globalfunctions/timevalOperations.h" #include "fsfw/ipc/MutexFactory.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #ifdef WIN32 #include diff --git a/src/fsfw/timemanager/TimeStamperIF.h b/src/fsfw/timemanager/TimeStamperIF.h index 5c3880ea..92577943 100644 --- a/src/fsfw/timemanager/TimeStamperIF.h +++ b/src/fsfw/timemanager/TimeStamperIF.h @@ -3,7 +3,7 @@ #include -#include "../returnvalues/HasReturnvaluesIF.h" +#include "../returnvalues/returnvalue.h" /** * A class implementing this IF provides facilities to add a time stamp to the diff --git a/src/fsfw/tmstorage/TmStoreBackendIF.h b/src/fsfw/tmstorage/TmStoreBackendIF.h index d9f1a17b..84c94f77 100644 --- a/src/fsfw/tmstorage/TmStoreBackendIF.h +++ b/src/fsfw/tmstorage/TmStoreBackendIF.h @@ -3,7 +3,7 @@ #include "fsfw/objectmanager/SystemObjectIF.h" #include "fsfw/parameters/HasParametersIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/storagemanager/StorageManagerIF.h" #include "fsfw/timemanager/Clock.h" #include "tmStorageConf.h" diff --git a/src/fsfw/tmstorage/TmStoreFrontendIF.h b/src/fsfw/tmstorage/TmStoreFrontendIF.h index 4665a299..56bcd7fa 100644 --- a/src/fsfw/tmstorage/TmStoreFrontendIF.h +++ b/src/fsfw/tmstorage/TmStoreFrontendIF.h @@ -3,7 +3,7 @@ #include "TmStorePackets.h" #include "fsfw/ipc/MessageQueueSenderIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "tmStorageConf.h" class TmPacketMinimal; diff --git a/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h b/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h index 1a74e63d..13eec711 100644 --- a/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h +++ b/src/fsfw/tmtcpacket/RedirectableDataPointerIF.h @@ -3,7 +3,7 @@ #include -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * @brief This interface can be used for classes which store a reference to data. It allows diff --git a/src/fsfw/tmtcpacket/SpacePacketBase.h b/src/fsfw/tmtcpacket/SpacePacketBase.h index d9ee2b83..f3d3dbc6 100644 --- a/src/fsfw/tmtcpacket/SpacePacketBase.h +++ b/src/fsfw/tmtcpacket/SpacePacketBase.h @@ -6,7 +6,7 @@ #include #include "ccsds_header.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * @defgroup tmtcpackets Space Packets diff --git a/src/fsfw/tmtcpacket/pus/PacketTimestampInterpreterIF.h b/src/fsfw/tmtcpacket/pus/PacketTimestampInterpreterIF.h index 340f7825..87517fb6 100644 --- a/src/fsfw/tmtcpacket/pus/PacketTimestampInterpreterIF.h +++ b/src/fsfw/tmtcpacket/pus/PacketTimestampInterpreterIF.h @@ -1,7 +1,7 @@ #ifndef FSFW_TMTCPACKET_PUS_PACKETTIMESTAMPINTERPRETERIF_H_ #define FSFW_TMTCPACKET_PUS_PACKETTIMESTAMPINTERPRETERIF_H_ -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" class TmPacketMinimal; diff --git a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h index e7c4f9f0..3cfba870 100644 --- a/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h +++ b/src/fsfw/tmtcpacket/pus/tc/TcPacketStoredIF.h @@ -4,7 +4,7 @@ #include #include "TcPacketPusBase.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/storagemanager/storeAddress.h" class TcPacketStoredIF { diff --git a/src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.h b/src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.h index dc9c33ae..581d5dfa 100644 --- a/src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.h +++ b/src/fsfw/tmtcpacket/pus/tm/TmPacketMinimal.h @@ -1,7 +1,7 @@ #ifndef FRAMEWORK_TMTCPACKET_PUS_TMPACKETMINIMAL_H_ #define FRAMEWORK_TMTCPACKET_PUS_TMPACKETMINIMAL_H_ -#include "../../../returnvalues/HasReturnvaluesIF.h" +#include "../../../returnvalues/returnvalue.h" #include "../../SpacePacketBase.h" struct timeval; diff --git a/src/fsfw/tmtcservices/PusServiceBase.h b/src/fsfw/tmtcservices/PusServiceBase.h index 97351994..d7a2ee47 100644 --- a/src/fsfw/tmtcservices/PusServiceBase.h +++ b/src/fsfw/tmtcservices/PusServiceBase.h @@ -7,7 +7,7 @@ #include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/objectmanager/ObjectManagerIF.h" #include "fsfw/objectmanager/SystemObject.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw/tmtcpacket/pus/tc.h" diff --git a/src/fsfw/tmtcservices/PusVerificationReport.h b/src/fsfw/tmtcservices/PusVerificationReport.h index 60c01d55..4f5302f1 100644 --- a/src/fsfw/tmtcservices/PusVerificationReport.h +++ b/src/fsfw/tmtcservices/PusVerificationReport.h @@ -3,7 +3,7 @@ #include "VerificationCodes.h" #include "fsfw/ipc/MessageQueueMessage.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tmtcpacket/pus/tc/TcPacketPusBase.h" class PusVerificationMessage : public MessageQueueMessage { diff --git a/src/fsfw_hal/common/gpio/GpioCookie.h b/src/fsfw_hal/common/gpio/GpioCookie.h index cf836eae..709af9a5 100644 --- a/src/fsfw_hal/common/gpio/GpioCookie.h +++ b/src/fsfw_hal/common/gpio/GpioCookie.h @@ -2,7 +2,7 @@ #define COMMON_GPIO_GPIOCOOKIE_H_ #include -#include +#include #include "GpioIF.h" #include "gpioDefinitions.h" diff --git a/src/fsfw_hal/common/gpio/GpioIF.h b/src/fsfw_hal/common/gpio/GpioIF.h index 3e947b84..a8abb126 100644 --- a/src/fsfw_hal/common/gpio/GpioIF.h +++ b/src/fsfw_hal/common/gpio/GpioIF.h @@ -2,7 +2,7 @@ #define COMMON_GPIO_GPIOIF_H_ #include -#include +#include #include "gpioDefinitions.h" diff --git a/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp b/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp index 24e90c9f..86c6e888 100644 --- a/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp +++ b/src/fsfw_hal/devicehandlers/MgmRM3100Handler.cpp @@ -4,7 +4,7 @@ #include "fsfw/devicehandlers/DeviceHandlerMessage.h" #include "fsfw/globalfunctions/bitutility.h" #include "fsfw/objectmanager/SystemObjectIF.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" MgmRM3100Handler::MgmRM3100Handler(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie, uint32_t transitionDelay) diff --git a/src/fsfw_hal/linux/CommandExecutor.h b/src/fsfw_hal/linux/CommandExecutor.h index 11b8ccbb..fea2ef0a 100644 --- a/src/fsfw_hal/linux/CommandExecutor.h +++ b/src/fsfw_hal/linux/CommandExecutor.h @@ -7,7 +7,7 @@ #include #include "fsfw/returnvalues/FwClassIds.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" class SimpleRingBuffer; template diff --git a/src/fsfw_hal/linux/UnixFileGuard.h b/src/fsfw_hal/linux/UnixFileGuard.h index 1fe47116..3e4ddca8 100644 --- a/src/fsfw_hal/linux/UnixFileGuard.h +++ b/src/fsfw_hal/linux/UnixFileGuard.h @@ -2,7 +2,7 @@ #define LINUX_UTILITY_UNIXFILEGUARD_H_ #include -#include +#include #include #include diff --git a/src/fsfw_hal/linux/rpi/GpioRPi.h b/src/fsfw_hal/linux/rpi/GpioRPi.h index 8ca7065a..bec4c33d 100644 --- a/src/fsfw_hal/linux/rpi/GpioRPi.h +++ b/src/fsfw_hal/linux/rpi/GpioRPi.h @@ -1,7 +1,7 @@ #ifndef BSP_RPI_GPIO_GPIORPI_H_ #define BSP_RPI_GPIO_GPIORPI_H_ -#include +#include #include "../../common/gpio/gpioDefinitions.h" diff --git a/src/fsfw_hal/linux/spi/spiDefinitions.h b/src/fsfw_hal/linux/spi/spiDefinitions.h index b4bae3c2..113f6551 100644 --- a/src/fsfw_hal/linux/spi/spiDefinitions.h +++ b/src/fsfw_hal/linux/spi/spiDefinitions.h @@ -7,7 +7,7 @@ #include "../../common/gpio/gpioDefinitions.h" #include "../../common/spi/spiCommon.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" class SpiCookie; class SpiComIF; diff --git a/src/fsfw_hal/linux/uio/UioMapper.h b/src/fsfw_hal/linux/uio/UioMapper.h index 20c90b4d..89c2c66a 100644 --- a/src/fsfw_hal/linux/uio/UioMapper.h +++ b/src/fsfw_hal/linux/uio/UioMapper.h @@ -5,7 +5,7 @@ #include -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * @brief Class to help opening uio device files and mapping the physical addresses into the user diff --git a/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h b/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h index a0c3748a..f967c8d1 100644 --- a/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h +++ b/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h @@ -6,7 +6,7 @@ #include "../spi/mspInit.h" #include "../spi/spiDefinitions.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "stm32h7xx_hal.h" #include "stm32h7xx_hal_spi.h" diff --git a/src/fsfw_hal/stm32h7/spi/spiDefinitions.h b/src/fsfw_hal/stm32h7/spi/spiDefinitions.h index 809f5c74..55a74e7a 100644 --- a/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +++ b/src/fsfw_hal/stm32h7/spi/spiDefinitions.h @@ -3,7 +3,7 @@ #include "../../common/spi/spiCommon.h" #include "fsfw/returnvalues/FwClassIds.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "stm32h7xx_hal.h" #include "stm32h7xx_hal_spi.h" diff --git a/src/fsfw_tests/integration/task/TestTask.h b/src/fsfw_tests/integration/task/TestTask.h index 038355c3..40eb4afd 100644 --- a/src/fsfw_tests/integration/task/TestTask.h +++ b/src/fsfw_tests/integration/task/TestTask.h @@ -11,7 +11,7 @@ * @details * Should not be used for board specific tests. Instead, a derived board test class should be used. */ -class TestTask : public SystemObject, public ExecutableObjectIF, public HasReturnvaluesIF { +class TestTask : public SystemObject, public ExecutableObjectIF { public: explicit TestTask(object_id_t objectId); ~TestTask() override; diff --git a/src/fsfw_tests/internal/InternalUnitTester.h b/src/fsfw_tests/internal/InternalUnitTester.h index 07744825..89bac368 100644 --- a/src/fsfw_tests/internal/InternalUnitTester.h +++ b/src/fsfw_tests/internal/InternalUnitTester.h @@ -2,7 +2,7 @@ #define FRAMEWORK_TEST_UNITTESTCLASS_H_ #include "UnittDefinitions.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" /** * @brief Can be used for internal testing, for example for hardware specific diff --git a/src/fsfw_tests/internal/UnittDefinitions.h b/src/fsfw_tests/internal/UnittDefinitions.h index 11e83d22..4517d94e 100644 --- a/src/fsfw_tests/internal/UnittDefinitions.h +++ b/src/fsfw_tests/internal/UnittDefinitions.h @@ -5,7 +5,7 @@ #include #include -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/serviceinterface/ServiceInterface.h" namespace tv { diff --git a/src/fsfw_tests/internal/serialize/IntTestSerialization.h b/src/fsfw_tests/internal/serialize/IntTestSerialization.h index 2f1786d4..939b6614 100644 --- a/src/fsfw_tests/internal/serialize/IntTestSerialization.h +++ b/src/fsfw_tests/internal/serialize/IntTestSerialization.h @@ -3,7 +3,7 @@ #include -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" namespace testserialize { ReturnValue_t test_serialization(); diff --git a/unittests/CatchDefinitions.h b/unittests/CatchDefinitions.h index dbe3848b..64a72f57 100644 --- a/unittests/CatchDefinitions.h +++ b/unittests/CatchDefinitions.h @@ -2,7 +2,7 @@ #define FSFW_UNITTEST_CORE_CATCHDEFINITIONS_H_ #include -#include +#include #include namespace tconst { diff --git a/unittests/container/TestArrayList.cpp b/unittests/container/TestArrayList.cpp index e2f14e47..3056c288 100644 --- a/unittests/container/TestArrayList.cpp +++ b/unittests/container/TestArrayList.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/unittests/container/TestDynamicFifo.cpp b/unittests/container/TestDynamicFifo.cpp index a3347215..445d3d91 100644 --- a/unittests/container/TestDynamicFifo.cpp +++ b/unittests/container/TestDynamicFifo.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include diff --git a/unittests/container/TestFifo.cpp b/unittests/container/TestFifo.cpp index 1a3c9d8a..9fc9ee93 100644 --- a/unittests/container/TestFifo.cpp +++ b/unittests/container/TestFifo.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include diff --git a/unittests/container/TestFixedArrayList.cpp b/unittests/container/TestFixedArrayList.cpp index b28c3166..0a8de39f 100644 --- a/unittests/container/TestFixedArrayList.cpp +++ b/unittests/container/TestFixedArrayList.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/unittests/container/TestFixedMap.cpp b/unittests/container/TestFixedMap.cpp index d17cc55b..dae40d2d 100644 --- a/unittests/container/TestFixedMap.cpp +++ b/unittests/container/TestFixedMap.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/unittests/container/TestFixedOrderedMultimap.cpp b/unittests/container/TestFixedOrderedMultimap.cpp index 153144cd..9bfd2b09 100644 --- a/unittests/container/TestFixedOrderedMultimap.cpp +++ b/unittests/container/TestFixedOrderedMultimap.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/unittests/container/TestPlacementFactory.cpp b/unittests/container/TestPlacementFactory.cpp index 142f03d7..a898f4c1 100644 --- a/unittests/container/TestPlacementFactory.cpp +++ b/unittests/container/TestPlacementFactory.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/unittests/devicehandler/DeviceHandlerCommander.h b/unittests/devicehandler/DeviceHandlerCommander.h index e90cbcee..62713d54 100644 --- a/unittests/devicehandler/DeviceHandlerCommander.h +++ b/unittests/devicehandler/DeviceHandlerCommander.h @@ -4,7 +4,7 @@ #include "fsfw/action/CommandActionHelper.h" #include "fsfw/action/CommandsActionsIF.h" #include "fsfw/objectmanager/SystemObject.h" -#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/ExecutableObjectIF.h" class DeviceHandlerCommander : public ExecutableObjectIF, diff --git a/unittests/testcfg/pollingsequence/PollingSequenceFactory.h b/unittests/testcfg/pollingsequence/PollingSequenceFactory.h index fc9891b2..daba33a8 100644 --- a/unittests/testcfg/pollingsequence/PollingSequenceFactory.h +++ b/unittests/testcfg/pollingsequence/PollingSequenceFactory.h @@ -1,7 +1,7 @@ #ifndef POLLINGSEQUENCEFACTORY_H_ #define POLLINGSEQUENCEFACTORY_H_ -#include +#include class FixedTimeslotTaskIF;