From aeff4685ad9db69e03a2c6902a3c0c99ad841f47 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 8 Jul 2021 12:22:41 +0200 Subject: [PATCH] updated file system handler --- bsp_q7s/memory/CMakeLists.txt | 2 +- bsp_q7s/memory/FileSystemHandler.cpp | 16 +++++++++++++ bsp_q7s/memory/FileSystemHandler.h | 36 ++++++++++++++++++++++++++++ bsp_q7s/memory/FileSystemManager.cpp | 7 ------ bsp_q7s/memory/FileSystemManager.h | 8 ------- fsfw | 2 +- 6 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 bsp_q7s/memory/FileSystemHandler.cpp create mode 100644 bsp_q7s/memory/FileSystemHandler.h delete mode 100644 bsp_q7s/memory/FileSystemManager.cpp delete mode 100644 bsp_q7s/memory/FileSystemManager.h diff --git a/bsp_q7s/memory/CMakeLists.txt b/bsp_q7s/memory/CMakeLists.txt index 35ee43ea..e98971c4 100644 --- a/bsp_q7s/memory/CMakeLists.txt +++ b/bsp_q7s/memory/CMakeLists.txt @@ -1,5 +1,5 @@ target_sources(${TARGET_NAME} PRIVATE - FileSystemManager.cpp + FileSystemHandler.cpp SdCardAccess.cpp SdCardManager.cpp ) \ No newline at end of file diff --git a/bsp_q7s/memory/FileSystemHandler.cpp b/bsp_q7s/memory/FileSystemHandler.cpp new file mode 100644 index 00000000..7adb59fe --- /dev/null +++ b/bsp_q7s/memory/FileSystemHandler.cpp @@ -0,0 +1,16 @@ +#include "FileSystemHandler.h" + +#include "fsfw/tasks/TaskFactory.h" + +FileSystemHandler::FileSystemHandler(object_id_t fileSystemHandler): + SystemObject(fileSystemHandler) { +} + +ReturnValue_t FileSystemHandler::performOperation(uint8_t unsignedChar) { + while(true) { + // This task will have a low priority and will run permanently in the background + // so we will just run in a permanent loop here and check file system + // messages permanently + TaskFactory::instance()->delayTask(1000); + } +} diff --git a/bsp_q7s/memory/FileSystemHandler.h b/bsp_q7s/memory/FileSystemHandler.h new file mode 100644 index 00000000..c45bbd5e --- /dev/null +++ b/bsp_q7s/memory/FileSystemHandler.h @@ -0,0 +1,36 @@ +#ifndef BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_ +#define BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_ + +#include "fsfw/tasks/ExecutableObjectIF.h" +#include "fsfw/objectmanager/SystemObject.h" +#include "fsfw/memory/HasFileSystemIF.h" + +class FileSystemHandler: public SystemObject, + public ExecutableObjectIF, + public HasFileSystemIF { +public: + FileSystemHandler(object_id_t fileSystemHandler); + + ReturnValue_t performOperation(uint8_t) override; + + /** + * Function to get the MessageQueueId_t of the implementing object + * @return MessageQueueId_t of the object + */ + virtual MessageQueueId_t getCommandQueue() const = 0; + +private: + + ReturnValue_t appendToFile(const char* repositoryPath, + const char* filename, const uint8_t* data, size_t size, + uint16_t packetNumber, void* args = nullptr) override; + ReturnValue_t createFile(const char* repositoryPath, + const char* filename, const uint8_t* data = nullptr, + size_t size = 0, void* args = nullptr) override; + ReturnValue_t deleteFile(const char* repositoryPath, + const char* filename, void* args = nullptr) override; +}; + + + +#endif /* BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ */ diff --git a/bsp_q7s/memory/FileSystemManager.cpp b/bsp_q7s/memory/FileSystemManager.cpp deleted file mode 100644 index 40c8e58a..00000000 --- a/bsp_q7s/memory/FileSystemManager.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "FileSystemManager.h" - -class FileSystemManager { -public: - -private: -}; diff --git a/bsp_q7s/memory/FileSystemManager.h b/bsp_q7s/memory/FileSystemManager.h deleted file mode 100644 index 4fc8dc52..00000000 --- a/bsp_q7s/memory/FileSystemManager.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ -#define BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ - - - - - -#endif /* BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ */ diff --git a/fsfw b/fsfw index c2b8507d..eef2fd3b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c2b8507d2947c48e2a2cd19b71640471f436bc5c +Subproject commit eef2fd3b7ac764f06ed5d9a3c97c894d92a515fa