CFDP source handler #776

Merged
muellerr merged 96 commits from cfdp-source-handler into main 2023-10-19 11:11:31 +02:00
2 changed files with 8 additions and 5 deletions
Showing only changes of commit c7b27c0092 - Show all commits

2
fsfw

@ -1 +1 @@
Subproject commit dfcfb035bed4469aad2dad034567309d0dda7d29
Subproject commit 470f589bde405c39f5a7fbf191b11b8b48058128

View File

@ -109,16 +109,19 @@ ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) {
auto passToDestHandler = [&]() {
accessorPair.second.release();
PacketInfo info(type, msg.getStorageId(), directive);
result = destHandler.passPacket(info);
return destHandler.passPacket(info);
};
auto passToSourceHandler = [&]() {
accessorPair.second.release();
PacketInfo info(type, msg.getStorageId(), directive);
// Implement this function.
// result = srcHandler.passPacket(info);
};
if (directive == FileDirective::METADATA or directive == FileDirective::EOF_DIRECTIVE or
directive == FileDirective::PROMPT) {
// Section b) of 4.5.3: These PDUs should always be targeted towards the file receiver a.k.a.
// the destination handler
passToDestHandler();
return passToDestHandler();
} else if (directive == FileDirective::FINISH or directive == FileDirective::NAK or
directive == FileDirective::KEEP_ALIVE) {
// Section c) of 4.5.3: These PDUs should always be targeted towards the file sender a.k.a.
@ -135,7 +138,7 @@ ReturnValue_t CfdpHandler::handlePduPacket(TmTcMessage& msg) {
if (ackedDirective == FileDirective::EOF_DIRECTIVE) {
passToSourceHandler();
} else if (ackedDirective == FileDirective::FINISH) {
passToDestHandler();
return passToDestHandler();
}
}
}