testing scratch API

This commit is contained in:
2021-07-09 17:21:26 +02:00
committed by Robin Mueller
parent bef73d7357
commit e9cfa0c117
4 changed files with 39 additions and 5 deletions

View File

@ -3,6 +3,8 @@
#include "fsfw/timemanager/Stopwatch.h"
#include "fsfw/tasks/TaskFactory.h"
#include "bsp_q7s/memory/scratchApi.h"
#include <iostream>
#include <fstream>
#include <cstdio>
@ -12,6 +14,7 @@ Q7STestTask::Q7STestTask(object_id_t objectId): TestTask(objectId) {
ReturnValue_t Q7STestTask::performOneShotAction() {
//sdCardTests();
testScratchApi();
return TestTask::performOneShotAction();
}
@ -50,3 +53,15 @@ void Q7STestTask::fileTests() {
system("echo \"Hallo Welt\" > /tmp/test2.txt");
system("echo \"Hallo Welt\"");
}
void Q7STestTask::testScratchApi() {
ReturnValue_t result = scratch::writeNumber("TEST", 1);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::debug << "Q7STestTask::scratchApiTest: Writing number failed" << std::endl;
}
int number = 0;
result = scratch::readNumber("TEST", number);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::debug << "Q7STestTask::scratchApiTest: Reading number failed" << std::endl;
}
}