first dest handler unittests

- Add new mock class for event reporting proxies
- Add basic setup for unittesting the CFDP destination handler
This commit is contained in:
2022-09-05 11:37:41 +02:00
parent 0dd2b5ddd4
commit d2c4d546c3
6 changed files with 56 additions and 12 deletions

View File

@ -416,3 +416,5 @@ ReturnValue_t cfdp::DestHandler::sendFinishedPdu() {
}
return OK;
}
cfdp::DestHandler::TransactionStep cfdp::DestHandler::getTransactionStep() const { return step; }

View File

@ -72,6 +72,14 @@ struct FsfwParams {
class DestHandler {
public:
enum class TransactionStep {
IDLE = 0,
TRANSACTION_START = 1,
RECEIVING_FILE_DATA_PDUS = 2,
SENDING_ACK_PDU = 3,
TRANSFER_COMPLETION = 4,
SENDING_FINISHED_PDU = 5
};
/**
* Will be returned if it is advisable to call the state machine operation call again
*/
@ -91,16 +99,9 @@ class DestHandler {
ReturnValue_t initialize();
[[nodiscard]] CfdpStates getCfdpState() const;
[[nodiscard]] TransactionStep getTransactionStep() const;
private:
enum class TransactionStep {
IDLE = 0,
TRANSACTION_START = 1,
RECEIVING_FILE_DATA_PDUS = 2,
SENDING_ACK_PDU = 3,
TRANSFER_COMPLETION = 4,
SENDING_FINISHED_PDU = 5
};
struct TransactionParams {
explicit TransactionParams(size_t maxFileNameLen)
: sourceName(maxFileNameLen), destName(maxFileNameLen) {}