lot of debugging and trying out
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user