From e2f0c0f1be3885abec108d34f0333fd786109db0 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Tue, 26 Apr 2022 13:22:56 +0200 Subject: [PATCH] fram rec --- linux/boardtest/UartTestClass.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index b4a23c6c..12404269 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -25,7 +25,7 @@ UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) : TestTask(objectId), reader(reader) { mode = TestModes::SCEX; scexMode = ScexModes::READER_TASK; - currCmd = scex::ScexCmds::PING; + currCmd = scex::ScexCmds::FRAM; if (scexMode == ScexModes::SIMPLE) { auto encodingBuf = new std::array; DleParser::BufPair encodingBufPair{encodingBuf->data(), encodingBuf->size()}; @@ -178,7 +178,7 @@ void UartTestClass::scexPeriodic() { } else { if (not cmdSent) { size_t len = 0; - prepareScexCmd(scex::ScexCmds::PING, false, cmdBuf.data(), &len); + prepareScexCmd(currCmd, false, cmdBuf.data(), &len); reader->sendMessage(uartCookie, cmdBuf.data(), len); cmdSent = true; cmdDone = false; @@ -199,21 +199,24 @@ void UartTestClass::scexPeriodic() { //ping //if ping cmd + if(helper.getCmd() == PING) { ofstream out("/tmp/scex-ping.bin", ofstream::binary ); if (out.bad()) { sif::warning << "bad" < //countdown (max 2min), wenn nicht if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { nach 2min reader->finish(); if(helper.getCmd() == FRAM) { if(helper.getPacketCounter() == 0) { - // neues file anlegen wie oben ping + ofstream out("/tmp/scex-fram.bin", ofstream::binary ); // neues file anlegen wie oben ping } else { - // an bestehendes file hinzufügen + ofstream out("/tmp/scex-fram.bin", ofstream::binary | ofstream::app );// an bestehendes file hinzufügen + out << helper; } } - out << helper; if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { reader->finish(); @@ -326,7 +329,7 @@ void UartTestClass::scexSimplePeriodic() { int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, size_t* len) { using namespace scex; - // Send ping command + // Send command cmdBuf[0] = scex::createCmdByte(cmd, false); // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each // telecommand so far