continue source handler integration
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
2023-08-14 20:48:37 +02:00
parent ede0805ee8
commit 360911e5eb
5 changed files with 39 additions and 19 deletions

View File

@ -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;
}