eive-obsw/mission/tmtc/PusTmFunnel.h

53 lines
1.7 KiB
C
Raw Normal View History

2022-10-21 11:51:44 +02:00
#ifndef FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H
#define FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_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 <mission/tmtc/TmFunnelBase.h>
#include <vector>
2022-10-21 11:51:44 +02:00
2022-12-13 14:19:43 +01:00
#include "TmStore.h"
2022-10-21 11:51:44 +02:00
#include "fsfw/timemanager/TimeReaderIF.h"
/**
* @brief TM Recipient.
* @details
2022-10-21 11:54:14 +02:00
* TODO: Add support for TM storage by using the (or a) LIVE flag provided by the CCSDS or Syrlinks
* handler. If we are in LIVE TM mode, forward TM to downlink destination directly. Otherwise,
* forward to TM storage backend which stores TMs into files.
2022-10-21 11:51:44 +02:00
* Main telemetry receiver. All generated telemetry is funneled into
* this object.
* @ingroup utility
2022-10-21 11:54:14 +02:00
* @author J. Meier, R. Mueller
2022-10-21 11:51:44 +02:00
*/
class PusTmFunnel : public TmFunnelBase {
2022-10-21 11:51:44 +02:00
public:
explicit PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore,
2022-12-13 14:19:43 +01:00
SdCardMountedIF &sdcMan, uint32_t messageDepth = 10);
2022-10-21 11:51:44 +02:00
[[nodiscard]] const char *getName() const override;
~PusTmFunnel() override;
ReturnValue_t performOperation(uint8_t operationCode);
private:
2022-12-13 15:35:39 +01:00
// Update TV stamp every 5 minutes
static constexpr dur_millis_t TV_UPDATE_INTERVAL_SECS = 60 * 5;
2022-10-21 11:51:44 +02:00
uint16_t sourceSequenceCount = 0;
TimeReaderIF &timeReader;
2022-12-13 14:38:30 +01:00
bool storesInitialized = false;
timeval currentTv;
2022-12-13 14:19:43 +01:00
TmStore miscStore;
TmStore eventStore;
2022-12-13 14:38:30 +01:00
SdCardMountedIF &sdcMan;
2022-10-21 11:51:44 +02:00
ReturnValue_t handlePacket(TmTcMessage &message);
2022-12-13 14:30:16 +01:00
ReturnValue_t initialize() override;
2022-10-21 11:51:44 +02:00
};
#endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H