countdown based timeout

This commit is contained in:
Jakob Meier
2022-04-27 16:08:17 +02:00
parent 42194abb4a
commit 8610e48b19
8 changed files with 48 additions and 12 deletions

View File

@ -268,7 +268,7 @@ static const uint32_t ADC_REPORT_SET_ID = REQUEST_ADC_REPORT;
namespace recv_timeout {
// Erase memory can require up to 60 seconds for execution
static const uint32_t ERASE_MEMORY = 60000;
static const uint32_t UPDATE_STATUS_REPORT = 60000;
static const uint32_t UPDATE_STATUS_REPORT = 70000;
} // namespace recv_timeout
/**
@ -1163,7 +1163,7 @@ class WriteMemory : public SupvTcSpacePacket {
SerializeIF::Endianness::BIG);
std::memcpy(dataFieldPtr, updateData, length);
if (length % 2 != 0) {
this->setPacketDataLength(this->getFullSize() + 1);
this->setPacketDataLength(length + sizeof(CCSDSPrimaryHeader) + CRC_SIZE - 1);
// The data field must be two bytes aligned. Thus, in case the number of bytes to write is odd
// a value of zero is added here
*(dataFieldPtr + length + 1) = 0;