lot of debugging and trying out
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2023-10-13 11:42:13 +02:00
parent 9f600a24ff
commit 5bcd171108
4 changed files with 20 additions and 8 deletions

View File

@ -52,13 +52,16 @@ ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) {
}
}
}
} else {
consecutiveNoBlockWriteCounter = 0;
}
if (channel.isBusy() and !throttlePeriodOngoing) {
// Throttle CFDP packet creator. It is by far the most relevant data creator, so throttling
// it is the easiest way to handle back pressure for now in a sensible way.
throttleCfdp();
} else if(!channel.isBusy() and throttlePeriodOngoing) {
if(minimumPeriodThrottleCd.hasTimedOut()) {
if(minimumPeriodThrottleCd.hasTimedOut() and consecutiveNoBlockWriteCounter >= 10) {
sif::debug << "releasing cfdp" << std::endl;
releaseCfdp();
}
}
@ -162,10 +165,14 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) {
return result;
}
if(ptmeLocked) {
consecutiveNoBlockWriteCounter= 0;
}
if (!ptmeLocked) {
size_t partiallyWrittenSize = 0;
result = channel.write(data, size, partiallyWrittenSize);
if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) {
consecutiveNoBlockWriteCounter = 0;
// Already throttle CFDP.
throttleCfdp();
result = channel.handleLastWriteSynchronously(data, size, partiallyWrittenSize, 200);
@ -175,6 +182,9 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue) {
<< "LiveTmTask: Synchronous write of last segment failed with code 0x"
<< std::setw(4) << std::hex << result << std::dec << std::endl;
}
minimumPeriodThrottleCd.resetTimer();
} else {
consecutiveNoBlockWriteCounter++;
}
}
// Try delete in any case, ignore failures (which should not happen), it is more important to