hmm this is tricky from an architecture standpoint
This commit is contained in:
parent
91711bd928
commit
75e0ef60ce
@ -11,8 +11,8 @@ using namespace cfdp;
|
|||||||
CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg)
|
CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg)
|
||||||
: SystemObject(fsfwParams.objectId),
|
: SystemObject(fsfwParams.objectId),
|
||||||
UserBase(fsfwParams.vfs),
|
UserBase(fsfwParams.vfs),
|
||||||
destHandler(DestHandlerParams(cfdpCfg.cfg, *this, *this, cfdpCfg.packetInfoList,
|
destHandler(DestHandlerParams(cfdpCfg.cfg, *this, cfdpCfg.remoteCfgProvider,
|
||||||
cfdpCfg.lostSegmentsList),
|
cfdpCfg.packetInfoList, cfdpCfg.lostSegmentsList),
|
||||||
FsfwParams(fsfwParams.packetDest, nullptr, this, fsfwParams.tcStore,
|
FsfwParams(fsfwParams.packetDest, nullptr, this, fsfwParams.tcStore,
|
||||||
fsfwParams.tmStore)) {
|
fsfwParams.tmStore)) {
|
||||||
// TODO: Make queue params configurable, or better yet, expect it to be passed externally
|
// TODO: Make queue params configurable, or better yet, expect it to be passed externally
|
||||||
@ -75,10 +75,6 @@ void CfdpHandler::abandonedIndication(const cfdp::TransactionId& id, cfdp::Condi
|
|||||||
size_t progress) {}
|
size_t progress) {}
|
||||||
void CfdpHandler::eofRecvIndication(const cfdp::TransactionId& id) {}
|
void CfdpHandler::eofRecvIndication(const cfdp::TransactionId& id) {}
|
||||||
|
|
||||||
bool CfdpHandler::getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
|
ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
|
||||||
auto accessorPair = tcStore->getData(msg.getStorageId());
|
auto accessorPair = tcStore->getData(msg.getStorageId());
|
||||||
PduHeaderReader reader(accessorPair.second.data(), accessorPair.second.size());
|
PduHeaderReader reader(accessorPair.second.data(), accessorPair.second.size());
|
||||||
@ -134,7 +130,7 @@ ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) {
|
|||||||
// the source handler, for a Finished PDU, it is passed to the destination handler.
|
// the source handler, for a Finished PDU, it is passed to the destination handler.
|
||||||
FileDirectives ackedDirective;
|
FileDirectives ackedDirective;
|
||||||
if (not AckPduReader::checkAckedDirectiveField(pduDataField[1], ackedDirective)) {
|
if (not AckPduReader::checkAckedDirectiveField(pduDataField[1], ackedDirective)) {
|
||||||
// TODO: appropriate error
|
return INVALID_ACK_DIRECTIVE_FIELDS;
|
||||||
}
|
}
|
||||||
if (ackedDirective == FileDirectives::EOF_DIRECTIVE) {
|
if (ackedDirective == FileDirectives::EOF_DIRECTIVE) {
|
||||||
passToSourceHandler();
|
passToSourceHandler();
|
||||||
|
@ -22,17 +22,21 @@ struct FsfwHandlerParams {
|
|||||||
|
|
||||||
struct CfdpHandlerCfg {
|
struct CfdpHandlerCfg {
|
||||||
CfdpHandlerCfg(cfdp::LocalEntityCfg cfg, cfdp::PacketInfoListBase& packetInfo,
|
CfdpHandlerCfg(cfdp::LocalEntityCfg cfg, cfdp::PacketInfoListBase& packetInfo,
|
||||||
cfdp::LostSegmentsListBase& lostSegmentsList)
|
cfdp::LostSegmentsListBase& lostSegmentsList,
|
||||||
: cfg(std::move(cfg)), packetInfoList(packetInfo), lostSegmentsList(lostSegmentsList) {}
|
cfdp::RemoteConfigTableIF& remoteCfgProvider)
|
||||||
|
: cfg(std::move(cfg)),
|
||||||
|
packetInfoList(packetInfo),
|
||||||
|
lostSegmentsList(lostSegmentsList),
|
||||||
|
remoteCfgProvider(remoteCfgProvider) {}
|
||||||
|
|
||||||
cfdp::LocalEntityCfg cfg;
|
cfdp::LocalEntityCfg cfg;
|
||||||
cfdp::PacketInfoListBase& packetInfoList;
|
cfdp::PacketInfoListBase& packetInfoList;
|
||||||
cfdp::LostSegmentsListBase& lostSegmentsList;
|
cfdp::LostSegmentsListBase& lostSegmentsList;
|
||||||
|
cfdp::RemoteConfigTableIF& remoteCfgProvider;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CfdpHandler : public SystemObject,
|
class CfdpHandler : public SystemObject,
|
||||||
public cfdp::UserBase,
|
public cfdp::UserBase,
|
||||||
public cfdp::RemoteConfigTableIF,
|
|
||||||
public ExecutableObjectIF,
|
public ExecutableObjectIF,
|
||||||
public AcceptsTelecommandsIF {
|
public AcceptsTelecommandsIF {
|
||||||
public:
|
public:
|
||||||
@ -45,9 +49,6 @@ class CfdpHandler : public SystemObject,
|
|||||||
ReturnValue_t initialize() override;
|
ReturnValue_t initialize() override;
|
||||||
ReturnValue_t performOperation(uint8_t operationCode) override;
|
ReturnValue_t performOperation(uint8_t operationCode) override;
|
||||||
|
|
||||||
// CFDP remote table interface
|
|
||||||
bool getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) override;
|
|
||||||
|
|
||||||
// CFDP user overrides
|
// CFDP user overrides
|
||||||
void transactionIndication(const cfdp::TransactionId& id) override;
|
void transactionIndication(const cfdp::TransactionId& id) override;
|
||||||
void eofSentIndication(const cfdp::TransactionId& id) override;
|
void eofSentIndication(const cfdp::TransactionId& id) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user