more testing
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-cfdp-source-handler This commit looks good

This commit is contained in:
Robin Müller 2023-10-18 12:24:22 +02:00
parent e194071936
commit ace75919ca
Signed by: muellerr
GPG Key ID: A649FB78196E3849
4 changed files with 16 additions and 10 deletions

View File

@ -50,7 +50,7 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5;
// Maximum allowed burn time allowed by the software.
static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180;
static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 990;
static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 300;
static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50;
static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4;
@ -63,11 +63,11 @@ static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300;
static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300;
static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250;
static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 400;
static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 450;
static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 60;
static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 50;
static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300;
static constexpr uint32_t CFDP_SHORT_DELAY_MS = 50;
static constexpr uint32_t CFDP_SHORT_DELAY_MS = 40;
static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200;
static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100;

View File

@ -34,6 +34,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w
}
// The user must call advance until completion before starting a new packet transfer.
if (writeActiveStatus) {
sif::debug << "is busy with writing" << std::endl;
return IS_BUSY;
}
if (size > packetBuf.capacity()) {
@ -47,12 +48,9 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w
if (pollReadyForPacket()) {
startPacketTransfer(ByteWidthCfg::ONE);
} else {
sif::debug << "is busy can not even start" << std::endl;
return DirectTmSinkIF::IS_BUSY;
}
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
abortPacketTransfer();
return returnvalue::FAILED;
}
return advanceWrite(writtenSize);
}
@ -75,15 +73,16 @@ ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) {
if (not pollReadyForPacket()) {
return IS_BUSY;
}
for (size_t idx = currentPacketIndex; idx < currentPacketSize; idx++) {
while (currentPacketIndex < currentPacketSize) {
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
if (not pollReadyForPacket()) {
return PARTIALLY_WRITTEN;
}
sif::debug << "aborting unexpectedly" << std::endl;
abortPacketTransfer();
return returnvalue::FAILED;
}
*(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(packetBuf[currentPacketIndex]);
*(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(packetBuf[currentPacketIndex++]);
writtenSize++;
}
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {

View File

@ -173,12 +173,16 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd
size_t writtenSize = 0;
result = channel.write(data, size, writtenSize);
if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) {
sif::debug << "only partial write" << std::endl;
result = channel.handleWriteCompletionSynchronously(writtenSize, 200);
if (result != returnvalue::OK) {
// TODO: Event? Might lead to dangerous spam though..
sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x"
<< std::setw(4) << std::hex << result << std::dec << std::endl;
}
} else if(result != returnvalue::OK) {
sif::error << "LiveTmTask: Channel write failed with code 0x" << std::hex << std::setw(4) <<
result << std::dec << std::endl;
}
}
// Try delete in any case, ignore failures (which should not happen), it is more important to

View File

@ -67,12 +67,15 @@ ReturnValue_t VirtualChannel::handleWriteCompletionSynchronously(size_t& written
}
ReturnValue_t result = advanceWrite(writtenSize);
if (result == returnvalue::OK) {
sif::debug << "transfer complete" << std::endl;
// Transfer complete
return result;
} else if (result != PARTIALLY_WRITTEN) {
sif::debug << "transfer completion error" << std::endl;
// Some error where we can not or should not continue the transfer.
return result;
}
}
sif::debug << "wtf" << std::endl;
return returnvalue::FAILED;
}