this should make proxy op forwarding work
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-08-16 13:16:14 +02:00
parent c47995a0eb
commit f62a4ee2b4
Signed by: muellerr
GPG Key ID: FCE0B2BD2195142F
4 changed files with 28 additions and 16 deletions

2
fsfw

@ -1 +1 @@
Subproject commit 8c1168524049ef0e5b2144b6c04aeb01538053c2 Subproject commit 9ef63825f3d8486b05c3f6193ae0503833e6f8a4

View File

@ -2,34 +2,43 @@
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>
using namespace returnvalue;
namespace cfdp { namespace cfdp {
EiveUserHandler::EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId) EiveUserHandler::EiveUserHandler(HasFileSystemIF& vfs, StorageManagerIF& ipcStore,
: cfdp::UserBase(vfs) { MessageQueueId_t cfdpRequestId)
userQueue = QueueFactory::instance()->createMessageQueue(10); : cfdp::UserBase(vfs), userQueue(QueueFactory::instance()->createMessageQueue(10)) {
if (userQueue == nullptr) {
sif::error << "EiveUserHandler: Queue creation failed" << std::endl;
return;
}
userQueue->setDefaultDestination(cfdpRequestId); userQueue->setDefaultDestination(cfdpRequestId);
reservedMsgParser = new ReservedMessageParser(ipcStore, *userQueue, cfdpRequestId);
} }
EiveUserHandler::~EiveUserHandler() { EiveUserHandler::~EiveUserHandler() { QueueFactory::instance()->deleteMessageQueue(userQueue); }
QueueFactory::instance()->deleteMessageQueue(userQueue);
}
void EiveUserHandler::transactionIndication(const cfdp::TransactionId& id) {} void EiveUserHandler::transactionIndication(const cfdp::TransactionId& id) {}
void EiveUserHandler::eofSentIndication(const cfdp::TransactionId& id) {} void EiveUserHandler::eofSentIndication(const cfdp::TransactionId& id) {}
void EiveUserHandler::transactionFinishedIndication( void EiveUserHandler::transactionFinishedIndication(const cfdp::TransactionFinishedParams& params) {
const cfdp::TransactionFinishedParams& params) {
sif::info << "File transaction finished for transaction with " << params.id << std::endl; sif::info << "File transaction finished for transaction with " << params.id << std::endl;
} }
void EiveUserHandler::metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) { void EiveUserHandler::metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) {
// TODO: Parse user messages and convert them into put requests where applicable.
sif::info << "Metadata received for transaction with " << params.id << std::endl; sif::info << "Metadata received for transaction with " << params.id << std::endl;
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;
}
}
} }
void EiveUserHandler::fileSegmentRecvdIndication( void EiveUserHandler::fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) {}
const cfdp::FileSegmentRecvdParams& params) {}
void EiveUserHandler::reportIndication(const cfdp::TransactionId& id, void EiveUserHandler::reportIndication(const cfdp::TransactionId& id,
cfdp::StatusReportIF& report) {} cfdp::StatusReportIF& report) {}
void EiveUserHandler::suspendedIndication(const cfdp::TransactionId& id, void EiveUserHandler::suspendedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code) {
cfdp::ConditionCode code) {} }
void EiveUserHandler::resumedIndication(const cfdp::TransactionId& id, size_t progress) {} void EiveUserHandler::resumedIndication(const cfdp::TransactionId& id, size_t progress) {}
void EiveUserHandler::faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, void EiveUserHandler::faultIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code,
size_t progress) {} size_t progress) {}

View File

@ -1,13 +1,15 @@
#ifndef MISSION_CFDP_CFDPUSER_H_ #ifndef MISSION_CFDP_CFDPUSER_H_
#define MISSION_CFDP_CFDPUSER_H_ #define MISSION_CFDP_CFDPUSER_H_
#include <fsfw/cfdp/handler/ReservedMessageParser.h>
#include <fsfw/cfdp/handler/UserBase.h> #include <fsfw/cfdp/handler/UserBase.h>
namespace cfdp { namespace cfdp {
class EiveUserHandler : public cfdp::UserBase { class EiveUserHandler : public cfdp::UserBase {
public: public:
explicit EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId); explicit EiveUserHandler(HasFileSystemIF& vfs, StorageManagerIF& ipcStore,
MessageQueueId_t cfdpRequestId);
virtual ~EiveUserHandler(); virtual ~EiveUserHandler();
@ -27,6 +29,7 @@ class EiveUserHandler : public cfdp::UserBase {
private: private:
MessageQueueIF* userQueue; MessageQueueIF* userQueue;
ReservedMessageParser* reservedMsgParser;
}; };
} // namespace cfdp } // namespace cfdp

View File

@ -277,7 +277,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
auto* tmtcQueue = QueueFactory::instance()->createMessageQueue(32); auto* tmtcQueue = QueueFactory::instance()->createMessageQueue(32);
auto* cfdpQueue = QueueFactory::instance()->createMessageQueue(16); auto* cfdpQueue = QueueFactory::instance()->createMessageQueue(16);
auto eiveUserHandler = new cfdp::EiveUserHandler(HOST_FS, cfdpQueue->getId()); auto eiveUserHandler = new cfdp::EiveUserHandler(HOST_FS, **ipcStore, cfdpQueue->getId());
FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **cfdpFunnel, *tcStore, **tmStore, FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **cfdpFunnel, *tcStore, **tmStore,
*tmtcQueue, *cfdpQueue); *tmtcQueue, *cfdpQueue);
cfdp::IndicationCfg indicationCfg; cfdp::IndicationCfg indicationCfg;