continue source handler integration
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
This commit is contained in:
parent
ede0805ee8
commit
360911e5eb
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit b39e1c7e076914d18fbb78716d3b5b9b12b8504b
|
||||
Subproject commit 60dcacf432aa0a7b739f8fdf8bf4aaa37ac614e5
|
@ -11,9 +11,10 @@ using namespace cfdp;
|
||||
|
||||
CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpHandlerCfg& cfdpCfg)
|
||||
: SystemObject(fsfwHandlerParams.objectId),
|
||||
msgQueue(fsfwHandlerParams.msgQueue),
|
||||
tmtcQueue(fsfwHandlerParams.tmtcQueue),
|
||||
cfdpRequestQueue(fsfwHandlerParams.cfdpQueue),
|
||||
localCfg(cfdpCfg.id, cfdpCfg.indicCfg, cfdpCfg.faultHandler),
|
||||
fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.msgQueue, this,
|
||||
fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.tmtcQueue, this,
|
||||
fsfwHandlerParams.tcStore, fsfwHandlerParams.tmStore),
|
||||
destHandler(DestHandlerParams(localCfg, cfdpCfg.userHandler, cfdpCfg.remoteCfgProvider,
|
||||
cfdpCfg.packetInfoList, cfdpCfg.lostSegmentsList),
|
||||
@ -27,7 +28,7 @@ CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpH
|
||||
return destHandler.getDestHandlerParams().cfg.localId.getValue();
|
||||
}
|
||||
|
||||
[[nodiscard]] MessageQueueId_t CfdpHandler::getRequestQueue() const { return msgQueue.getId(); }
|
||||
[[nodiscard]] MessageQueueId_t CfdpHandler::getRequestQueue() const { return tmtcQueue.getId(); }
|
||||
|
||||
ReturnValue_t CfdpHandler::initialize() {
|
||||
ReturnValue_t result = destHandler.initialize();
|
||||
@ -46,19 +47,23 @@ ReturnValue_t CfdpHandler::performOperation(uint8_t operationCode) {
|
||||
ReturnValue_t status;
|
||||
ReturnValue_t result = OK;
|
||||
TmTcMessage tmtcMsg;
|
||||
for (status = msgQueue.receiveMessage(&tmtcMsg); status == returnvalue::OK;
|
||||
status = msgQueue.receiveMessage(&tmtcMsg)) {
|
||||
for (status = tmtcQueue.receiveMessage(&tmtcMsg); status == returnvalue::OK;
|
||||
status = tmtcQueue.receiveMessage(&tmtcMsg)) {
|
||||
result = handleCfdpPacket(tmtcMsg);
|
||||
if (result != OK) {
|
||||
status = result;
|
||||
}
|
||||
}
|
||||
auto& fsmRes = destHandler.performStateMachine();
|
||||
const DestHandler::FsmResult& destResult = destHandler.stateMachine();
|
||||
// TODO: Error handling?
|
||||
while (fsmRes.callStatus == CallStatus::CALL_AGAIN) {
|
||||
destHandler.performStateMachine();
|
||||
while (destResult.callStatus == CallStatus::CALL_AGAIN) {
|
||||
destHandler.stateMachine();
|
||||
// TODO: Error handling?
|
||||
}
|
||||
const SourceHandler::FsmResult& srcResult = srcHandler.stateMachine();
|
||||
while (srcResult.callStatus == CallStatus::CALL_AGAIN) {
|
||||
srcHandler.stateMachine();
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -14,19 +14,22 @@
|
||||
|
||||
struct FsfwHandlerParams {
|
||||
FsfwHandlerParams(object_id_t objectId, HasFileSystemIF& vfs, AcceptsTelemetryIF& packetDest,
|
||||
StorageManagerIF& tcStore, StorageManagerIF& tmStore, MessageQueueIF& msgQueue)
|
||||
StorageManagerIF& tcStore, StorageManagerIF& tmStore, MessageQueueIF& tmtcQueue,
|
||||
MessageQueueIF& cfdpQueue)
|
||||
: objectId(objectId),
|
||||
vfs(vfs),
|
||||
packetDest(packetDest),
|
||||
tcStore(tcStore),
|
||||
tmStore(tmStore),
|
||||
msgQueue(msgQueue) {}
|
||||
tmtcQueue(tmtcQueue),
|
||||
cfdpQueue(cfdpQueue) {}
|
||||
object_id_t objectId{};
|
||||
HasFileSystemIF& vfs;
|
||||
AcceptsTelemetryIF& packetDest;
|
||||
StorageManagerIF& tcStore;
|
||||
StorageManagerIF& tmStore;
|
||||
MessageQueueIF& msgQueue;
|
||||
MessageQueueIF& tmtcQueue;
|
||||
MessageQueueIF& cfdpQueue;
|
||||
};
|
||||
|
||||
struct CfdpHandlerCfg {
|
||||
@ -63,7 +66,8 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep
|
||||
ReturnValue_t performOperation(uint8_t operationCode) override;
|
||||
|
||||
private:
|
||||
MessageQueueIF& msgQueue;
|
||||
MessageQueueIF& tmtcQueue;
|
||||
MessageQueueIF& cfdpRequestQueue;
|
||||
cfdp::LocalEntityCfg localCfg;
|
||||
cfdp::FsfwParams fsfwParams;
|
||||
SeqCountProviderU16 seqCntProvider;
|
||||
|
@ -7,8 +7,13 @@ namespace cfdp {
|
||||
|
||||
class EiveUserHandler : public cfdp::UserBase {
|
||||
public:
|
||||
explicit EiveUserHandler(HasFileSystemIF& vfs) : cfdp::UserBase(vfs) {}
|
||||
virtual ~EiveUserHandler() = default;
|
||||
explicit EiveUserHandler(HasFileSystemIF& vfs, MessageQueueId_t cfdpRequestId)
|
||||
: cfdp::UserBase(vfs) {
|
||||
userQueue = QueueFactory::instance()->createMessageQueue(10);
|
||||
userQueue->setDefaultDestination(cfdpRequestId);
|
||||
}
|
||||
|
||||
virtual ~EiveUserHandler() { QueueFactory::instance()->deleteMessageQueue(userQueue); }
|
||||
|
||||
void transactionIndication(const cfdp::TransactionId& id) override {}
|
||||
void eofSentIndication(const cfdp::TransactionId& id) override {}
|
||||
@ -16,6 +21,7 @@ class EiveUserHandler : public cfdp::UserBase {
|
||||
sif::info << "File transaction finished for transaction with " << params.id << std::endl;
|
||||
}
|
||||
void metadataRecvdIndication(const cfdp::MetadataRecvdParams& params) override {
|
||||
// TODO: Parse user messages and convert them into put requests where applicable.
|
||||
sif::info << "Metadata received for transaction with " << params.id << std::endl;
|
||||
}
|
||||
void fileSegmentRecvdIndication(const cfdp::FileSegmentRecvdParams& params) override {}
|
||||
@ -29,6 +35,9 @@ class EiveUserHandler : public cfdp::UserBase {
|
||||
void eofRecvIndication(const cfdp::TransactionId& id) override {
|
||||
sif::info << "EOF PDU received for transaction with " << id << std::endl;
|
||||
}
|
||||
|
||||
private:
|
||||
MessageQueueIF* userQueue;
|
||||
};
|
||||
|
||||
class EiveFaultHandler : public cfdp::FaultHandlerBase {
|
||||
|
@ -85,7 +85,7 @@ EntityId REMOTE_CFDP_ID(UnsignedByteField<uint16_t>(config::EIVE_GROUND_CFDP_ENT
|
||||
RemoteEntityCfg GROUND_REMOTE_CFG(REMOTE_CFDP_ID);
|
||||
OneRemoteConfigProvider REMOTE_CFG_PROVIDER(GROUND_REMOTE_CFG);
|
||||
HostFilesystem HOST_FS;
|
||||
EiveUserHandler USER_HANDLER(HOST_FS);
|
||||
// EiveUserHandler USER_HANDLER(HOST_FS);
|
||||
EiveFaultHandler EIVE_FAULT_HANDLER;
|
||||
|
||||
} // namespace cfdp
|
||||
@ -274,14 +274,16 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
|
||||
CfdpDistribCfg distribCfg(objects::CFDP_DISTRIBUTOR, *tcStore, cfdpMsgQueue);
|
||||
new CfdpDistributor(distribCfg);
|
||||
|
||||
auto* msgQueue = QueueFactory::instance()->createMessageQueue(32);
|
||||
auto* tmtcQueue = QueueFactory::instance()->createMessageQueue(32);
|
||||
auto* cfdpQueue = QueueFactory::instance()->createMessageQueue(16);
|
||||
auto eiveUserHandler = new EiveUserHandler(HOST_FS, cfdpQueue->getId());
|
||||
FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **cfdpFunnel, *tcStore, **tmStore,
|
||||
*msgQueue);
|
||||
*tmtcQueue, *cfdpQueue);
|
||||
cfdp::IndicationCfg indicationCfg;
|
||||
UnsignedByteField<uint16_t> apid(config::EIVE_LOCAL_CFDP_ENTITY_ID);
|
||||
cfdp::EntityId localId(apid);
|
||||
GROUND_REMOTE_CFG.defaultChecksum = cfdp::ChecksumType::CRC_32;
|
||||
CfdpHandlerCfg cfdpCfg(localId, indicationCfg, USER_HANDLER, EIVE_FAULT_HANDLER, PACKET_LIST,
|
||||
CfdpHandlerCfg cfdpCfg(localId, indicationCfg, *eiveUserHandler, EIVE_FAULT_HANDLER, PACKET_LIST,
|
||||
LOST_SEGMENTS, REMOTE_CFG_PROVIDER);
|
||||
auto* cfdpHandler = new CfdpHandler(params, cfdpCfg);
|
||||
// All CFDP packets arrive wrapped inside CCSDS space packets
|
||||
|
Loading…
x
Reference in New Issue
Block a user