that should cause a transaction start
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
b6b342bf99
commit
fa43c5480b
@ -17,6 +17,7 @@ CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpH
|
|||||||
pduQueue(fsfwHandlerParams.tmtcQueue),
|
pduQueue(fsfwHandlerParams.tmtcQueue),
|
||||||
cfdpRequestQueue(fsfwHandlerParams.cfdpQueue),
|
cfdpRequestQueue(fsfwHandlerParams.cfdpQueue),
|
||||||
localCfg(cfdpCfg.id, cfdpCfg.indicCfg, cfdpCfg.faultHandler),
|
localCfg(cfdpCfg.id, cfdpCfg.indicCfg, cfdpCfg.faultHandler),
|
||||||
|
remoteCfgProvider(cfdpCfg.remoteCfgProvider),
|
||||||
fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.tmtcQueue, this,
|
fsfwParams(fsfwHandlerParams.packetDest, &fsfwHandlerParams.tmtcQueue, this,
|
||||||
fsfwHandlerParams.tcStore, fsfwHandlerParams.tmStore),
|
fsfwHandlerParams.tcStore, fsfwHandlerParams.tmStore),
|
||||||
destHandler(DestHandlerParams(localCfg, cfdpCfg.userHandler, cfdpCfg.remoteCfgProvider,
|
destHandler(DestHandlerParams(localCfg, cfdpCfg.userHandler, cfdpCfg.remoteCfgProvider,
|
||||||
@ -145,7 +146,6 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) {
|
|||||||
// TODO: Handle CFDP requests here, most importantly put requests. If a put request is received,
|
// TODO: Handle CFDP requests here, most importantly put requests. If a put request is received,
|
||||||
// check whether one is pending. If none are, start a transaction with the put request,
|
// check whether one is pending. If none are, start a transaction with the put request,
|
||||||
// otherwise store for put request inside a FIFO for later processing.
|
// otherwise store for put request inside a FIFO for later processing.
|
||||||
auto accessorPair = ipcStore.getData(CfdpMessage::getStoreId(&msg));
|
|
||||||
if (msg.getCommand() == CfdpMessage::PUT_REQUEST) {
|
if (msg.getCommand() == CfdpMessage::PUT_REQUEST) {
|
||||||
sif::info << "Received CFDP put request" << std::endl;
|
sif::info << "Received CFDP put request" << std::endl;
|
||||||
if (srcHandler.getState() != CfdpState::IDLE) {
|
if (srcHandler.getState() != CfdpState::IDLE) {
|
||||||
@ -156,7 +156,22 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) {
|
|||||||
putRequestQueue.push(CfdpMessage::getStoreId(&msg));
|
putRequestQueue.push(CfdpMessage::getStoreId(&msg));
|
||||||
} else {
|
} else {
|
||||||
// TODO: Retrieve put request and remote configuration.
|
// TODO: Retrieve put request and remote configuration.
|
||||||
// srcHandler.transactionStart()
|
PutRequest putRequest;
|
||||||
|
auto accessorPair = ipcStore.getData(CfdpMessage::getStoreId(&msg));
|
||||||
|
const uint8_t* dataPtr = accessorPair.second.data();
|
||||||
|
size_t dataSize = accessorPair.second.size();
|
||||||
|
ReturnValue_t result =
|
||||||
|
putRequest.deSerialize(&dataPtr, &dataSize, SerializeIF::Endianness::MACHINE);
|
||||||
|
if (result != OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
RemoteEntityCfg* remoteCfg;
|
||||||
|
remoteCfgProvider.getRemoteCfg(putRequest.getDestId(), &remoteCfg);
|
||||||
|
if (remoteCfg == nullptr) {
|
||||||
|
// TODO: Trigger event
|
||||||
|
return FAILED;
|
||||||
|
}
|
||||||
|
return srcHandler.transactionStart(putRequest, *remoteCfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -74,6 +74,7 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep
|
|||||||
MessageQueueIF& pduQueue;
|
MessageQueueIF& pduQueue;
|
||||||
MessageQueueIF& cfdpRequestQueue;
|
MessageQueueIF& cfdpRequestQueue;
|
||||||
cfdp::LocalEntityCfg localCfg;
|
cfdp::LocalEntityCfg localCfg;
|
||||||
|
cfdp::RemoteConfigTableIF& remoteCfgProvider;
|
||||||
cfdp::FsfwParams fsfwParams;
|
cfdp::FsfwParams fsfwParams;
|
||||||
SeqCountProviderU16 seqCntProvider;
|
SeqCountProviderU16 seqCntProvider;
|
||||||
cfdp::DestHandler destHandler;
|
cfdp::DestHandler destHandler;
|
||||||
|
Loading…
Reference in New Issue
Block a user