eive-obsw/mission/tmtc/VirtualChannelWithQueue.h

43 lines
1.4 KiB
C
Raw Normal View History

2023-03-09 17:44:05 +01:00
#pragma once
#include <fsfw/ipc/MessageQueueIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <linux/ipcore/PtmeIF.h>
#include <mission/tmtc/VirtualChannel.h>
#include <atomic>
#include "OBSWConfig.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
class StorageManagerIF;
/**
* @brief This class represents a virtual channel. Sending a tm message to an object of this class
* will forward the tm packet to the respective virtual channel of the PTME IP Core.
*
* @author J. Meier
*/
2023-03-09 19:42:20 +01:00
class VirtualChannelWithQueue : public VirtualChannel, public AcceptsTelemetryIF {
2023-03-09 17:44:05 +01:00
public:
/**
* @brief Constructor
*
* @param vcId The virtual channel id assigned to this object
* @param tmQueueDepth Queue depth of queue receiving telemetry from other objects
*/
2023-03-09 19:42:20 +01:00
VirtualChannelWithQueue(object_id_t objectId, uint8_t vcId, const char* vcName, PtmeIF& ptme,
const std::atomic_bool& linkStateProvider, StorageManagerIF& tmStore,
uint32_t tmQueueDepth);
2023-03-09 17:44:05 +01:00
MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) const override;
2023-03-09 19:42:20 +01:00
[[nodiscard]] const char* getName() const override;
2023-03-09 17:44:05 +01:00
ReturnValue_t sendNextTm();
private:
MessageQueueIF* tmQueue = nullptr;
2023-03-10 02:05:51 +01:00
StorageManagerIF& tmStore;
2023-03-09 17:44:05 +01:00
};