added JSON lib, bugfixes in FileSystemHandler

This commit is contained in:
2021-07-16 20:32:13 +02:00
committed by Robin Mueller
parent b3dfbcf7fe
commit 434a0f6a7a
15 changed files with 218 additions and 108 deletions

View File

@ -1,9 +1,11 @@
#include <bsp_q7s/memory/SdCardManager.h>
#include "Q7STestTask.h"
#include "fsfw/timemanager/Stopwatch.h"
#include "fsfw/tasks/TaskFactory.h"
#include "bsp_q7s/memory/scratchApi.h"
#include <nlohmann/json.hpp>
#include <iostream>
#include <fstream>
@ -15,6 +17,15 @@ Q7STestTask::Q7STestTask(object_id_t objectId): TestTask(objectId) {
ReturnValue_t Q7STestTask::performOneShotAction() {
//sdCardTests();
testScratchApi();
Stopwatch stopwatch;
// for convenience
using json = nlohmann::json;
json helloTest;
// add a number that is stored as double (note the implicit conversion of j to an object)
helloTest["pi"] = 3.141;
std::string mntPrefix = SdCardManager::instance()->getCurrentMountPrefix();
std::ofstream o("/mnt/sd0/pretty.json");
o << std::setw(4) << helloTest << std::endl;
return TestTask::performOneShotAction();
}