some more occurences

This commit is contained in:
Ulrich Mohr 2022-08-16 12:29:53 +02:00
parent f63f3fa564
commit d2ac3603a5
9 changed files with 23 additions and 23 deletions

View File

@ -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.

View File

@ -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 <retvalapi>` can be used. The ``CLASS_ID`` is a unique ID for that type of object.
See the :ref:`FSFW Class IDs file <fwclassids>`. The user can add custom ``CLASS_ID``\s via the
``fsfwconfig`` folder.

View File

@ -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;
//}

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -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);

View File

@ -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 };

View File

@ -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<int>(HasReturnvaluesIF::returnvalue::FAILED));
// REQUIRE(fifo.peek(ptr) == static_cast<int>(HasReturnvaluesIF::returnvalue::FAILED));
// REQUIRE(fifo.retrieve(ptr) == static_cast<int>(returnvalue::FAILED));
// REQUIRE(fifo.peek(ptr) == static_cast<int>(returnvalue::FAILED));
};
SECTION("Copy Test") {
REQUIRE(fifo.insert(structOne) == static_cast<int>(returnvalue::OK));