eive-obsw/mission/tmtc/VirtualChannel.h
Robin Mueller 976235a79f
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
check busy state
2023-03-10 18:04:04 +01:00

41 lines
1.2 KiB
C++

#pragma once
#include <fsfw/objectmanager/SystemObject.h>
#include <linux/ipcore/PtmeIF.h>
#include <linux/ipcore/VirtualChannelIF.h>
#include <atomic>
#include <string>
/**
* @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
*/
class VirtualChannel : public SystemObject, public VirtualChannelIF {
public:
/**
* @brief Constructor
*
* @param vcId The virtual channel id assigned to this object
* @param tmQueueDepth Queue depth of queue receiving telemetry from other objects
*/
VirtualChannel(object_id_t objectId, uint8_t vcId, const char* vcName, PtmeIF& ptme,
const std::atomic_bool& linkStateProvider);
ReturnValue_t initialize() override;
ReturnValue_t sendNextTm(const uint8_t* data, size_t size);
bool isBusy() const override;
ReturnValue_t write(const uint8_t* data, size_t size) override;
uint8_t getVcid() const;
const char* getName() const;
private:
PtmeIF& ptme;
uint8_t vcId = 0;
std::string vcName;
const std::atomic_bool& linkStateProvider;
};