eive-obsw/mission/tmtc/PusTmFunnel.h
Robin Mueller a3f2219f9b
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
pass HK and not ok packets as well
2023-02-20 15:42:04 +01:00

54 lines
1.5 KiB
C++

#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 "fsfw/ipc/CommandMessage.h"
#include <mission/tmtc/TmFunnelBase.h>
#include <vector>
#include "PersistentTmStore.h"
#include "fsfw/timemanager/TimeReaderIF.h"
/**
* @brief TM Recipient.
* @details
* Main telemetry receiver. All generated telemetry is funneled into this object.
* @ingroup utility
* @author J. Meier, R. Mueller
*/
class PusTmFunnel : public TmFunnelBase {
public:
PusTmFunnel(TmFunnelBase::FunnelCfg cfg, TimeReaderIF &timeReader, SdCardMountedIF &sdcMan);
[[nodiscard]] const char *getName() const override;
~PusTmFunnel() override;
ReturnValue_t performOperation(uint8_t operationCode);
private:
// Update TV stamp every 5 minutes
static constexpr dur_millis_t TV_UPDATE_INTERVAL_SECS = 60 * 5;
uint16_t sourceSequenceCount = 0;
TimeReaderIF &timeReader;
bool storesInitialized = false;
timeval currentTv{};
timeval lastTvUpdate{};
TmStore miscStore;
TmStore okStore;
TmStore notOkStore;
TmStore hkStore;
SdCardMountedIF &sdcMan;
ReturnValue_t handleTcRequest(CommandMessage& msg);
ReturnValue_t handleTmPacket(TmTcMessage &message);
void initStoresIfPossible(bool sdCardUsable);
ReturnValue_t initialize() override;
};
#endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H