fsfw/src/fsfw/tcdistribution/PUSDistributor.h

78 lines
2.5 KiB
C
Raw Normal View History

2020-10-01 13:23:06 +02:00
#ifndef FSFW_TCDISTRIBUTION_PUSDISTRIBUTOR_H_
#define FSFW_TCDISTRIBUTION_PUSDISTRIBUTOR_H_
2020-08-13 20:53:35 +02:00
#include "PUSDistributorIF.h"
#include "TcDistributor.h"
#include "TcPacketCheckPUS.h"
2022-08-16 12:48:22 +02:00
#include "fsfw/returnvalues/returnvalue.h"
2022-02-02 10:29:30 +01:00
#include "fsfw/tmtcpacket/pus/tc.h"
2021-07-13 20:22:54 +02:00
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
#include "fsfw/tmtcservices/VerificationReporter.h"
/**
2020-10-01 13:23:06 +02:00
* This class accepts PUS Telecommands and forwards them to Application
* services. In addition, the class performs a formal packet check and
* sends acceptance success or failure messages.
* @ingroup tc_distribution
*/
2022-02-02 10:29:30 +01:00
class PUSDistributor : public TcDistributor, public PUSDistributorIF, 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.
*/
PUSDistributor(uint16_t setApid, object_id_t setObjectId, object_id_t setPacketSource);
/**
* The destructor is empty.
*/
virtual ~PUSDistributor();
ReturnValue_t registerService(AcceptsTelecommandsIF* service) override;
MessageQueueId_t getRequestQueue() override;
ReturnValue_t initialize() override;
uint16_t getIdentifier() override;
2020-10-01 13:23:06 +02:00
2022-02-02 10:29:30 +01:00
protected:
/**
* This attribute contains the class, that performs a formal packet check.
*/
TcPacketCheckPUS checker;
/**
* With this class, verification messages are sent to the
* TC Verification service.
*/
VerificationReporter verifyChannel;
/**
* The currently handled packet is stored here.
*/
TcPacketStoredPus* currentPacket = nullptr;
2021-06-13 16:29:13 +02:00
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;
2020-10-01 13:23:06 +02:00
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;
};
2020-10-01 13:23:06 +02:00
#endif /* FSFW_TCDISTRIBUTION_PUSDISTRIBUTOR_H_ */