found issue root
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
#include "Q7STestTask.h"
|
||||
|
||||
#include "fsfw/timemanager/Stopwatch.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cstdio>
|
||||
@ -16,10 +18,27 @@ ReturnValue_t Q7STestTask::performOneShotAction() {
|
||||
void Q7STestTask::sdCardTests() {
|
||||
using namespace std;
|
||||
Stopwatch stopwatch;
|
||||
ofstream testFile("/tmp/test.txt");
|
||||
testFile << "Hallo Welt" << endl;
|
||||
testFile.close();
|
||||
//FILE* testFile = popen("q7hw sd info all", "r");
|
||||
int result = std::system("q7hw sd info all > /tmp/sd_status.txt");
|
||||
if(result != 0) {
|
||||
sif::debug << "system call failed with " << result << endl;
|
||||
}
|
||||
ifstream sdStatus("/tmp/sd_status.txt");
|
||||
string line;
|
||||
uint8_t idx = 0;
|
||||
while (std::getline(sdStatus, line)) {
|
||||
std::istringstream iss(line);
|
||||
string word;
|
||||
while(iss >> word) {
|
||||
if(word == "on") {
|
||||
sif::info << "SD card " << static_cast<int>(idx) << " is on" << endl;
|
||||
}
|
||||
else if(word == "off") {
|
||||
sif::info << "SD card " << static_cast<int>(idx) << " is off" << endl;
|
||||
}
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
std::remove("/tmp/sd_status.txt");
|
||||
//TaskFactory::delayTask(3000);
|
||||
//int result = system();
|
||||
//std::fstream fs(testFile);
|
||||
@ -43,3 +62,13 @@ void Q7STestTask::sdCardTests() {
|
||||
// system("q7hw sd set 0 off > /tmp/sd_set.txt");
|
||||
// stopwatch.stop(true);
|
||||
}
|
||||
|
||||
void Q7STestTask::fileTests() {
|
||||
using namespace std;
|
||||
ofstream testFile("/tmp/test.txt");
|
||||
testFile << "Hallo Welt" << endl;
|
||||
testFile.close();
|
||||
|
||||
system("echo \"Hallo Welt\" > /tmp/test2.txt");
|
||||
system("echo \"Hallo Welt\"");
|
||||
}
|
||||
|
Reference in New Issue
Block a user