SD Card, Scratch Buffer and README updates #52

Merged
meierj merged 41 commits from mueller/first-sd-tests into develop 2021-07-09 22:02:31 +02:00
2 changed files with 48 additions and 1 deletions
Showing only changes of commit a3610d28ba - Show all commits

View File

@ -1,16 +1,60 @@
#include "FileSystemHandler.h"
#include "fsfw/tasks/TaskFactory.h"
#include "fsfw/memory/GenericFileSystemMessage.h"
#include "fsfw/ipc/QueueFactory.h"
FileSystemHandler::FileSystemHandler(object_id_t fileSystemHandler):
SystemObject(fileSystemHandler) {
mq = QueueFactory::instance()->createMessageQueue(50);
}
FileSystemHandler::~FileSystemHandler() {
QueueFactory::instance()->deleteMessageQueue(mq);
}
ReturnValue_t FileSystemHandler::performOperation(uint8_t unsignedChar) {
while(true) {
CommandMessage filemsg;
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
while(true) {
result = mq->receiveMessage(&filemsg);
if(result == MessageQueueIF::EMPTY) {
break;
}
else if(result != HasReturnvaluesIF::RETURN_FAILED) {
sif::warning << "FileSystemHandler::performOperation: Message reception failed!"
<< std::endl;
break;
}
Command_t command = filemsg.getCommand();
switch(command) {
}
}
// 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);
}
}
MessageQueueId_t FileSystemHandler::getCommandQueue() const {
return mq->getId();
}
ReturnValue_t FileSystemHandler::appendToFile(const char *repositoryPath, const char *filename,
const uint8_t *data, size_t size, uint16_t packetNumber, void *args) {
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t FileSystemHandler::createFile(const char *repositoryPath, const char *filename,
const uint8_t *data, size_t size, void *args) {
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t FileSystemHandler::deleteFile(const char *repositoryPath, const char *filename,
void *args) {
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -1,6 +1,7 @@
#ifndef BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_
#define BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/objectmanager/SystemObject.h"
#include "fsfw/memory/HasFileSystemIF.h"
@ -10,6 +11,7 @@ class FileSystemHandler: public SystemObject,
public HasFileSystemIF {
public:
FileSystemHandler(object_id_t fileSystemHandler);
virtual~ FileSystemHandler();
ReturnValue_t performOperation(uint8_t) override;
@ -17,9 +19,10 @@ public:
* Function to get the MessageQueueId_t of the implementing object
* @return MessageQueueId_t of the object
*/
virtual MessageQueueId_t getCommandQueue() const = 0;
MessageQueueId_t getCommandQueue() const override;
private:
MessageQueueIF* mq = nullptr;
ReturnValue_t appendToFile(const char* repositoryPath,
const char* filename, const uint8_t* data, size_t size,