fsfw/src/fsfw/tcdistribution/CFDPDistributor.h

72 lines
2.3 KiB
C
Raw Normal View History

#ifndef FSFW_TCDISTRIBUTION_CFDPDISTRIBUTOR_H_
#define FSFW_TCDISTRIBUTION_CFDPDISTRIBUTOR_H_
2022-07-19 18:13:25 +02:00
#include <fsfw/tcdistribution/CfdpPacketChecker.h>
2022-02-02 10:29:30 +01:00
2022-08-16 12:48:22 +02:00
#include "../returnvalues/returnvalue.h"
2022-07-19 18:13:25 +02:00
#include "../tmtcpacket/cfdp/CfdpPacketStored.h"
#include "../tmtcservices/AcceptsTelecommandsIF.h"
#include "../tmtcservices/VerificationReporter.h"
2022-02-02 10:29:30 +01:00
#include "CFDPDistributorIF.h"
#include "TcDistributor.h"
/**
* This class accepts CFDP Telecommands and forwards them to Application
* services.
* @ingroup tc_distribution
*/
2022-02-02 10:29:30 +01:00
class CFDPDistributor : public TcDistributor,
public CFDPDistributorIF,
public AcceptsTelecommandsIF {
public:
/**
* The ctor passes @c set_apid to the checker class and calls the
* TcDistribution ctor with a certain object id.
* @param setApid The APID of this receiving Application.
* @param setObjectId Object ID of the distributor itself
* @param setPacketSource Object ID of the source of TC packets.
* Must implement CCSDSDistributorIF.
*/
CFDPDistributor(uint16_t setApid, object_id_t setObjectId, object_id_t setPacketSource);
/**
* The destructor is empty.
*/
2022-07-19 18:13:25 +02:00
~CFDPDistributor() override;
2022-02-02 10:29:30 +01:00
ReturnValue_t registerHandler(AcceptsTelecommandsIF* handler) override;
2022-09-14 20:10:41 +02:00
MessageQueueId_t getRequestQueue() const override;
2022-02-02 10:29:30 +01:00
ReturnValue_t initialize() override;
2022-09-14 20:10:41 +02:00
uint32_t getIdentifier() const override;
2022-02-02 10:29:30 +01:00
protected:
uint16_t apid;
/**
* The currently handled packet is stored here.
*/
2022-07-19 18:13:25 +02:00
CfdpPacketStored* currentPacket = nullptr;
CfdpPacketChecker checker;
2022-02-02 10:29:30 +01:00
/**
* With this variable, the current check status is stored to generate
* acceptance messages later.
*/
ReturnValue_t tcStatus;
2022-02-02 10:29:30 +01:00
const object_id_t packetSource;
2022-02-02 10:29:30 +01:00
/**
* This method reads the packet service, checks if such a service is
* registered and forwards the packet to the destination.
* It also initiates the formal packet check and sending of verification
* messages.
* @return Iterator to map entry of found service id
* or iterator to @c map.end().
*/
TcMqMapIter selectDestination() override;
/**
* The callback here handles the generation of acceptance
* success/failure messages.
*/
// ReturnValue_t callbackAfterSending(ReturnValue_t queueStatus) override;
};
#endif /* FSFW_TCDISTRIBUTION_CFDPDISTRIBUTOR_H_ */