more testing #807

Merged
muellerr merged 4 commits from cfdp-source-handler-testing into cfdp-source-handler 2023-10-18 15:38:46 +02:00
4 changed files with 16 additions and 10 deletions
Showing only changes of commit ace75919ca - Show all commits

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. // Maximum allowed burn time allowed by the software.
static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; 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 uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50;
static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; 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 CFDP_STORE_QUEUE_SIZE = 300;
static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250; 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_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 CFDP_REGULAR_DELAY_MS = 200;
static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100; 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. // The user must call advance until completion before starting a new packet transfer.
if (writeActiveStatus) { if (writeActiveStatus) {
sif::debug << "is busy with writing" << std::endl;
return IS_BUSY; return IS_BUSY;
} }
if (size > packetBuf.capacity()) { if (size > packetBuf.capacity()) {
@ -47,12 +48,9 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w
if (pollReadyForPacket()) { if (pollReadyForPacket()) {
startPacketTransfer(ByteWidthCfg::ONE); startPacketTransfer(ByteWidthCfg::ONE);
} else { } else {
sif::debug << "is busy can not even start" << std::endl;
return DirectTmSinkIF::IS_BUSY; return DirectTmSinkIF::IS_BUSY;
} }
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
abortPacketTransfer();
return returnvalue::FAILED;
}
return advanceWrite(writtenSize); return advanceWrite(writtenSize);
} }
@ -75,15 +73,16 @@ ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) {
if (not pollReadyForPacket()) { if (not pollReadyForPacket()) {
return IS_BUSY; return IS_BUSY;
} }
for (size_t idx = currentPacketIndex; idx < currentPacketSize; idx++) { while (currentPacketIndex < currentPacketSize) {
if (not pollReadyForOctet(MAX_BUSY_POLLS)) { if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
if (not pollReadyForPacket()) { if (not pollReadyForPacket()) {
return PARTIALLY_WRITTEN; return PARTIALLY_WRITTEN;
} }
sif::debug << "aborting unexpectedly" << std::endl;
abortPacketTransfer(); abortPacketTransfer();
return returnvalue::FAILED; return returnvalue::FAILED;
} }
*(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(packetBuf[currentPacketIndex]); *(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(packetBuf[currentPacketIndex++]);
writtenSize++; writtenSize++;
} }
if (not pollReadyForOctet(MAX_BUSY_POLLS)) { if (not pollReadyForOctet(MAX_BUSY_POLLS)) {

View File

@ -173,12 +173,16 @@ ReturnValue_t LiveTmTask::handleGenericTmQueue(MessageQueueIF& queue, bool isCfd
size_t writtenSize = 0; size_t writtenSize = 0;
result = channel.write(data, size, writtenSize); result = channel.write(data, size, writtenSize);
if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) { if (result == DirectTmSinkIF::PARTIALLY_WRITTEN) {
sif::debug << "only partial write" << std::endl;
result = channel.handleWriteCompletionSynchronously(writtenSize, 200); result = channel.handleWriteCompletionSynchronously(writtenSize, 200);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
// TODO: Event? Might lead to dangerous spam though.. // TODO: Event? Might lead to dangerous spam though..
sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x" sif::warning << "LiveTmTask: Synchronous write of last segment failed with code 0x"
<< std::setw(4) << std::hex << result << std::dec << std::endl; << 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 // 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); ReturnValue_t result = advanceWrite(writtenSize);
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
sif::debug << "transfer complete" << std::endl;
// Transfer complete // Transfer complete
return result; return result;
} else if (result != PARTIALLY_WRITTEN) { } else if (result != PARTIALLY_WRITTEN) {
sif::debug << "transfer completion error" << std::endl;
// Some error where we can not or should not continue the transfer. // Some error where we can not or should not continue the transfer.
return result; return result;
} }
} }
sif::debug << "wtf" << std::endl;
return returnvalue::FAILED; return returnvalue::FAILED;
} }