v1.12.0 #269

Merged
muellerr merged 493 commits from develop into main 2022-07-04 11:19:05 +02:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit bb397a58de - Show all commits

View File

@ -11,6 +11,7 @@
#include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/CRC.h"
#include "fsfw/timemanager/Countdown.h" #include "fsfw/timemanager/Countdown.h"
#include "fsfw/tasks/TaskFactory.h"
#include "mission/utility/Filenaming.h" #include "mission/utility/Filenaming.h"
#include "mission/utility/ProgressPrinter.h" #include "mission/utility/ProgressPrinter.h"
#include "mission/utility/Timestamp.h" #include "mission/utility/Timestamp.h"
@ -158,6 +159,7 @@ ReturnValue_t PlocSupvHelper::performUpdate() {
uint16_t dataLength = 0; uint16_t dataLength = 0;
size_t bytesWritten = 0; size_t bytesWritten = 0;
uint16_t sequenceCount = 1; uint16_t sequenceCount = 1;
uint32_t packetNum = 1;
supv::SequenceFlags seqFlags = supv::SequenceFlags::FIRST_PKT; supv::SequenceFlags seqFlags = supv::SequenceFlags::FIRST_PKT;
while (remainingSize > 0) { while (remainingSize > 0) {
if (terminate) { if (terminate) {
@ -193,8 +195,10 @@ ReturnValue_t PlocSupvHelper::performUpdate() {
update.startAddress + bytesWritten, dataLength, tempData); update.startAddress + bytesWritten, dataLength, tempData);
result = handlePacketTransmission(packet); result = handlePacketTransmission(packet);
if (result != RETURN_OK) { if (result != RETURN_OK) {
triggerEvent(WRITE_MEMORY_FAILED, packetNum);
return result; return result;
} }
packetNum += 1;
bytesWritten += dataLength; bytesWritten += dataLength;
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1 #if OBSW_DEBUG_PLOC_SUPERVISOR == 1
progressPrinter.print(bytesWritten); progressPrinter.print(bytesWritten);
@ -373,6 +377,9 @@ ReturnValue_t PlocSupvHelper::receive(uint8_t* data, size_t* readBytes, size_t r
if (*readBytes > 0) { if (*readBytes > 0) {
std::memcpy(data, buffer, *readBytes); std::memcpy(data, buffer, *readBytes);
} }
else {
TaskFactory::delayTask(40);
}
return result; return result;
} }

View File

@ -78,6 +78,9 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
//! P1: Return value //! P1: Return value
//! P2: Apid of command for which the reception of the execution report failed //! P2: Apid of command for which the reception of the execution report failed
static const Event EXE_RECEPTION_FAILURE = MAKE_EVENT(16, severity::LOW); static const Event EXE_RECEPTION_FAILURE = MAKE_EVENT(16, severity::LOW);
//! [EXPORT] : [COMMENT] Update procedure failed when sending packet with number P1
//! P1: Packet number for which the memory write command fails
static const Event WRITE_MEMORY_FAILED = MAKE_EVENT(17, severity::LOW);
PlocSupvHelper(object_id_t objectId); PlocSupvHelper(object_id_t objectId);
virtual ~PlocSupvHelper(); virtual ~PlocSupvHelper();
@ -178,7 +181,7 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
ReturnValue_t performUpdate(); ReturnValue_t performUpdate();
ReturnValue_t performEventBufferRequest(); ReturnValue_t performEventBufferRequest();
ReturnValue_t handlePacketTransmission(SpacePacket& packet, ReturnValue_t handlePacketTransmission(SpacePacket& packet,
uint32_t timeoutExecutionReport = 1000); uint32_t timeoutExecutionReport = 2000);
ReturnValue_t sendCommand(SpacePacket& packet); ReturnValue_t sendCommand(SpacePacket& packet);
/** /**
* @brief Function which reads form the communication interface * @brief Function which reads form the communication interface