CFDP SOURCE handler #157

Merged
muellerr merged 107 commits from cfdp-source-handler into develop 2023-10-19 10:59:55 +02:00
2 changed files with 5 additions and 10 deletions
Showing only changes of commit 6021257a87 - Show all commits

View File

@ -50,19 +50,16 @@ cfdp::SourceHandler::FsmResult& cfdp::SourceHandler::fsmNacked() {
}
if (step == TransactionStep::TRANSACTION_START) {
sourceParams.user.transactionIndication(transactionParams.id);
step = TransactionStep::CRC_PROCEDURE;
}
if (step == TransactionStep::CRC_PROCEDURE) {
result = checksumGeneration();
if (result != OK) {
// TODO: Some error handling
addError(result);
}
step = TransactionStep::SENDING_METADATA;
}

boop

boop
if (step == TransactionStep::SENDING_METADATA) {
result = prepareAndSendMetadataPdu();
if (result != OK) {
// TODO: Error handling
addError(result);
}
fsmResult.callStatus = CallStatus::CALL_AGAIN;
return fsmResult;

boop

boop
@ -72,13 +69,13 @@ cfdp::SourceHandler::FsmResult& cfdp::SourceHandler::fsmNacked() {
result = prepareAndSendNextFileDataPdu(noFdPdu);
if (result == OK and !noFdPdu) {
fsmResult.callStatus = CallStatus::CALL_AGAIN;
return fsmResult;
}
return fsmResult;
}
if (step == TransactionStep::SENDING_EOF) {
result = prepareAndSendEofPdu();
if (result != OK) {
// TODO: Error handling
addError(result);
}
if (sourceParams.cfg.indicCfg.eofSentIndicRequired) {
sourceParams.user.eofSentIndication(transactionParams.id);

boop

boop
@ -139,8 +136,7 @@ ReturnValue_t cfdp::SourceHandler::checksumGeneration() {
params.size = readLen;
auto result = sourceParams.user.vfs.readFromFile(params, buf.data(), buf.size());
if (result != OK) {
// TODO: I think this is a case for a filestore rejection, but it might sense to print
// a warning or trigger an event because this should generally not happen
addError(result);
return FAILED;
}
crcCalc.add(buf.begin(), buf.begin() + readLen);
Review

boop

boop
Review

Will be added when fault declaration works properly

Will be added when fault declaration works properly

View File

@ -30,7 +30,6 @@ class SourceHandler {
enum class TransactionStep : uint8_t {
IDLE = 0,
TRANSACTION_START = 1,
CRC_PROCEDURE = 2,
SENDING_METADATA = 3,
SENDING_FILE_DATA = 4,
SENDING_EOF = 5,