expand serialize IF further
This commit is contained in:
parent
42a1d6cccd
commit
ddad97033d
@ -104,8 +104,8 @@ if(FSFW_GENERATE_SECTIONS)
|
||||
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
|
||||
endif()
|
||||
|
||||
option(FSFW_BUILD_TESTS
|
||||
"Build unittest binary in addition to static library" OFF)
|
||||
option(FSFW_BUILD_TESTS "Build unittest binary in addition to static library"
|
||||
OFF)
|
||||
option(FSFW_CICD_BUILD "Build for CI/CD. This can disable problematic test" OFF)
|
||||
option(FSFW_BUILD_DOCS "Build documentation with Sphinx and Doxygen" OFF)
|
||||
if(FSFW_BUILD_TESTS)
|
||||
|
@ -292,7 +292,8 @@ ReturnValue_t MessageQueue::handleOpenError(mq_attr* attributes, uint32_t messag
|
||||
sif::error << "MessageQueue::MessageQueue: Default MQ size " << defaultMqMaxMsg
|
||||
<< " is too small for requested message depth " << messageDepth << std::endl;
|
||||
sif::error << "This error can be fixed by setting the maximum "
|
||||
"allowed message depth higher" << std::endl;
|
||||
"allowed message depth higher"
|
||||
<< std::endl;
|
||||
#else
|
||||
sif::printError(
|
||||
"MessageQueue::MessageQueue: Default MQ size %d is too small for"
|
||||
|
@ -34,7 +34,7 @@ class SerializeIF {
|
||||
static const ReturnValue_t TOO_MANY_ELEMENTS =
|
||||
MAKE_RETURN_CODE(3); // !< There are too many elements to be deserialized
|
||||
|
||||
virtual ~SerializeIF() {}
|
||||
virtual ~SerializeIF() = default;
|
||||
/**
|
||||
* @brief
|
||||
* Function to serialize the object into a buffer with maxSize. Size represents the written
|
||||
@ -66,7 +66,7 @@ class SerializeIF {
|
||||
* Gets the size of a object if it would be serialized in a buffer
|
||||
* @return Size of serialized object
|
||||
*/
|
||||
virtual size_t getSerializedSize() const = 0;
|
||||
[[nodiscard]] virtual size_t getSerializedSize() const = 0;
|
||||
|
||||
/**
|
||||
* @brief
|
||||
@ -99,7 +99,8 @@ class SerializeIF {
|
||||
* @param streamEndianness
|
||||
* @return
|
||||
*/
|
||||
virtual ReturnValue_t serialize(uint8_t* buffer, size_t maxSize, Endianness streamEndianness) {
|
||||
virtual ReturnValue_t serialize(uint8_t *buffer, size_t maxSize,
|
||||
Endianness streamEndianness) const {
|
||||
size_t tmpSize = 0;
|
||||
return serialize(&buffer, &tmpSize, maxSize, streamEndianness);
|
||||
}
|
||||
@ -112,7 +113,7 @@ class SerializeIF {
|
||||
* @param streamEndianness
|
||||
* @return
|
||||
*/
|
||||
virtual ReturnValue_t deSerialize(const uint8_t* buffer, size_t maxSize,
|
||||
virtual ReturnValue_t deSerialize(const uint8_t *buffer, size_t maxSize,
|
||||
Endianness streamEndianness) {
|
||||
return deSerialize(&buffer, &maxSize, streamEndianness);
|
||||
}
|
||||
|
@ -2,9 +2,9 @@ add_subdirectory(devicehandlers)
|
||||
add_subdirectory(common)
|
||||
|
||||
if(UNIX)
|
||||
add_subdirectory(linux)
|
||||
add_subdirectory(linux)
|
||||
endif()
|
||||
|
||||
if(FSFW_HAL_ADD_STM32H7)
|
||||
add_subdirectory(stm32h7)
|
||||
add_subdirectory(stm32h7)
|
||||
endif()
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
GpioCookie.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE GpioCookie.cpp)
|
||||
|
@ -1,5 +1,3 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
GyroL3GD20Handler.cpp
|
||||
MgmRM3100Handler.cpp
|
||||
MgmLIS3MDLHandler.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME} PRIVATE GyroL3GD20Handler.cpp MgmRM3100Handler.cpp
|
||||
MgmLIS3MDLHandler.cpp)
|
||||
|
@ -1,25 +1,21 @@
|
||||
if(FSFW_HAL_ADD_RASPBERRY_PI)
|
||||
add_subdirectory(rpi)
|
||||
add_subdirectory(rpi)
|
||||
endif()
|
||||
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
UnixFileGuard.cpp
|
||||
CommandExecutor.cpp
|
||||
utility.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE UnixFileGuard.cpp CommandExecutor.cpp
|
||||
utility.cpp)
|
||||
|
||||
if(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS)
|
||||
if(FSFW_HAL_LINUX_ADD_LIBGPIOD)
|
||||
add_subdirectory(gpio)
|
||||
endif()
|
||||
add_subdirectory(uart)
|
||||
# Adding those does not really make sense on Apple systems which
|
||||
# are generally host systems. It won't even compile as the headers
|
||||
# are missing
|
||||
if(NOT APPLE)
|
||||
add_subdirectory(i2c)
|
||||
add_subdirectory(spi)
|
||||
endif()
|
||||
if(FSFW_HAL_LINUX_ADD_LIBGPIOD)
|
||||
add_subdirectory(gpio)
|
||||
endif()
|
||||
add_subdirectory(uart)
|
||||
# Adding those does not really make sense on Apple systems which are generally
|
||||
# host systems. It won't even compile as the headers are missing
|
||||
if(NOT APPLE)
|
||||
add_subdirectory(i2c)
|
||||
add_subdirectory(spi)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(uio)
|
||||
|
@ -1,16 +1,12 @@
|
||||
# This abstraction layer requires the gpiod library. You can install this library
|
||||
# with "sudo apt-get install -y libgpiod-dev". If you are cross-compiling, you need
|
||||
# to install the package before syncing the sysroot to your host computer.
|
||||
# This abstraction layer requires the gpiod library. You can install this
|
||||
# library with "sudo apt-get install -y libgpiod-dev". If you are
|
||||
# cross-compiling, you need to install the package before syncing the sysroot to
|
||||
# your host computer.
|
||||
find_library(LIB_GPIO gpiod)
|
||||
|
||||
if(${LIB_GPIO} MATCHES LIB_GPIO-NOTFOUND)
|
||||
message(STATUS "gpiod library not found, not linking against it")
|
||||
message(STATUS "gpiod library not found, not linking against it")
|
||||
else()
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
LinuxLibgpioIF.cpp
|
||||
)
|
||||
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
||||
${LIB_GPIO}
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE LinuxLibgpioIF.cpp)
|
||||
target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${LIB_GPIO})
|
||||
endif()
|
||||
|
||||
|
@ -1,8 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
||||
I2cComIF.cpp
|
||||
I2cCookie.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC I2cComIF.cpp I2cCookie.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
GpioRPi.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE GpioRPi.cpp)
|
||||
|
@ -1,8 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
||||
SpiComIF.cpp
|
||||
SpiCookie.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC SpiComIF.cpp SpiCookie.cpp)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
||||
UartComIF.cpp
|
||||
UartCookie.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC UartComIF.cpp UartCookie.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
||||
UioMapper.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC UioMapper.cpp)
|
||||
|
@ -2,6 +2,4 @@ add_subdirectory(spi)
|
||||
add_subdirectory(gpio)
|
||||
add_subdirectory(devicetest)
|
||||
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
dma.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE dma.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
GyroL3GD20H.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE GyroL3GD20H.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
gpio.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE gpio.cpp)
|
||||
|
@ -1,2 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE)
|
||||
|
@ -1,9 +1,9 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
spiCore.cpp
|
||||
spiDefinitions.cpp
|
||||
spiInterrupts.cpp
|
||||
mspInit.cpp
|
||||
SpiCookie.cpp
|
||||
SpiComIF.cpp
|
||||
stm32h743zi.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE spiCore.cpp
|
||||
spiDefinitions.cpp
|
||||
spiInterrupts.cpp
|
||||
mspInit.cpp
|
||||
SpiCookie.cpp
|
||||
SpiComIF.cpp
|
||||
stm32h743zi.cpp)
|
||||
|
@ -1,2 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE)
|
||||
|
@ -1,7 +1,7 @@
|
||||
if(FSFW_ADD_INTERNAL_TESTS)
|
||||
add_subdirectory(internal)
|
||||
add_subdirectory(internal)
|
||||
endif()
|
||||
|
||||
if(NOT FSFW_BUILD_TESTS)
|
||||
add_subdirectory(integration)
|
||||
add_subdirectory(integration)
|
||||
endif()
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
TestAssembly.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE TestAssembly.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
TestController.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE TestController.cpp)
|
||||
|
@ -1,5 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
TestCookie.cpp
|
||||
TestDeviceHandler.cpp
|
||||
TestEchoComIF.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE TestCookie.cpp TestDeviceHandler.cpp
|
||||
TestEchoComIF.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
TestTask.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE TestTask.cpp)
|
||||
|
@ -1,8 +1,6 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
InternalUnitTester.cpp
|
||||
UnittDefinitions.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE InternalUnitTester.cpp
|
||||
UnittDefinitions.cpp)
|
||||
|
||||
add_subdirectory(osal)
|
||||
add_subdirectory(serialize)
|
||||
add_subdirectory(globalfunctions)
|
||||
add_subdirectory(globalfunctions)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
TestArrayPrinter.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE TestArrayPrinter.cpp)
|
||||
|
@ -1,5 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
testMq.cpp
|
||||
testMutex.cpp
|
||||
testSemaphore.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE testMq.cpp testMutex.cpp
|
||||
testSemaphore.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
IntTestSerialization.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE IntTestSerialization.cpp)
|
||||
|
Loading…
Reference in New Issue
Block a user