source handler
This commit is contained in:
parent
1b79713430
commit
35712070cf
@ -9,7 +9,9 @@
|
||||
using namespace returnvalue;
|
||||
|
||||
cfdp::SourceHandler::SourceHandler(SourceHandlerParams params, FsfwSourceParams fsfwParams)
|
||||
: transactionParams(params.maxFilePathSize), sourceParams(std::move(params)) {}
|
||||
: transactionParams(params.maxFilePathSize),
|
||||
sourceParams(std::move(params)),
|
||||
fsfwParams(fsfwParams) {}
|
||||
|
||||
void cfdp::SourceHandler::fsmNacked() {
|
||||
if (step == TransactionStep::IDLE) {
|
||||
@ -79,3 +81,5 @@ ReturnValue_t cfdp::SourceHandler::checksumGeneration() {
|
||||
transactionParams.crc = crcCalc.value();
|
||||
return OK;
|
||||
}
|
||||
|
||||
ReturnValue_t cfdp::SourceHandler::putRequest() { return 0; }
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "fsfw/cfdp/handler/mib.h"
|
||||
#include "fsfw/events/EventReportingProxyIF.h"
|
||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
|
||||
|
||||
namespace cfdp {
|
||||
|
||||
@ -21,18 +22,37 @@ struct SourceHandlerParams {
|
||||
size_t maxFilePathSize = 256;
|
||||
};
|
||||
|
||||
// TODO: This class in identical to the ones used by the destination handler. Consider unifying
|
||||
// them.
|
||||
struct FsfwSourceParams {
|
||||
FsfwSourceParams(EventReportingProxyIF* eventReporter, StorageManagerIF& tcStore)
|
||||
: tcStore(&tcStore){};
|
||||
FsfwSourceParams(AcceptsTelemetryIF& packetDest, MessageQueueIF* msgQueue,
|
||||
EventReportingProxyIF* eventReporter, StorageManagerIF& tcStore,
|
||||
StorageManagerIF& tmStore)
|
||||
: FsfwSourceParams(packetDest, msgQueue, eventReporter) {
|
||||
this->tcStore = &tcStore;
|
||||
this->tmStore = &tmStore;
|
||||
}
|
||||
|
||||
FsfwSourceParams(AcceptsTelemetryIF& packetDest, MessageQueueIF* msgQueue,
|
||||
EventReportingProxyIF* eventReporter)
|
||||
: packetDest(packetDest), msgQueue(msgQueue), eventReporter(eventReporter) {}
|
||||
AcceptsTelemetryIF& packetDest;
|
||||
MessageQueueIF* msgQueue;
|
||||
EventReportingProxyIF* eventReporter = nullptr;
|
||||
StorageManagerIF* tcStore = nullptr;
|
||||
StorageManagerIF* tmStore = nullptr;
|
||||
};
|
||||
|
||||
class SourceHandler {
|
||||
public:
|
||||
SourceHandler(SourceHandlerParams params, FsfwSourceParams fsfwParams);
|
||||
|
||||
/**
|
||||
* Pass a put request to the source handler, which might initiate a CFDP transaction and start
|
||||
* the state machine
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t putRequest();
|
||||
void stateMachine();
|
||||
|
||||
private:
|
||||
@ -60,6 +80,7 @@ class SourceHandler {
|
||||
cfdp::CfdpState state = cfdp::CfdpState::IDLE;
|
||||
TransactionStep step = TransactionStep::IDLE;
|
||||
SourceHandlerParams sourceParams;
|
||||
FsfwSourceParams fsfwParams;
|
||||
|
||||
void fsmNacked();
|
||||
ReturnValue_t checksumGeneration();
|
||||
|
Loading…
Reference in New Issue
Block a user