From 468fa016504496c1adbe5df01ca614cd961d5517 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 16 May 2023 11:08:33 +0200 Subject: [PATCH] bugfix --- linux/payload/PlocMpsocSpecialComHelper.cpp | 6 ++---- linux/payload/plocMpsocHelpers.h | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/linux/payload/PlocMpsocSpecialComHelper.cpp b/linux/payload/PlocMpsocSpecialComHelper.cpp index d54090a4..f8b81603 100644 --- a/linux/payload/PlocMpsocSpecialComHelper.cpp +++ b/linux/payload/PlocMpsocSpecialComHelper.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -249,10 +250,6 @@ ReturnValue_t PlocMpsocSpecialComHelper::flashfclose() { spParams.buf = commandBuffer; (*sequenceCount)++; mpsoc::FlashFclose flashFclose(spParams, *sequenceCount); - ReturnValue_t result = flashFclose.createPacket(flashReadAndWrite.mpsocFile); - if (result != returnvalue::OK) { - return result; - } return handlePacketTransmissionNoReply(flashFclose); } @@ -287,6 +284,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::handlePacketTransmissionNoReply(ploc::S ReturnValue_t PlocMpsocSpecialComHelper::sendCommand(ploc::SpTcBase& tc) { ReturnValue_t result = returnvalue::OK; + arrayprinter::print(tc.getFullPacket(), tc.getFullPacketLen()); result = uartComIF->sendMessage(comCookie, tc.getFullPacket(), tc.getFullPacketLen()); if (result != returnvalue::OK) { sif::warning << "PlocMPSoCHelper::sendCommand: Failed to send command" << std::endl; diff --git a/linux/payload/plocMpsocHelpers.h b/linux/payload/plocMpsocHelpers.h index 702df949..c65d20e0 100644 --- a/linux/payload/plocMpsocHelpers.h +++ b/linux/payload/plocMpsocHelpers.h @@ -387,10 +387,10 @@ class TcMemWrite : public TcBase { /** * @brief Class to help creation of flash fopen command. */ -class FlashFopen : public ploc::SpTcBase { +class FlashFopen : public TcBase { public: FlashFopen(ploc::SpTcParams params, uint16_t sequenceCount) - : ploc::SpTcBase(params, apid::TC_FLASHFOPEN, sequenceCount) {} + : TcBase(params, apid::TC_FLASHFOPEN, sequenceCount) {} ReturnValue_t createPacket(std::string filename, FileAccessMode mode) { accessMode = mode; @@ -415,19 +415,19 @@ class FlashFopen : public ploc::SpTcBase { /** * @brief Class to help creation of flash fclose command. */ -class FlashFclose : public ploc::SpTcBase { +class FlashFclose : public TcBase { public: FlashFclose(ploc::SpTcParams params, uint16_t sequenceCount) - : ploc::SpTcBase(params, apid::TC_FLASHFCLOSE, sequenceCount) {} + : TcBase(params, apid::TC_FLASHFCLOSE, sequenceCount) {} }; /** * @brief Class to build flash write space packet. */ -class TcFlashWrite : public ploc::SpTcBase { +class TcFlashWrite : public TcBase { public: TcFlashWrite(ploc::SpTcParams params, uint16_t sequenceCount) - : ploc::SpTcBase(params, apid::TC_FLASHWRITE, sequenceCount) {} + : TcBase(params, apid::TC_FLASHWRITE, sequenceCount) {} ReturnValue_t buildPacket(const uint8_t* writeData, uint32_t writeLen_) { ReturnValue_t result = returnvalue::OK; @@ -460,10 +460,10 @@ class TcFlashWrite : public ploc::SpTcBase { uint32_t writeLen = 0; }; -class TcFlashRead : public ploc::SpTcBase { +class TcFlashRead : public TcBase { public: TcFlashRead(ploc::SpTcParams params, uint16_t sequenceCount) - : ploc::SpTcBase(params, apid::TC_FLASHWRITE, sequenceCount) {} + : TcBase(params, apid::TC_FLASHWRITE, sequenceCount) {} ReturnValue_t buildPacket(uint32_t readLen) { if (readLen > MAX_FLASH_READ_DATA_SIZE) { @@ -500,10 +500,10 @@ class TcFlashRead : public ploc::SpTcBase { /** * @brief Class to help creation of flash delete command. */ -class TcFlashDelete : public ploc::SpTcBase { +class TcFlashDelete : public TcBase { public: TcFlashDelete(ploc::SpTcParams params, uint16_t sequenceCount) - : ploc::SpTcBase(params, apid::TC_FLASHDELETE, sequenceCount) {} + : TcBase(params, apid::TC_FLASHDELETE, sequenceCount) {} ReturnValue_t buildPacket(std::string filename) { size_t nameSize = filename.size();