Filesystem Update #53
@ -1,6 +1,5 @@
|
|||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${TARGET_NAME} PRIVATE
|
||||||
FileSystemHandler.cpp
|
FileSystemHandler.cpp
|
||||||
SdCardAccess.cpp
|
|
||||||
SdCardManager.cpp
|
SdCardManager.cpp
|
||||||
scratchApi.cpp
|
scratchApi.cpp
|
||||||
)
|
)
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
FileSystemHandler::FileSystemHandler(object_id_t fileSystemHandler):
|
FileSystemHandler::FileSystemHandler(object_id_t fileSystemHandler):
|
||||||
SystemObject(fileSystemHandler) {
|
SystemObject(fileSystemHandler) {
|
||||||
mq = QueueFactory::instance()->createMessageQueue(50);
|
mq = QueueFactory::instance()->createMessageQueue(FS_MAX_QUEUE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemHandler::~FileSystemHandler() {
|
FileSystemHandler::~FileSystemHandler() {
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
#ifndef BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_
|
#ifndef BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_
|
||||||
#define BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_
|
#define BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_
|
||||||
|
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
|
||||||
#include "fsfw/ipc/MessageQueueIF.h"
|
#include "fsfw/ipc/MessageQueueIF.h"
|
||||||
#include "fsfw/tasks/ExecutableObjectIF.h"
|
#include "fsfw/tasks/ExecutableObjectIF.h"
|
||||||
#include "fsfw/objectmanager/SystemObject.h"
|
#include "fsfw/objectmanager/SystemObject.h"
|
||||||
#include "fsfw/memory/HasFileSystemIF.h"
|
#include "fsfw/memory/HasFileSystemIF.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class FileSystemHandler: public SystemObject,
|
class FileSystemHandler: public SystemObject,
|
||||||
public ExecutableObjectIF,
|
public ExecutableObjectIF,
|
||||||
public HasFileSystemIF {
|
public HasFileSystemIF {
|
||||||
@ -23,6 +27,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MessageQueueIF* mq = nullptr;
|
MessageQueueIF* mq = nullptr;
|
||||||
|
std::string currentMountPrefix;
|
||||||
|
static constexpr uint32_t FS_MAX_QUEUE_SIZE = config::OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE;
|
||||||
|
|
||||||
ReturnValue_t appendToFile(const char* repositoryPath,
|
ReturnValue_t appendToFile(const char* repositoryPath,
|
||||||
const char* filename, const uint8_t* data, size_t size,
|
const char* filename, const uint8_t* data, size_t size,
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
#include "SdCardAccess.h"
|
|
||||||
|
|
||||||
#include "fsfw/ipc/MutexGuard.h"
|
|
||||||
|
|
||||||
SdCardAccess::SdCardAccess() {
|
|
||||||
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef BSP_Q7S_MEMORY_SDCARDACCESS_H_
|
|
||||||
#define BSP_Q7S_MEMORY_SDCARDACCESS_H_
|
|
||||||
|
|
||||||
#include "definitions.h"
|
|
||||||
|
|
||||||
class SdCardAccess {
|
|
||||||
public:
|
|
||||||
SdCardAccess();
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* BSP_Q7S_MEMORY_SDCARDACCESS_H_ */
|
|
@ -56,8 +56,21 @@ public:
|
|||||||
*/
|
*/
|
||||||
static SdCardManager* instance();
|
static SdCardManager* instance();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the preferred SD card which will determine which SD card will be used as the primary
|
||||||
|
* SD card in hot redundant and cold redundant mode. This function will not switch the
|
||||||
|
* SD cards which are currently on and mounted, this needs to be implemented by
|
||||||
|
* an upper layer by using #switchOffSdCard , #switchOnSdCard and #updateSdCardStateFile
|
||||||
|
* @param sdCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
ReturnValue_t setPreferredSdCard(sd::SdCard sdCard);
|
ReturnValue_t setPreferredSdCard(sd::SdCard sdCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the currently configured preferred SD card
|
||||||
|
* @param sdCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
ReturnValue_t getPreferredSdCard(sd::SdCard& sdCard) const;
|
ReturnValue_t getPreferredSdCard(sd::SdCard& sdCard) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,8 +137,6 @@ private:
|
|||||||
|
|
||||||
ReturnValue_t setSdCardState(sd::SdCard sdCard, bool on);
|
ReturnValue_t setSdCardState(sd::SdCard sdCard, bool on);
|
||||||
|
|
||||||
sd::SdCard preferredSdCard = sd::SdCard::SLOT_0;
|
|
||||||
|
|
||||||
void processSdStatusLine(SdStatusPair& active, std::string& line, uint8_t& idx,
|
void processSdStatusLine(SdStatusPair& active, std::string& line, uint8_t& idx,
|
||||||
sd::SdCard& currentSd);
|
sd::SdCard& currentSd);
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
#include "commonConfig.h"
|
#include "commonConfig.h"
|
||||||
#include "OBSWVersion.h"
|
#include "OBSWVersion.h"
|
||||||
|
|
||||||
|
#define OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE 50
|
||||||
|
|
||||||
/* These defines should be disabled for mission code but are useful for
|
/* These defines should be disabled for mission code but are useful for
|
||||||
debugging. */
|
debugging. */
|
||||||
#define OBSW_VERBOSE_LEVEL 1
|
#define OBSW_VERBOSE_LEVEL 1
|
||||||
|
Loading…
Reference in New Issue
Block a user