2021-12-03 15:37:49 +01:00
|
|
|
#ifndef FSFW_CFDP_CFDPHANDLER_H_
|
|
|
|
#define FSFW_CFDP_CFDPHANDLER_H_
|
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
#include "fsfw/ipc/MessageQueueIF.h"
|
2021-12-03 15:37:49 +01:00
|
|
|
#include "fsfw/objectmanager/SystemObject.h"
|
|
|
|
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
|
|
|
#include "fsfw/tasks/ExecutableObjectIF.h"
|
2022-07-29 12:03:14 +02:00
|
|
|
#include "fsfw/tcdistribution/CfdpDistributor.h"
|
2022-02-02 10:29:30 +01:00
|
|
|
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
|
2021-12-03 15:37:49 +01:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
namespace Factory {
|
2021-12-03 15:37:49 +01:00
|
|
|
void setStaticFrameworkObjectIds();
|
|
|
|
}
|
|
|
|
|
2022-07-28 15:13:27 +02:00
|
|
|
class CfdpHandler : public ExecutableObjectIF,
|
2022-02-02 10:29:30 +01:00
|
|
|
public AcceptsTelecommandsIF,
|
|
|
|
public SystemObject,
|
|
|
|
public HasReturnvaluesIF {
|
|
|
|
friend void(Factory::setStaticFrameworkObjectIds)();
|
|
|
|
|
|
|
|
public:
|
2022-07-29 12:03:14 +02:00
|
|
|
CfdpHandler(object_id_t setObjectId, CfdpDistributor* distributor);
|
2022-02-02 10:29:30 +01:00
|
|
|
/**
|
|
|
|
* The destructor is empty.
|
|
|
|
*/
|
2022-07-28 15:13:27 +02:00
|
|
|
virtual ~CfdpHandler();
|
2022-02-02 10:29:30 +01:00
|
|
|
|
|
|
|
virtual ReturnValue_t handleRequest(store_address_t storeId);
|
|
|
|
|
|
|
|
virtual ReturnValue_t initialize() override;
|
2022-08-01 11:00:36 +02:00
|
|
|
virtual uint32_t getIdentifier() const override;
|
|
|
|
MessageQueueId_t getRequestQueue() const override;
|
2022-02-02 10:29:30 +01:00
|
|
|
ReturnValue_t performOperation(uint8_t opCode) override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
* This is a complete instance of the telecommand reception queue
|
|
|
|
* of the class. It is initialized on construction of the class.
|
|
|
|
*/
|
|
|
|
MessageQueueIF* requestQueue = nullptr;
|
|
|
|
|
2022-07-29 12:03:14 +02:00
|
|
|
CfdpDistributor* distributor = nullptr;
|
2022-02-02 10:29:30 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current CFDP packet to be processed.
|
|
|
|
* It is deleted after handleRequest was executed.
|
|
|
|
*/
|
2022-07-19 18:13:25 +02:00
|
|
|
CfdpPacketStored currentPacket;
|
2022-02-02 10:29:30 +01:00
|
|
|
|
|
|
|
static object_id_t packetSource;
|
|
|
|
|
|
|
|
static object_id_t packetDestination;
|
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* This constant sets the maximum number of packets accepted per call.
|
|
|
|
* Remember that one packet must be completely handled in one
|
|
|
|
* #handleRequest call.
|
|
|
|
*/
|
|
|
|
static const uint8_t CFDP_HANDLER_MAX_RECEPTION = 100;
|
2021-12-03 15:37:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FSFW_CFDP_CFDPHANDLER_H_ */
|