fsfw/src/fsfw/tcdistribution/CcsdsDistributorIF.h

55 lines
2.0 KiB
C
Raw Normal View History

2020-10-01 13:23:06 +02:00
#ifndef FSFW_TCDISTRIBUTION_CCSDSDISTRIBUTORIF_H_
#define FSFW_TCDISTRIBUTION_CCSDSDISTRIBUTORIF_H_
#include "fsfw/ipc/MessageQueueSenderIF.h"
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
/**
* This is the Interface to a CCSDS Distributor.
2020-10-01 13:23:06 +02:00
* On a CCSDS Distributor, Applications (in terms of CCSDS) may register
* themselves, either by passing a pointer to themselves (and implementing the
* CCSDSApplicationIF), or by explicitly passing an APID and a MessageQueueId
* to route the TC's to.
* @ingroup tc_distribution
*/
2022-07-29 12:03:14 +02:00
class CcsdsDistributorIF {
2022-02-02 10:29:30 +01:00
public:
struct DestInfo {
DestInfo(const char* name, uint16_t apid, MessageQueueId_t destId, bool removeHeader)
: name(name), apid(apid), destId(destId), removeHeader(removeHeader) {}
2022-08-01 17:16:37 +02:00
DestInfo(const AcceptsTelecommandsIF& ccsdsReceiver, bool removeHeader_)
: name(ccsdsReceiver.getName()) {
apid = ccsdsReceiver.getIdentifier();
destId = ccsdsReceiver.getRequestQueue();
removeHeader = removeHeader_;
}
const char* name;
uint16_t apid;
MessageQueueId_t destId;
bool removeHeader;
};
2022-02-02 10:29:30 +01:00
/**
* With this call, other Applications can register to the CCSDS distributor.
* This is done by passing an APID and a MessageQueueId to the method.
* @param info Contains all necessary info to register an application.
* @return
* - @c RETURN_OK on success,
* - @c RETURN_FAILED or tcdistrib error code on failure.
* - @c tcdistrib::INVALID_CCSDS_VERSION
* - @c tcdistrib::INVALID_APID No APID available to handle this packet
* - @c tcdistrib::INVALID_PACKET_TYPE Packet type TM detected
* - @c tcdistrib::INCORRECT_PRIMARY_HEADER Something other wrong with primary header
* - @c tcdistrib::INCOMPLETE_PACKET Size missmatch between data length field and actual
* length
2022-02-02 10:29:30 +01:00
*/
virtual ReturnValue_t registerApplication(DestInfo info) = 0;
2022-02-02 10:29:30 +01:00
/**
* The empty virtual destructor.
*/
2022-07-29 12:03:14 +02:00
virtual ~CcsdsDistributorIF() = default;
};
2020-10-01 13:23:06 +02:00
#endif /* FSFW_TCDISTRIBUTION_CCSDSDISTRIBUTORIF_H_ */