From 9c217ad91e3f28d786b911e9d4edd94ff65c1c58 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 14 Dec 2022 09:53:38 +0100 Subject: [PATCH] now hosted should compile again --- bsp_hosted/ObjectFactory.cpp | 4 +++- bsp_linux_board/CMakeLists.txt | 2 +- bsp_linux_board/ObjectFactory.cpp | 2 +- bsp_linux_board/RPiSdCardManager.cpp | 13 ------------- mission/utility/CMakeLists.txt | 2 +- mission/utility/DummySdCardManager.cpp | 13 +++++++++++++ .../utility/DummySdCardManager.h | 6 +++--- 7 files changed, 22 insertions(+), 20 deletions(-) delete mode 100644 bsp_linux_board/RPiSdCardManager.cpp create mode 100644 mission/utility/DummySdCardManager.cpp rename bsp_linux_board/RPiSdCardManager.h => mission/utility/DummySdCardManager.h (74%) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 779bb006..ae768a7c 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -8,6 +8,7 @@ #include #include +#include "../mission/utility/DummySdCardManager.h" #include "OBSWConfig.h" #include "devConf.h" #include "eive/definitions.h" @@ -78,7 +79,8 @@ void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); PusTmFunnel* pusFunnel; CfdpTmFunnel* cfdpFunnel; - ObjectFactory::produceGenericObjects(nullptr, &pusFunnel, &cfdpFunnel); + auto sdcMan = new DummySdCardManager("/tmp"); + ObjectFactory::produceGenericObjects(nullptr, &pusFunnel, &cfdpFunnel, *sdcMan); DummyGpioIF* dummyGpioIF = new DummyGpioIF(); auto* dummySwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); diff --git a/bsp_linux_board/CMakeLists.txt b/bsp_linux_board/CMakeLists.txt index 39f06401..9e3ec023 100644 --- a/bsp_linux_board/CMakeLists.txt +++ b/bsp_linux_board/CMakeLists.txt @@ -1,5 +1,5 @@ target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp gpioInit.cpp - ObjectFactory.cpp RPiSdCardManager.cpp) + ObjectFactory.cpp) add_subdirectory(boardconfig) add_subdirectory(boardtest) diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index 53db052c..95ea87bb 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -82,7 +82,7 @@ void ObjectFactory::produce(void* args) { #endif #if OBSW_ADD_SCEX_DEVICE == 1 - auto* sdcMan = new RPiSdCardManager("/tmp"); + auto* sdcMan = new DummySdCardManager("/tmp"); createScexComponents(uart::DEV, pwrSwitcher, *sdcMan, true, std::nullopt); #endif diff --git a/bsp_linux_board/RPiSdCardManager.cpp b/bsp_linux_board/RPiSdCardManager.cpp deleted file mode 100644 index dfcae8da..00000000 --- a/bsp_linux_board/RPiSdCardManager.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "RPiSdCardManager.h" - -RPiSdCardManager::RPiSdCardManager(std::string prefix) : prefix(std::move(prefix)) {} - -const std::string& RPiSdCardManager::getCurrentMountPrefix() const { return prefix; } - -bool RPiSdCardManager::isSdCardUsable(sd::SdCard sdCard) { return true; } - -std::optional RPiSdCardManager::getPreferredSdCard() const { return std::nullopt; } - -void RPiSdCardManager::setActiveSdCard(sd::SdCard sdCard) {} - -std::optional RPiSdCardManager::getActiveSdCard() const { return std::nullopt; } diff --git a/mission/utility/CMakeLists.txt b/mission/utility/CMakeLists.txt index e2459ed1..dadce33f 100644 --- a/mission/utility/CMakeLists.txt +++ b/mission/utility/CMakeLists.txt @@ -1,3 +1,3 @@ target_sources( ${LIB_EIVE_MISSION} PRIVATE Timestamp.cpp ProgressPrinter.cpp Filenaming.cpp - GlobalConfigHandler.cpp) + GlobalConfigHandler.cpp DummySdCardManager.cpp) diff --git a/mission/utility/DummySdCardManager.cpp b/mission/utility/DummySdCardManager.cpp new file mode 100644 index 00000000..1b2a45e1 --- /dev/null +++ b/mission/utility/DummySdCardManager.cpp @@ -0,0 +1,13 @@ +#include "DummySdCardManager.h" + +DummySdCardManager::DummySdCardManager(std::string prefix) : prefix(std::move(prefix)) {} + +const std::string& DummySdCardManager::getCurrentMountPrefix() const { return prefix; } + +bool DummySdCardManager::isSdCardUsable(std::optional sdCard) { return true; } + +std::optional DummySdCardManager::getPreferredSdCard() const { return std::nullopt; } + +void DummySdCardManager::setActiveSdCard(sd::SdCard sdCard) {} + +std::optional DummySdCardManager::getActiveSdCard() const { return std::nullopt; } diff --git a/bsp_linux_board/RPiSdCardManager.h b/mission/utility/DummySdCardManager.h similarity index 74% rename from bsp_linux_board/RPiSdCardManager.h rename to mission/utility/DummySdCardManager.h index 068471c1..1a74dc10 100644 --- a/bsp_linux_board/RPiSdCardManager.h +++ b/mission/utility/DummySdCardManager.h @@ -2,11 +2,11 @@ #define BSP_LINUX_BOARD_RPISDCARDMANAGER_H_ #include -class RPiSdCardManager : public SdCardMountedIF { +class DummySdCardManager : public SdCardMountedIF { public: - RPiSdCardManager(std::string prefix); + DummySdCardManager(std::string prefix); const std::string& getCurrentMountPrefix() const override; - bool isSdCardUsable(sd::SdCard sdCard) override; + bool isSdCardUsable(std::optional sdCard) override; std::optional getPreferredSdCard() const override; void setActiveSdCard(sd::SdCard sdCard) override; std::optional getActiveSdCard() const override;