fsfw-example-common/example/utility/TmFunnel.h

52 lines
1.4 KiB
C
Raw Normal View History

2021-06-08 13:29:49 +02:00
#ifndef MISSION_UTILITY_TMFUNNEL_H_
#define MISSION_UTILITY_TMFUNNEL_H_
2022-05-05 20:55:28 +02:00
#include <fsfw/ipc/MessageQueueIF.h>
2021-06-08 13:29:49 +02:00
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
#include <fsfw/tmtcservices/TmTcMessage.h>
2022-05-05 20:55:28 +02:00
namespace Factory {
2021-06-08 13:29:49 +02:00
void setStaticFrameworkObjectIds();
}
/**
* @brief TM Recipient.
* @details
* Main telemetry receiver. All generated telemetry is funneled into
* this object.
* @ingroup utility
* @author J. Meier
*/
2022-05-22 15:30:08 +02:00
class TmFunnel : public AcceptsTelemetryIF,
public ExecutableObjectIF,
public SystemObject {
2022-05-05 20:55:28 +02:00
friend void(Factory::setStaticFrameworkObjectIds)();
2022-05-22 15:30:08 +02:00
public:
2022-05-05 20:55:28 +02:00
TmFunnel(object_id_t objectId, uint32_t messageDepth = 20);
virtual ~TmFunnel();
2022-05-22 15:30:08 +02:00
virtual MessageQueueId_t
getReportReceptionQueue(uint8_t virtualChannel = 0) override;
2022-05-05 20:55:28 +02:00
virtual ReturnValue_t performOperation(uint8_t operationCode = 0) override;
virtual ReturnValue_t initialize() override;
2022-05-22 15:30:08 +02:00
protected:
2022-05-05 20:55:28 +02:00
static object_id_t downlinkDestination;
static object_id_t storageDestination;
2022-05-22 15:30:08 +02:00
private:
2022-05-05 20:55:28 +02:00
uint16_t sourceSequenceCount = 0;
2022-05-22 15:30:08 +02:00
MessageQueueIF *tmQueue = nullptr;
MessageQueueIF *storageQueue = nullptr;
2022-05-05 20:55:28 +02:00
2022-05-22 15:30:08 +02:00
StorageManagerIF *tmPool = nullptr;
2022-05-05 20:55:28 +02:00
uint32_t messageDepth = 0;
2022-05-22 15:30:08 +02:00
ReturnValue_t handlePacket(TmTcMessage *message);
2021-06-08 13:29:49 +02:00
};
#endif /* MISSION_UTILITY_TMFUNNEL_H_ */