2023-08-16 11:38:00 +02:00
|
|
|
#include "CfdpUser.h"
|
|
|
|
|
|
|
|
#include <fsfw/ipc/QueueFactory.h>
|
|
|
|
|
2023-08-16 13:16:14 +02:00
|
|
|
using namespace returnvalue;
|
|
|
|
|
2023-08-16 11:38:00 +02:00
|
|
|
namespace cfdp {
|
|
|
|
|
2023-08-16 13:16:14 +02:00
|
|
|
EiveUserHandler::EiveUserHandler(HasFileSystemIF& vfs, StorageManagerIF& ipcStore,
|
|
|
|
MessageQueueId_t cfdpRequestId)
|
|
|
|
: cfdp::UserBase(vfs), userQueue(QueueFactory::instance()->createMessageQueue(10)) {
|
|
|
|
if (userQueue == nullptr) {
|
|
|
|
sif::error << "EiveUserHandler: Queue creation failed" << std::endl;
|
|
|
|
return;
|
|
|
|
}
|
2023-08-16 11:38:00 +02:00
|
|
|
userQueue->setDefaultDestination(cfdpRequestId);
|
2023-08-16 13:16:14 +02:00
|
|
|
reservedMsgParser = new ReservedMessageParser(ipcStore, *userQueue, cfdpRequestId);
|
2023-08-16 11:38:00 +02:00
|
|
|
}
|
|
|
|
|
2023-08-16 13:16:14 +02:00
|
|
|
EiveUserHandler::~EiveUserHandler() { QueueFactory::instance()->deleteMessageQueue(userQueue); }
|
2023-08-16 11:38:00 +02:00
|
|
|
|
|
|
|
void EiveUserHandler::transactionIndication(const cfdp::TransactionId& id) {}
|
|
|
|
void EiveUserHandler::eofSentIndication(const cfdp::TransactionId& id) {}
|
2023-08-16 13:16:14 +02:00
|
|
|
void EiveUserHandler::transactionFinishedIndication(const cfdp::TransactionFinishedParams& params) {
|
2023-08-16 11:38:00 +02:00
|
|
|
sif::info << "File transaction finished for transaction with " << params.id << std::endl;
|
|
|
|
}
|
|
|
|
void EiveUserHandler::metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) {
|
|
|
|
sif::info << "Metadata received for transaction with " << params.id << std::endl;
|
2023-08-16 13:16:14 +02:00
|
|
|
if (params.numberOfMsgsToUser > 0 and params.msgsToUserArray != nullptr) {
|
|
|
|
ReturnValue_t result =
|
|
|
|
reservedMsgParser->parse(params.msgsToUserArray, params.numberOfMsgsToUser);
|
|
|
|
if (result != OK) {
|
|
|
|
sif::warning << "EiveUserHandler: Parsing reserved CFDP messages failed" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
2023-08-16 11:38:00 +02:00
|
|
|
}
|
2023-08-16 13:16:14 +02:00
|
|
|
void EiveUserHandler::fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) {}
|
2023-08-16 11:38:00 +02:00
|
|
|
void EiveUserHandler::reportIndication(const cfdp::TransactionId& id,
|
|
|
|
cfdp::StatusReportIF& report) {}
|
2023-08-16 13:16:14 +02:00
|
|
|
void EiveUserHandler::suspendedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code) {
|
|
|
|
}
|
2023-08-16 11:38:00 +02:00
|
|
|
void EiveUserHandler::resumedIndication(const cfdp::TransactionId& id, size_t progress) {}
|
|
|
|
void EiveUserHandler::faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
|
|
|
|
size_t progress) {}
|
|
|
|
void EiveUserHandler::abandonedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
|
|
|
|
size_t progress) {}
|
|
|
|
void EiveUserHandler::eofRecvIndication(const cfdp::TransactionId& id) {
|
|
|
|
sif::info << "EOF PDU received for transaction with " << id << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace cfdp
|