fsfw-example-common/example/utility/TmFunnel.h
2022-07-27 17:57:22 +02:00

54 lines
1.5 KiB
C++

#ifndef MISSION_UTILITY_TMFUNNEL_H_
#define MISSION_UTILITY_TMFUNNEL_H_
#include <fsfw/ipc/MessageQueueIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
#include <fsfw/tmtcservices/TmTcMessage.h>
#include "fsfw/timemanager/TimeReaderIF.h"
namespace Factory {
void setStaticFrameworkObjectIds();
}
/**
* @brief TM Recipient.
* @details
* Main telemetry receiver. All generated telemetry is funneled into
* this object.
* @ingroup utility
* @author J. Meier
*/
class TmFunnel : public AcceptsTelemetryIF,
public ExecutableObjectIF,
public SystemObject {
friend void(Factory::setStaticFrameworkObjectIds)();
public:
explicit TmFunnel(TimeReaderIF& timeReader, object_id_t objectId, uint32_t messageDepth = 20);
~TmFunnel() override;
MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) override;
ReturnValue_t performOperation(uint8_t operationCode) override;
ReturnValue_t initialize() override;
protected:
static object_id_t downlinkDestination;
static object_id_t storageDestination;
private:
uint16_t sourceSequenceCount = 0;
TimeReaderIF& timeReader;
MessageQueueIF *tmQueue = nullptr;
MessageQueueIF *storageQueue = nullptr;
StorageManagerIF *tmPool = nullptr;
uint32_t messageDepth = 0;
ReturnValue_t handlePacket(TmTcMessage *message);
};
#endif /* MISSION_UTILITY_TMFUNNEL_H_ */