From 7ffce219d5f86df29fe3348cdeb703419ba32acd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 7 Nov 2020 14:32:28 +0100 Subject: [PATCH 01/24] hosted build fix --- events/EventManager.cpp | 4 ++-- events/EventManager.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/events/EventManager.cpp b/events/EventManager.cpp index f60a8a66..d171b591 100644 --- a/events/EventManager.cpp +++ b/events/EventManager.cpp @@ -42,7 +42,7 @@ ReturnValue_t EventManager::performOperation(uint8_t opCode) { EventMessage message; result = eventReportQueue->receiveMessage(&message); if (result == HasReturnvaluesIF::RETURN_OK) { -#ifdef DEBUG +#if FSFW_DEBUG_OUTPUT == 1 printEvent(&message); #endif notifyListeners(&message); @@ -113,7 +113,7 @@ ReturnValue_t EventManager::unsubscribeFromEventRange(MessageQueueId_t listener, return result; } -#ifdef DEBUG +#if FSFW_DEBUG_OUTPUT == 1 void EventManager::printEvent(EventMessage* message) { const char *string = 0; diff --git a/events/EventManager.h b/events/EventManager.h index 2602aeb2..5e1a8153 100644 --- a/events/EventManager.h +++ b/events/EventManager.h @@ -55,7 +55,7 @@ protected: void notifyListeners(EventMessage *message); -#ifdef DEBUG +#if FSFW_DEBUG_OUTPUT == 1 void printEvent(EventMessage *message); #endif From 5927d944de61672a16afc366d0ebec10f46e19c2 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sat, 12 Dec 2020 18:32:24 +0100 Subject: [PATCH 02/24] cmake fixes --- CMakeLists.txt | 2 ++ datapool/CMakeLists.txt | 7 +------ datapoollocal/CMakeLists.txt | 8 ++++++++ events/CMakeLists.txt | 1 - housekeeping/CMakeLists.txt | 5 +++++ storagemanager/CMakeLists.txt | 2 ++ thermal/CMakeLists.txt | 4 ++-- 7 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 datapoollocal/CMakeLists.txt create mode 100644 housekeeping/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 669283c7..09760f8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,8 @@ add_subdirectory(controller) add_subdirectory(coordinates) add_subdirectory(datalinklayer) add_subdirectory(datapool) +add_subdirectory(datapoollocal) +add_subdirectory(housekeeping) add_subdirectory(devicehandlers) add_subdirectory(events) add_subdirectory(fdir) diff --git a/datapool/CMakeLists.txt b/datapool/CMakeLists.txt index e741f6a1..0d53e1ba 100644 --- a/datapool/CMakeLists.txt +++ b/datapool/CMakeLists.txt @@ -1,11 +1,6 @@ target_sources(${LIB_FSFW_NAME} PRIVATE - ControllerSet.cpp - DataPool.cpp - DataPoolAdmin.cpp - DataPoolParameterWrapper.cpp - DataSet.cpp HkSwitchHelper.cpp + PoolDataSetBase.cpp PoolEntry.cpp - PoolRawAccess.cpp ) \ No newline at end of file diff --git a/datapoollocal/CMakeLists.txt b/datapoollocal/CMakeLists.txt new file mode 100644 index 00000000..c6b187cd --- /dev/null +++ b/datapoollocal/CMakeLists.txt @@ -0,0 +1,8 @@ +target_sources(${LIB_FSFW_NAME} + PRIVATE + LocalDataPoolManager.cpp + LocalDataSet.cpp + LocalPoolDataSetBase.cpp + LocalPoolObjectBase.cpp + SharedLocalDataSet.cpp +) \ No newline at end of file diff --git a/events/CMakeLists.txt b/events/CMakeLists.txt index 9e63deb8..4e935167 100644 --- a/events/CMakeLists.txt +++ b/events/CMakeLists.txt @@ -1,6 +1,5 @@ target_sources(${LIB_FSFW_NAME} PRIVATE - Event.cpp EventManager.cpp EventMessage.cpp ) diff --git a/housekeeping/CMakeLists.txt b/housekeeping/CMakeLists.txt new file mode 100644 index 00000000..fecad2e3 --- /dev/null +++ b/housekeeping/CMakeLists.txt @@ -0,0 +1,5 @@ +target_sources(${LIB_FSFW_NAME} + PRIVATE + HousekeepingMessage.cpp + PeriodicHousekeepingHelper.cpp +) \ No newline at end of file diff --git a/storagemanager/CMakeLists.txt b/storagemanager/CMakeLists.txt index 57c92195..b8138cae 100644 --- a/storagemanager/CMakeLists.txt +++ b/storagemanager/CMakeLists.txt @@ -2,4 +2,6 @@ target_sources(${LIB_FSFW_NAME} PRIVATE ConstStorageAccessor.cpp StorageAccessor.cpp + LocalPool.cpp + PoolManager.cpp ) \ No newline at end of file diff --git a/thermal/CMakeLists.txt b/thermal/CMakeLists.txt index 67664fbe..ad532721 100644 --- a/thermal/CMakeLists.txt +++ b/thermal/CMakeLists.txt @@ -1,10 +1,10 @@ target_sources(${LIB_FSFW_NAME} PRIVATE AbstractTemperatureSensor.cpp - CoreComponent.cpp Heater.cpp RedundantHeater.cpp + ThermalComponentCore.cpp ThermalComponent.cpp ThermalModule.cpp - ThermalMonitor.cpp + ThermalMonitorReporter.cpp ) From 55a663beb20ff5b9435b3dc358e6b869d8353ef8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Dec 2020 21:14:38 +0100 Subject: [PATCH 03/24] unittest update --- unittest/testcfg/CatchFactory.cpp | 60 ------------------- unittest/testcfg/FSFWConfig.h | 4 +- unittest/testcfg/objects/CatchFactory.cpp | 56 +++++++++++++++++ unittest/testcfg/{ => objects}/CatchFactory.h | 0 4 files changed, 57 insertions(+), 63 deletions(-) delete mode 100644 unittest/testcfg/CatchFactory.cpp create mode 100644 unittest/testcfg/objects/CatchFactory.cpp rename unittest/testcfg/{ => objects}/CatchFactory.h (100%) diff --git a/unittest/testcfg/CatchFactory.cpp b/unittest/testcfg/CatchFactory.cpp deleted file mode 100644 index c74a8126..00000000 --- a/unittest/testcfg/CatchFactory.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "CatchFactory.h" - -#include -#include - -#include -#include -#include - -/** - * @brief Produces system objects. - * @details - * Build tasks by using SystemObject Interface (Interface). - * Header files of all tasks must be included - * Please note that an object has to implement the system object interface - * if the interface validity is checked or retrieved later by using the - * get(object_id) function from the ObjectManagerIF. - * - * Framework objects are created first. - * - * @ingroup init - */ -void Factory::produce(void) { - setStaticFrameworkObjectIds(); - new EventManager(objects::EVENT_MANAGER); - new HealthTable(objects::HEALTH_TABLE); - //new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER); - - { - static constexpr uint8_t NUMBER_OF_POOLS = 5; - const uint16_t element_sizes[NUMBER_OF_POOLS] = {16, 32, 64, 128, 1024}; - const uint16_t n_elements[NUMBER_OF_POOLS] = {100, 50, 25, 15, 5}; - new PoolManager(objects::TC_STORE, element_sizes, - n_elements); - } - - { - static constexpr uint8_t NUMBER_OF_POOLS = 5; - const uint16_t element_sizes[NUMBER_OF_POOLS] = {16, 32, 64, 128, 1024}; - const uint16_t n_elements[NUMBER_OF_POOLS] = {100, 50, 25, 15, 5}; - new PoolManager(objects::TM_STORE, element_sizes, - n_elements); - } - - { - static constexpr uint8_t NUMBER_OF_POOLS = 6; - const uint16_t element_sizes[NUMBER_OF_POOLS] = {32, 64, 512, - 1024, 2048, 4096}; - const uint16_t n_elements[NUMBER_OF_POOLS] = {200, 100, 50, 25, 15, 5}; - new PoolManager(objects::IPC_STORE, element_sizes, - n_elements); - } - -} - -void Factory::setStaticFrameworkObjectIds() { - -} - - diff --git a/unittest/testcfg/FSFWConfig.h b/unittest/testcfg/FSFWConfig.h index 4fb224c1..59934560 100644 --- a/unittest/testcfg/FSFWConfig.h +++ b/unittest/testcfg/FSFWConfig.h @@ -29,13 +29,11 @@ //! additional output which requires the translation files translateObjects //! and translateEvents (and their compiles source files) #if FSFW_OBJ_EVENT_TRANSLATION == 1 -#define FSFW_DEBUG_OUTPUT 1 //! Specify whether info events are printed too. -#define FSFW_DEBUG_INFO 1 +#define FSFW_DEBUG_INFO 1 #include #include #else -#define FSFW_DEBUG_OUTPUT 0 #endif //! When using the newlib nano library, C99 support for stdio facilities diff --git a/unittest/testcfg/objects/CatchFactory.cpp b/unittest/testcfg/objects/CatchFactory.cpp new file mode 100644 index 00000000..3177212f --- /dev/null +++ b/unittest/testcfg/objects/CatchFactory.cpp @@ -0,0 +1,56 @@ +#include "CatchFactory.h" + +#include +#include + +#include +#include +#include + +/** + * @brief Produces system objects. + * @details + * Build tasks by using SystemObject Interface (Interface). + * Header files of all tasks must be included + * Please note that an object has to implement the system object interface + * if the interface validity is checked or retrieved later by using the + * get(object_id) function from the ObjectManagerIF. + * + * Framework objects are created first. + * + * @ingroup init + */ +void Factory::produce(void) { + setStaticFrameworkObjectIds(); + new EventManager(objects::EVENT_MANAGER); + new HealthTable(objects::HEALTH_TABLE); + new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER); + + { + PoolManager::LocalPoolConfig poolCfg = { + {100, 16}, {50, 32}, {25, 64} , {15, 128}, {5, 1024} + }; + new PoolManager(objects::TC_STORE, poolCfg); + } + + { + PoolManager::LocalPoolConfig poolCfg = { + {100, 16}, {50, 32}, {25, 64} , {15, 128}, {5, 1024} + }; + new PoolManager(objects::TM_STORE, poolCfg); + } + + { + PoolManager::LocalPoolConfig poolCfg = { + {100, 16}, {50, 32}, {25, 64} , {15, 128}, {5, 1024} + }; + new PoolManager(objects::IPC_STORE, poolCfg); + } + +} + +void Factory::setStaticFrameworkObjectIds() { + +} + + diff --git a/unittest/testcfg/CatchFactory.h b/unittest/testcfg/objects/CatchFactory.h similarity index 100% rename from unittest/testcfg/CatchFactory.h rename to unittest/testcfg/objects/CatchFactory.h From f128a1dc3d33c7bd22919b13240230373843f13c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 15 Dec 2020 23:44:43 +0100 Subject: [PATCH 04/24] made datalinklayer optional --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09760f8e..c8092629 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,11 @@ add_subdirectory(action) add_subdirectory(container) add_subdirectory(controller) add_subdirectory(coordinates) + +if(FSFW_USE_DATALINKLAYER) add_subdirectory(datalinklayer) +endif() + add_subdirectory(datapool) add_subdirectory(datapoollocal) add_subdirectory(housekeeping) From ac40b1c966bb025ce433dc55554100de29f77d5a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 17 Dec 2020 11:46:50 +0100 Subject: [PATCH 05/24] cmake list formatting --- CMakeLists.txt | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8092629..fbbe386b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,27 +3,38 @@ cmake_minimum_required(VERSION 3.13) set(LIB_FSFW_NAME fsfw) add_library(${LIB_FSFW_NAME}) -# Set options for FSFW OSAL selection. -if(UNIX) -set(OS_FSFW "linux" CACHE STRING "OS abstraction layer used in the FSFW") -elseif(WIN32) -set(OS_FSFW "host" CACHE STRING "OS abstraction layer used in the FSFW") -endif() - set_property(CACHE OS_FSFW PROPERTY STRINGS host linux rtems freertos) +if(NOT OS_FSFW) + message(STATUS "No OS for FSFW via OS_FSFW set. Assuming host OS") + # Assume host OS and autodetermine from OS_FSFW + if(UNIX) + set(OS_FSFW "linux" + CACHE STRING + "OS abstraction layer used in the FSFW" + ) + elseif(WIN32) + set(OS_FSFW "host" + CACHE STRING "OS abstraction layer used in the FSFW" + ) + endif() + +endif + if(${OS_FSFW} STREQUAL host) -set(OS_FSFW_NAME "Host") + set(OS_FSFW_NAME "Host") elseif(${OS_FSFW} STREQUAL linux) -set(OS_FSFW_NAME "Linux") + set(OS_FSFW_NAME "Linux") elseif(${OS_FSFW} STREQUAL freertos) -set(OS_FSFW_NAME "FreeRTOS") + set(OS_FSFW_NAME "FreeRTOS") elseif(${OS_FSFW} STREQUAL rtems) -set(OS_FSFW_NAME "RTEMS") + set(OS_FSFW_NAME "RTEMS") else() -message(WARNING "Invalid operating system for FSFW specified! Setting to host..") -set(OS_FSFW_NAME "Host") -set(OS_FSFW "host") + message(WARNING + "Invalid operating system for FSFW specified! Setting to host.." + ) + set(OS_FSFW_NAME "Host") + set(OS_FSFW "host") endif() message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system") @@ -38,7 +49,7 @@ add_subdirectory(controller) add_subdirectory(coordinates) if(FSFW_USE_DATALINKLAYER) -add_subdirectory(datalinklayer) + add_subdirectory(datalinklayer) endif() add_subdirectory(datapool) @@ -61,7 +72,7 @@ add_subdirectory(power) add_subdirectory(pus) if(FSFW_USE_RMAP) -add_subdirectory(rmap) + add_subdirectory(rmap) endif() add_subdirectory(serialize) @@ -79,9 +90,9 @@ add_subdirectory(tmtcservices) # The project CMakeLists file has to set the FSFW_CONFIG_PATH and add it. # If this is not given, we include the default configuration and emit a warning. if(NOT FSFW_CONFIG_PATH) -message(WARNING "Flight Software Framework configuration path not set!") -message(WARNING "Setting default configuration!") -add_subdirectory(defaultcfg/fsfwconfig) + message(WARNING "Flight Software Framework configuration path not set!") + message(WARNING "Setting default configuration!") + add_subdirectory(defaultcfg/fsfwconfig) endif() # Required include paths to compile the FSFW From 62b5c19063c6b55f08aae54bc93e879619bd1a06 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 17 Dec 2020 20:18:16 +0100 Subject: [PATCH 06/24] small fix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbbe386b..5cb4b28e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ if(NOT OS_FSFW) ) endif() -endif +endif() if(${OS_FSFW} STREQUAL host) set(OS_FSFW_NAME "Host") From c0099481a16897273b10a0c8b59c8f2504392b3d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 19 Dec 2020 00:21:08 +0100 Subject: [PATCH 07/24] added freertos cmakelists --- osal/FreeRTOS/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 osal/FreeRTOS/CMakeLists.txt diff --git a/osal/FreeRTOS/CMakeLists.txt b/osal/FreeRTOS/CMakeLists.txt new file mode 100644 index 00000000..a7b1338f --- /dev/null +++ b/osal/FreeRTOS/CMakeLists.txt @@ -0,0 +1,18 @@ +target_sources(${LIB_FSFW_NAME} + PRIVATE + Clock.cpp + FixedTimeslotTask.cpp + BinarySemaphore.cpp + BinSemaphUsingTask.cpp + CountingSemaphore.cpp + CountingSemaphUsingTask.cpp + MessageQueue.cpp + Mutex.cpp + MutexFactory.cpp + PeriodicTask.cpp + QueueFactory.cpp + QueueMapManager.cpp + SemaphoreFactory.cpp + TaskFactory.cpp + Timekeeper.cpp +) \ No newline at end of file From e030d7ed97609c377af8540b7754b08bbb7c87ef Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 19 Dec 2020 02:29:22 +0100 Subject: [PATCH 08/24] correct interface and private includes --- CMakeLists.txt | 24 +++++++++++++++++++++--- osal/FreeRTOS/CMakeLists.txt | 15 +++++++++++++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cb4b28e..a3ca3e0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,8 +95,26 @@ if(NOT FSFW_CONFIG_PATH) add_subdirectory(defaultcfg/fsfwconfig) endif() +# FSFW might be part of a possibly complicated folder structure, so we +# extract the absolute path of the fsfwconfig folder. +if(IS_ABSOLUTE ${FSFW_CONFIG_PATH}) + set(${FSFW_CONFIG_PATH_ABSOLUTE} ${FSFW_CONFIG_PATH}) +else() + get_filename_component(${FSFW_CONFIG_PATH_ABSOLUTE} + ${FSFW_CONFIG_PATH} ABSOLUTE + ) +endif() + # Required include paths to compile the FSFW -target_include_directories(${LIB_FSFW_NAME} - INTERFACE - ${FSFW_CONFIG_PATH} +target_include_directories(${LIB_FSFW_NAME} INTERFACE + ${CMAKE_SOURCE_DIR} + ${FSFW_CONFIG_PATH_ABSOLUTE} +) + +# Includes path required to compile FSFW itself as well +# We assume that the fsfwconfig folder uses include relative to the project +# root here! +target_include_directories(${LIB_FSFW_NAME} PRIVATE + ${CMAKE_SOURCE_DIR} + ${FSFW_CONFIG_PATH_ABSOLUTE} ) diff --git a/osal/FreeRTOS/CMakeLists.txt b/osal/FreeRTOS/CMakeLists.txt index a7b1338f..c310c5cf 100644 --- a/osal/FreeRTOS/CMakeLists.txt +++ b/osal/FreeRTOS/CMakeLists.txt @@ -11,8 +11,19 @@ target_sources(${LIB_FSFW_NAME} MutexFactory.cpp PeriodicTask.cpp QueueFactory.cpp - QueueMapManager.cpp SemaphoreFactory.cpp TaskFactory.cpp Timekeeper.cpp -) \ No newline at end of file +) + +# FreeRTOS is required to link the FSFW now. It is recommended to compile +# FreeRTOS as a static library and set LIB_OS_NAME to the target name of the +# library. +if(NOT LIB_OS_NAME) + message(FATAL_ERROR + "FreeRTOS needs to be linked as a target and " + "LIB_OS_NAME needs to be set to the target" + ) +endif() + +target_link_libraries(${LIB_FSWFW_NAME} ${LIB_OS_NAME}) \ No newline at end of file From be20978998bc2d6852cd7ecdc6d3061354e13104 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 19 Dec 2020 12:10:29 +0100 Subject: [PATCH 09/24] better path determination --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3ca3e0d..21f4c90e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,10 +98,10 @@ endif() # FSFW might be part of a possibly complicated folder structure, so we # extract the absolute path of the fsfwconfig folder. if(IS_ABSOLUTE ${FSFW_CONFIG_PATH}) - set(${FSFW_CONFIG_PATH_ABSOLUTE} ${FSFW_CONFIG_PATH}) + set(FSFW_CONFIG_PATH_ABSOLUTE ${FSFW_CONFIG_PATH}) else() - get_filename_component(${FSFW_CONFIG_PATH_ABSOLUTE} - ${FSFW_CONFIG_PATH} ABSOLUTE + get_filename_component(FSFW_CONFIG_PATH_ABSOLUTE + ${FSFW_CONFIG_PATH} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR} ) endif() From b8e703ca833295d5dbfaadf20bb45b358295b6ff Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 19 Dec 2020 13:04:16 +0100 Subject: [PATCH 10/24] linked against OS --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21f4c90e..5660443f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ elseif(${OS_FSFW} STREQUAL linux) set(OS_FSFW_NAME "Linux") elseif(${OS_FSFW} STREQUAL freertos) set(OS_FSFW_NAME "FreeRTOS") + target_link_libraries(${LIB_FSFW_NAME} ${LIB_OS_NAME}) elseif(${OS_FSFW} STREQUAL rtems) set(OS_FSFW_NAME "RTEMS") else() From 8ede00fdf18c8a0fb7afd808a2d76d69bd5c23a9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 19 Dec 2020 18:38:02 +0100 Subject: [PATCH 11/24] small bugfixes --- CMakeLists.txt | 4 ++++ osal/FreeRTOS/CMakeLists.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5660443f..0497a42f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,3 +119,7 @@ target_include_directories(${LIB_FSFW_NAME} PRIVATE ${CMAKE_SOURCE_DIR} ${FSFW_CONFIG_PATH_ABSOLUTE} ) + +target_compile_options(${LIB_FSFW_NAME} PRIVATE + ${ABI_FLAGS} +) diff --git a/osal/FreeRTOS/CMakeLists.txt b/osal/FreeRTOS/CMakeLists.txt index c310c5cf..95462010 100644 --- a/osal/FreeRTOS/CMakeLists.txt +++ b/osal/FreeRTOS/CMakeLists.txt @@ -14,6 +14,7 @@ target_sources(${LIB_FSFW_NAME} SemaphoreFactory.cpp TaskFactory.cpp Timekeeper.cpp + TaskManagement.cpp ) # FreeRTOS is required to link the FSFW now. It is recommended to compile From d186b70d2edf5265f99e6d933ce90ccf5faf641f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 19 Dec 2020 18:41:28 +0100 Subject: [PATCH 12/24] comment added --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0497a42f..b2c55d95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,7 @@ target_include_directories(${LIB_FSFW_NAME} PRIVATE ${FSFW_CONFIG_PATH_ABSOLUTE} ) +# Machine specific options can be set with the ABI_FLAGS variable. target_compile_options(${LIB_FSFW_NAME} PRIVATE ${ABI_FLAGS} ) From c64a9654ea54ab843406b9966fffd9f26c76e17a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 19 Dec 2020 22:51:10 +0100 Subject: [PATCH 13/24] xcompile update --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2c55d95..2fc33e58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ else() set(OS_FSFW "host") endif() -message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system") +message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system.") # Options to exclude parts of the FSFW from compilation. option(FSFW_USE_RMAP "Compile with RMAP" ON) From ebe7f02fc4c65ac4f28825d54671fe402e61cd9f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Dec 2020 01:56:21 +0100 Subject: [PATCH 14/24] better error handling --- osal/windows/TcWinUdpPollingTask.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osal/windows/TcWinUdpPollingTask.cpp b/osal/windows/TcWinUdpPollingTask.cpp index 7b54bb2c..06deafd1 100644 --- a/osal/windows/TcWinUdpPollingTask.cpp +++ b/osal/windows/TcWinUdpPollingTask.cpp @@ -119,7 +119,7 @@ void TcWinUdpPollingTask::setTimeout(double timeoutSeconds) { int result = setsockopt(serverUdpSocket, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(&timeoutMs), sizeof(DWORD)); if(result == -1) { - sif::error << "TcSocketPollingTask::TcSocketPollingTask: Setting " + sif::error << "TcWinUdpPollingTask::TcSocketPollingTask: Setting " "receive timeout failed with " << strerror(errno) << std::endl; } } @@ -128,17 +128,22 @@ void TcWinUdpPollingTask::handleReadError() { int error = WSAGetLastError(); switch(error) { case(WSANOTINITIALISED): { - sif::info << "TmTcWinUdpBridge::handleReadError: WSANOTINITIALISED: " + sif::info << "TcWinUdpPollingTask::handleReadError: WSANOTINITIALISED: " << "WSAStartup(...) call " << "necessary" << std::endl; break; } case(WSAEFAULT): { - sif::info << "TmTcWinUdpBridge::handleReadError: WSADEFAULT: " + sif::info << "TcWinUdpPollingTask::handleReadError: WSADEFAULT: " << "Bad address " << std::endl; break; } + case(WSAEINVAL): { + sif::info << "TcWinUdpPollingTask::handleReadError: WSAEINVAL: " + << "Invalid input parameters. " << std::endl; + break; + } default: { - sif::info << "TmTcWinUdpBridge::handleReadError: Error code: " + sif::info << "TcWinUdpPollingTask::handleReadError: Error code: " << error << std::endl; break; } From a0d5b2331183d40edacc4a81a6022573d00a18a0 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sun, 20 Dec 2020 02:09:08 +0100 Subject: [PATCH 15/24] small improvement --- osal/host/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osal/host/CMakeLists.txt b/osal/host/CMakeLists.txt index d73e6f27..aa32990b 100644 --- a/osal/host/CMakeLists.txt +++ b/osal/host/CMakeLists.txt @@ -13,9 +13,9 @@ target_sources(${LIB_FSFW_NAME} ) if(UNIX) - add_definitions(-pthread) target_link_libraries(${LIB_FSFW_NAME} PRIVATE rt + pthread ) endif() \ No newline at end of file From 3540adf022c792c5ba3470482a2cc4e83aad96fa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Dec 2020 13:21:12 +0100 Subject: [PATCH 16/24] added warning flags --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fc33e58..084bd4ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,15 @@ else() ) endif() +set(WARNING_FLAGS + -Wall + -Wextra + -Wshadow=local + -Wimplicit-fallthrough=1 + -Wno-unused-parameter + -Wno-psabi +) + # Required include paths to compile the FSFW target_include_directories(${LIB_FSFW_NAME} INTERFACE ${CMAKE_SOURCE_DIR} @@ -122,5 +131,6 @@ target_include_directories(${LIB_FSFW_NAME} PRIVATE # Machine specific options can be set with the ABI_FLAGS variable. target_compile_options(${LIB_FSFW_NAME} PRIVATE + ${WARNING_FLAGS} ${ABI_FLAGS} ) From d8e5000d47c705e4527f9cd8fe5c5960bdcea64f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Dec 2020 15:32:03 +0100 Subject: [PATCH 17/24] msvc tests --- CMakeLists.txt | 23 +++++++++++++++-------- coordinates/Sgp4Propagator.h | 2 ++ globalfunctions/timevalOperations.h | 6 ++++++ osal/Endiness.h | 14 ++++++++++++++ serviceinterface/ServiceInterfaceBuffer.h | 2 +- timemanager/Clock.h | 2 ++ 6 files changed, 40 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 084bd4ae..02849ca4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,14 +106,20 @@ else() ) endif() -set(WARNING_FLAGS - -Wall - -Wextra - -Wshadow=local - -Wimplicit-fallthrough=1 - -Wno-unused-parameter - -Wno-psabi -) +if(CMAKE_COMPILER_IS_GNUCXX) + set(WARNING_FLAGS + -Wall + -Wextra + -Wshadow=local + -Wimplicit-fallthrough=1 + -Wno-unused-parameter + -Wno-psabi + ) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(COMPILER_FLAGS "/permissive-") +endif() # Required include paths to compile the FSFW target_include_directories(${LIB_FSFW_NAME} INTERFACE @@ -132,5 +138,6 @@ target_include_directories(${LIB_FSFW_NAME} PRIVATE # Machine specific options can be set with the ABI_FLAGS variable. target_compile_options(${LIB_FSFW_NAME} PRIVATE ${WARNING_FLAGS} + ${COMPILER_FLAGS} ${ABI_FLAGS} ) diff --git a/coordinates/Sgp4Propagator.h b/coordinates/Sgp4Propagator.h index 3949547e..f813c6f4 100644 --- a/coordinates/Sgp4Propagator.h +++ b/coordinates/Sgp4Propagator.h @@ -1,7 +1,9 @@ #ifndef SGP4PROPAGATOR_H_ #define SGP4PROPAGATOR_H_ +#ifndef WIN32 #include +#endif #include "../contrib/sgp4/sgp4unit.h" #include "../returnvalues/HasReturnvaluesIF.h" diff --git a/globalfunctions/timevalOperations.h b/globalfunctions/timevalOperations.h index 3977d5d9..18eef866 100644 --- a/globalfunctions/timevalOperations.h +++ b/globalfunctions/timevalOperations.h @@ -2,7 +2,13 @@ #define TIMEVALOPERATIONS_H_ #include + +#ifdef WIN32 +// Why MSVC? Why? :))) +#include +#else #include +#endif timeval& operator+=(timeval& lhs, const timeval& rhs); diff --git a/osal/Endiness.h b/osal/Endiness.h index 65cc0a10..9d3fdef0 100644 --- a/osal/Endiness.h +++ b/osal/Endiness.h @@ -22,9 +22,23 @@ #else #error "Can't decide which end is which!" #endif +#else + +#ifdef WIN32 +#include +#if REG_DWORD == REG_DWORD_LITTLE_ENDIAN +#define BYTE_ORDER_SYSTEM LITTLE_ENDIAN +#else +#define BYTE_ORDER_SYSTEM BIG_ENDIAN +#endif + + #else #error __BYTE_ORDER__ not defined #endif + +#endif + #endif diff --git a/serviceinterface/ServiceInterfaceBuffer.h b/serviceinterface/ServiceInterfaceBuffer.h index c5d5b258..e69538d1 100644 --- a/serviceinterface/ServiceInterfaceBuffer.h +++ b/serviceinterface/ServiceInterfaceBuffer.h @@ -30,7 +30,7 @@ protected: //! This is called when buffer becomes full. If //! buffer is not used, then this is called every //! time when characters are put to stream. - int overflow(int c = Traits::eof()) override; + int overflow(int c = std::ostream::traits_type::eof()) override; //! This function is called when stream is flushed, //! for example when std::endl is put to stream. diff --git a/timemanager/Clock.h b/timemanager/Clock.h index d8b06fda..7e27e40d 100644 --- a/timemanager/Clock.h +++ b/timemanager/Clock.h @@ -6,7 +6,9 @@ #include "../globalfunctions/timevalOperations.h" #include +#ifndef WIN32 #include +#endif //! Don't use these for time points, type is not large enough for UNIX epoch. using dur_millis_t = uint32_t; From de183e6c6589386cbbfefe6ba56e0dc45a2f6faa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Dec 2020 17:01:22 +0100 Subject: [PATCH 18/24] removed comment --- globalfunctions/timevalOperations.h | 1 - 1 file changed, 1 deletion(-) diff --git a/globalfunctions/timevalOperations.h b/globalfunctions/timevalOperations.h index 18eef866..46f763b9 100644 --- a/globalfunctions/timevalOperations.h +++ b/globalfunctions/timevalOperations.h @@ -4,7 +4,6 @@ #include #ifdef WIN32 -// Why MSVC? Why? :))) #include #else #include From 5c45b823ad8807d4cd83e109eed7da87feceb56e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 21 Dec 2020 13:52:41 +0100 Subject: [PATCH 19/24] include fix --- globalfunctions/timevalOperations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/globalfunctions/timevalOperations.h b/globalfunctions/timevalOperations.h index 46f763b9..db68f330 100644 --- a/globalfunctions/timevalOperations.h +++ b/globalfunctions/timevalOperations.h @@ -4,7 +4,7 @@ #include #ifdef WIN32 -#include +#include #else #include #endif From 1d080ba6cb3d6a73fa5647c32033ec718fe3bb72 Mon Sep 17 00:00:00 2001 From: Spacefish Date: Mon, 21 Dec 2020 14:07:06 +0100 Subject: [PATCH 20/24] clock update --- timemanager/Clock.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/timemanager/Clock.h b/timemanager/Clock.h index 7e27e40d..fcc602a2 100644 --- a/timemanager/Clock.h +++ b/timemanager/Clock.h @@ -6,7 +6,10 @@ #include "../globalfunctions/timevalOperations.h" #include -#ifndef WIN32 + +#ifdef WIN32 +#include +#else #include #endif From 5317391f8a1077eebc179e3ce3df8cdb9e753315 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 21 Dec 2020 17:19:43 +0100 Subject: [PATCH 21/24] reverted change --- serviceinterface/ServiceInterfaceBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serviceinterface/ServiceInterfaceBuffer.h b/serviceinterface/ServiceInterfaceBuffer.h index e69538d1..c5d5b258 100644 --- a/serviceinterface/ServiceInterfaceBuffer.h +++ b/serviceinterface/ServiceInterfaceBuffer.h @@ -30,7 +30,7 @@ protected: //! This is called when buffer becomes full. If //! buffer is not used, then this is called every //! time when characters are put to stream. - int overflow(int c = std::ostream::traits_type::eof()) override; + int overflow(int c = Traits::eof()) override; //! This function is called when stream is flushed, //! for example when std::endl is put to stream. From 6f756a721c9262cce17003d2dfe4163738e583d4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 22 Dec 2020 13:05:59 +0100 Subject: [PATCH 22/24] clearing HK messagei ncluded now --- ipc/CommandMessageCleaner.cpp | 8 ++++++-- ipc/MessageQueueMessageIF.h | 2 +- ipc/MutexFactory.h | 6 +++--- ipc/MutexHelper.h | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ipc/CommandMessageCleaner.cpp b/ipc/CommandMessageCleaner.cpp index 6a99b4d2..6a364069 100644 --- a/ipc/CommandMessageCleaner.cpp +++ b/ipc/CommandMessageCleaner.cpp @@ -1,4 +1,4 @@ -#include "../ipc/CommandMessageCleaner.h" +#include "CommandMessageCleaner.h" #include "../devicehandlers/DeviceHandlerMessage.h" #include "../health/HealthMessage.h" @@ -7,11 +7,12 @@ #include "../monitoring/MonitoringMessage.h" #include "../subsystem/modes/ModeSequenceMessage.h" #include "../tmstorage/TmStoreMessage.h" +#include "../housekeeping/HousekeepingMessage.h" #include "../parameters/ParameterMessage.h" void CommandMessageCleaner::clearCommandMessage(CommandMessage* message) { switch(message->getMessageType()){ - case messagetypes::MODE_COMMAND: + case messagetypes::MODE_COMMAND: ModeMessage::clear(message); break; case messagetypes::HEALTH_COMMAND: @@ -38,6 +39,9 @@ void CommandMessageCleaner::clearCommandMessage(CommandMessage* message) { case messagetypes::PARAMETER: ParameterMessage::clear(message); break; + case messagetypes::HOUSEKEEPING: + HousekeepingMessage::clear(message); + break; default: messagetypes::clearMissionMessage(message); break; diff --git a/ipc/MessageQueueMessageIF.h b/ipc/MessageQueueMessageIF.h index b5a30c08..33e01e7d 100644 --- a/ipc/MessageQueueMessageIF.h +++ b/ipc/MessageQueueMessageIF.h @@ -1,7 +1,7 @@ #ifndef FRAMEWORK_IPC_MESSAGEQUEUEMESSAGEIF_H_ #define FRAMEWORK_IPC_MESSAGEQUEUEMESSAGEIF_H_ -#include +#include "messageQueueDefinitions.h" #include #include diff --git a/ipc/MutexFactory.h b/ipc/MutexFactory.h index f8133d81..db505ff9 100644 --- a/ipc/MutexFactory.h +++ b/ipc/MutexFactory.h @@ -1,5 +1,5 @@ -#ifndef FRAMEWORK_IPC_MUTEXFACTORY_H_ -#define FRAMEWORK_IPC_MUTEXFACTORY_H_ +#ifndef FSFW_IPC_MUTEXFACTORY_H_ +#define FSFW_IPC_MUTEXFACTORY_H_ #include "MutexIF.h" /** @@ -31,4 +31,4 @@ private: -#endif /* FRAMEWORK_IPC_MUTEXFACTORY_H_ */ +#endif /* FSFW_IPC_MUTEXFACTORY_H_ */ diff --git a/ipc/MutexHelper.h b/ipc/MutexHelper.h index 3dc36921..97001ade 100644 --- a/ipc/MutexHelper.h +++ b/ipc/MutexHelper.h @@ -16,8 +16,8 @@ public: << timeoutMs << " milliseconds!" << std::endl; } else if(status != HasReturnvaluesIF::RETURN_OK){ - sif::error << "MutexHelper: Lock of Mutex failed with code " << - status << std::endl; + sif::error << "MutexHelper: Lock of Mutex failed with code " + << status << std::endl; } } From 6b1a8afe2b50a59f35946086ee6e846c28742ae1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 22 Dec 2020 13:25:50 +0100 Subject: [PATCH 23/24] unittest update 2 --- .../objects => core}/CatchFactory.cpp | 0 .../{testcfg/objects => core}/CatchFactory.h | 6 +-- unittest/core/CatchSetup.cpp | 7 +-- unittest/testcfg/FSFWConfig.h | 49 ++++++++++++------- unittest/testcfg/Makefile-FSFW-Tests | 13 ++--- unittest/testcfg/testcfg.mk | 8 --- 6 files changed, 42 insertions(+), 41 deletions(-) rename unittest/{testcfg/objects => core}/CatchFactory.cpp (100%) rename unittest/{testcfg/objects => core}/CatchFactory.h (71%) diff --git a/unittest/testcfg/objects/CatchFactory.cpp b/unittest/core/CatchFactory.cpp similarity index 100% rename from unittest/testcfg/objects/CatchFactory.cpp rename to unittest/core/CatchFactory.cpp diff --git a/unittest/testcfg/objects/CatchFactory.h b/unittest/core/CatchFactory.h similarity index 71% rename from unittest/testcfg/objects/CatchFactory.h rename to unittest/core/CatchFactory.h index 84f9207e..f06e7ae5 100644 --- a/unittest/testcfg/objects/CatchFactory.h +++ b/unittest/core/CatchFactory.h @@ -1,5 +1,5 @@ -#ifndef FACTORY_H_ -#define FACTORY_H_ +#ifndef FSFW_CATCHFACTORY_H_ +#define FSFW_CATCHFACTORY_H_ #include @@ -13,4 +13,4 @@ namespace Factory { } -#endif /* FACTORY_H_ */ +#endif /* FSFW_CATCHFACTORY_H_ */ diff --git a/unittest/core/CatchSetup.cpp b/unittest/core/CatchSetup.cpp index cb5bd33e..c93cf032 100644 --- a/unittest/core/CatchSetup.cpp +++ b/unittest/core/CatchSetup.cpp @@ -1,6 +1,5 @@ +#include #include "CatchDefinitions.h" -#include "CatchFactory.h" - #include #ifdef GCOV @@ -10,15 +9,11 @@ #include "../../objectmanager/ObjectManager.h" #include "../../objectmanager/ObjectManagerIF.h" #include "../../storagemanager/StorageManagerIF.h" -#include "../../datapool/DataPool.h" #include "../../serviceinterface/ServiceInterfaceStream.h" /* Global instantiations normally done in main.cpp */ /* Initialize Data Pool */ -//namespace glob { -DataPool dataPool(datapool::dataPoolInit); -//} namespace sif { diff --git a/unittest/testcfg/FSFWConfig.h b/unittest/testcfg/FSFWConfig.h index 59934560..94f6e59d 100644 --- a/unittest/testcfg/FSFWConfig.h +++ b/unittest/testcfg/FSFWConfig.h @@ -1,44 +1,57 @@ #ifndef CONFIG_FSFWCONFIG_H_ #define CONFIG_FSFWCONFIG_H_ -#include +#include +#include //! Used to determine whether C++ ostreams are used //! Those can lead to code bloat. #define FSFW_CPP_OSTREAM_ENABLED 1 -//! Reduced printout to further decrese code size +//! Reduced printout to further decrease code size //! Be careful, this also turns off most diagnostic prinouts! -#define FSFW_REDUCED_PRINTOUT 0 +#define FSFW_ENHANCED_PRINTOUT 0 -//! Can be used to enable debugging printouts for developing the FSFW -#define FSFW_DEBUGGING 0 - -//! Defines the FIFO depth of each commanding service base which -//! also determines how many commands a CSB service can handle in one cycle -//! simulataneously. This will increase the required RAM for -//! each CSB service ! -#define FSFW_CSB_FIFO_DEPTH 6 +//! Can be used to enable additional debugging printouts for developing the FSFW +#define FSFW_PRINT_VERBOSITY_LEVEL 0 //! If FSFW_OBJ_EVENT_TRANSLATION is set to one, //! additional output which requires the translation files translateObjects //! and translateEvents (and their compiled source files) #define FSFW_OBJ_EVENT_TRANSLATION 0 -//! If -DDEBUG is supplied in the build defines, there will be -//! additional output which requires the translation files translateObjects -//! and translateEvents (and their compiles source files) #if FSFW_OBJ_EVENT_TRANSLATION == 1 +#define FSFW_DEBUG_OUTPUT 1 //! Specify whether info events are printed too. -#define FSFW_DEBUG_INFO 1 -#include -#include +#define FSFW_DEBUG_INFO 1 +#include "objects/translateObjects.h" +#include "events/translateEvents.h" #else +#define FSFW_DEBUG_OUTPUT 0 #endif //! When using the newlib nano library, C99 support for stdio facilities //! will not be provided. This define should be set to 1 if this is the case. -#define FSFW_NO_C99_IO 1 +#define FSFW_NO_C99_IO 1 +//! Specify whether a special mode store is used for Subsystem components. +#define FSFW_USE_MODESTORE 0 + +namespace fsfwconfig { +//! Default timestamp size. The default timestamp will be an eight byte CDC +//! short timestamp. +static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 8; + +//! Configure the allocated pool sizes for the event manager. +static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240; +static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120; +static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120; + +//! Defines the FIFO depth of each commanding service base which +//! also determines how many commands a CSB service can handle in one cycle +//! simulataneously. This will increase the required RAM for +//! each CSB service ! +static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 3; +} #endif /* CONFIG_FSFWCONFIG_H_ */ diff --git a/unittest/testcfg/Makefile-FSFW-Tests b/unittest/testcfg/Makefile-FSFW-Tests index 2017d2bd..550fd1de 100644 --- a/unittest/testcfg/Makefile-FSFW-Tests +++ b/unittest/testcfg/Makefile-FSFW-Tests @@ -15,7 +15,7 @@ SHELL = /bin/sh # (can be overriden by adding CHIP=chip and BOARD=board to the command-line) # Unit Test can only be run on host machine for now (Linux) FRAMEWORK_PATH = fsfw -FILE_ROOT = $(FRAMEWORK_PATH)/unittest +TEST_FILE_ROOT = $(FRAMEWORK_PATH)/unittest BOARD = unittest LINUX = 1 OS_FSFW = linux @@ -58,9 +58,10 @@ endif UNIT_TEST = 1 # General folder paths -CONFIG_PATH = $(FILE_ROOT)/config -UNIT_TEST_PATH = $(FILE_ROOT)/tests -CORE_PATH = $(FILE_ROOT)/core +CONFIG_PATH = testcfg +# Core copy has to be copied as well. +CORE_PATH = core +UNIT_TEST_PATH = $(TEST_FILE_ROOT)/tests # Output file basename BASENAME = fsfw @@ -154,8 +155,8 @@ include $(S)/$(notdir $S).mk endef $(foreach S,$(SUBDIRS),$(eval $(INCLUDE_FILE))) -INCLUDES += $(FILE_ROOT) -INCLUDES += $(FILE_ROOT)/catch2/ +INCLUDES += $(TEST_FILE_ROOT) +INCLUDES += $(TEST_FILE_ROOT)/catch2/ #------------------------------------------------------------------------------- # Source Files diff --git a/unittest/testcfg/testcfg.mk b/unittest/testcfg/testcfg.mk index 31d3b60a..fca2f732 100644 --- a/unittest/testcfg/testcfg.mk +++ b/unittest/testcfg/testcfg.mk @@ -6,11 +6,3 @@ CXXSRC += $(wildcard $(CURRENTPATH)/events/*.cpp) CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp) INCLUDES += $(CURRENTPATH) -INCLUDES += $(CURRENTPATH)/objects -INCLUDES += $(CURRENTPATH)/ipc -INCLUDES += $(CURRENTPATH)/pollingsequence -INCLUDES += $(CURRENTPATH)/returnvalues -INCLUDES += $(CURRENTPATH)/tmtc -INCLUDES += $(CURRENTPATH)/events -INCLUDES += $(CURRENTPATH)/devices -INCLUDES += $(CURRENTPATH)/cdatapool From 4c41e3604424f508556d96b4a32081cca0b5f8bb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 22 Dec 2020 13:29:06 +0100 Subject: [PATCH 24/24] nullptr check added --- datapool/PoolDataSetBase.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datapool/PoolDataSetBase.cpp b/datapool/PoolDataSetBase.cpp index 1acd3fd3..cb2348f7 100644 --- a/datapool/PoolDataSetBase.cpp +++ b/datapool/PoolDataSetBase.cpp @@ -59,6 +59,11 @@ uint16_t PoolDataSetBase::getFillCount() const { ReturnValue_t PoolDataSetBase::readVariable(uint16_t count) { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + if(registeredVariables[count] == nullptr) { + // configuration error. + return HasReturnvaluesIF::RETURN_FAILED; + } + // These checks are often performed by the respective // variable implementation too, but I guess a double check does not hurt. if (registeredVariables[count]->getReadWriteMode() !=