WIP: SCEX Init #272
@ -210,15 +210,19 @@ void UartTestClass::scexPeriodic() {
|
||||
}
|
||||
// fram
|
||||
// packetcounter eins höher, wenn mehr packet verloren -> merkt sich welches packet fehlt
|
||||
//was wenn erstes packet fehlt; mit boolean var (firstpacketarrived=false) die immer mit finish false wird?
|
||||
// was wenn erstes packet fehlt; mit boolean var (firstpacketarrived=false) die immer mit
|
||||
// finish false wird?
|
||||
// countdown (max 2min), wenn nicht if (helper.getPacketCounter() ==
|
||||
// helper.getTotalPacketCounter()) { nach 2min reader->finish();
|
||||
if (helper.getCmd() == FRAM) {
|
||||
if (not fileNameSet) {
|
||||
fileId = gen_random(12);
|
||||
fileName = "/tmp/scex-fram_" + fileId + ".bin";
|
||||
fileNameSet = true;
|
||||
}
|
||||
if (helper.getPacketCounter() == 1) {
|
||||
// countdown starten
|
||||
finishCountdown.resetTimer();
|
||||
fileId = gen_random(12);
|
||||
fileName = "/tmp/scex-fram_"+fileId+".bin";
|
||||
ofstream out(fileName,
|
||||
ofstream::binary); // neues file anlegen
|
||||
} else {
|
||||
@ -229,6 +233,9 @@ void UartTestClass::scexPeriodic() {
|
||||
|
||||
if (finishCountdown.hasTimedOut()) {
|
||||
reader->finish();
|
||||
sif::warning << "Reader countdown expired" << endl;
|
||||
cmdDone = true;
|
||||
fileNameSet = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,8 +243,10 @@ void UartTestClass::scexPeriodic() {
|
||||
reader->finish();
|
||||
sif::info << "Reader is finished" << endl;
|
||||
cmdDone = true;
|
||||
fileNameSet = false;
|
||||
if (helper.getCmd() == scex::ScexCmds::PING) {
|
||||
cmdSent = false;
|
||||
fileNameSet = true; // to not generate everytime new file
|
||||
}
|
||||
}
|
||||
} while (len > 0);
|
||||
|
@ -50,6 +50,7 @@ class UartTestClass : public TestTask {
|
||||
|
||||
std::string fileId = "";
|
||||
std::string fileName = "";
|
||||
bool fileNameSet = false;
|
||||
Countdown finishCountdown = Countdown(180 * 1000);
|
||||
bool cmdSent = false;
|
||||
bool cmdDone = false;
|
||||
|
Loading…
Reference in New Issue
Block a user