45 lines
993 B
C++
45 lines
993 B
C++
#ifndef FSFW_CFDP_CFDPSOURCEHANDLER_H
|
|
#define FSFW_CFDP_CFDPSOURCEHANDLER_H
|
|
|
|
#include <cstdint>
|
|
|
|
#include "defs.h"
|
|
#include "fsfw/events/EventReportingProxyIF.h"
|
|
#include "fsfw/storagemanager/StorageManagerIF.h"
|
|
|
|
struct SourceHandlerParams {};
|
|
|
|
struct FsfwSourceParams {
|
|
FsfwSourceParams(EventReportingProxyIF* eventReporter, StorageManagerIF& tcStore)
|
|
: tcStore(&tcStore){};
|
|
|
|
EventReportingProxyIF* eventReporter = nullptr;
|
|
StorageManagerIF* tcStore = nullptr;
|
|
};
|
|
|
|
class SourceHandler {
|
|
public:
|
|
SourceHandler(SourceHandlerParams params, FsfwSourceParams fsfwParams);
|
|
|
|
void stateMachine();
|
|
|
|
private:
|
|
enum class TransactionStep : uint8_t {
|
|
IDLE = 0,
|
|
TRANSACTION_START = 1,
|
|
CRC_PROCEDURE = 2,
|
|
SENDING_METADATA = 3,
|
|
SENDING_FILE_DATA = 4,
|
|
SENDING_EOF = 5,
|
|
WAIT_FOR_ACK = 6,
|
|
WAIT_FOR_FINISH = 7,
|
|
NOTICE_OF_COMPLETION = 8
|
|
};
|
|
cfdp::CfdpState state;
|
|
TransactionStep step;
|
|
|
|
void fsmNacked();
|
|
};
|
|
|
|
#endif // FSFW_CFDP_CFDPSOURCEHANDLER_H
|