continue TM handling refactoring
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
@ -2,12 +2,12 @@
|
||||
#define CCSDSHANDLER_H_
|
||||
|
||||
#include <fsfw/modes/HasModesIF.h>
|
||||
#include <mission/tmtc/VirtualChannelWithQueue.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "VirtualChannel.h"
|
||||
#include "eive/definitions.h"
|
||||
#include "fsfw/action/ActionHelper.h"
|
||||
#include "fsfw/action/HasActionsIF.h"
|
||||
@ -44,6 +44,8 @@ class CcsdsIpCoreHandler : public SystemObject,
|
||||
public ReceivesParameterMessagesIF,
|
||||
public HasActionsIF {
|
||||
public:
|
||||
static const bool LINK_UP = true;
|
||||
static const bool LINK_DOWN = false;
|
||||
using VcId_t = uint8_t;
|
||||
|
||||
/**
|
||||
@ -58,14 +60,22 @@ class CcsdsIpCoreHandler : public SystemObject,
|
||||
* @param enTxClock GPIO ID of RS485 tx clock enable
|
||||
* @param enTxData GPIO ID of RS485 tx data enable
|
||||
*/
|
||||
CcsdsIpCoreHandler(object_id_t objectId, object_id_t tcDestination, PtmeIF& ptme,
|
||||
PtmeConfig& ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData);
|
||||
CcsdsIpCoreHandler(object_id_t objectId, object_id_t tcDestination, PtmeConfig& ptmeConfig,
|
||||
std::atomic_bool& linkState, GpioIF* gpioIF, gpioId_t enTxClock,
|
||||
gpioId_t enTxData);
|
||||
|
||||
~CcsdsIpCoreHandler();
|
||||
|
||||
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
|
||||
ReturnValue_t initialize();
|
||||
MessageQueueId_t getCommandQueue() const override;
|
||||
/**
|
||||
* Currently directly forwards requests to the virtual channels which might live
|
||||
* in different threads.
|
||||
* @param virtualChannel
|
||||
* @return
|
||||
*/
|
||||
// MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override;
|
||||
|
||||
// ModesIF
|
||||
void getMode(Mode_t* mode, Submode_t* submode) override;
|
||||
@ -80,9 +90,8 @@ class CcsdsIpCoreHandler : public SystemObject,
|
||||
* @param virtualChannelId ID of the virtual channel to add
|
||||
* @param virtualChannel Pointer to virtual channel object
|
||||
*/
|
||||
void addVirtualChannel(VcId_t virtualChannelId, VirtualChannel* virtualChannel);
|
||||
// void addVirtualChannel(VcId_t virtualChannelId, VirtualChannelWithQueue* virtualChannel);
|
||||
|
||||
// MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) const override;
|
||||
ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueIdentifier,
|
||||
ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues,
|
||||
uint16_t startAtIndex);
|
||||
@ -126,14 +135,9 @@ class CcsdsIpCoreHandler : public SystemObject,
|
||||
//! [EXPORT] : [COMMENT] Received action message with unknown action id
|
||||
static const ReturnValue_t COMMAND_NOT_IMPLEMENTED = MAKE_RETURN_CODE(0xA0);
|
||||
|
||||
static const bool UP = true;
|
||||
static const bool DOWN = false;
|
||||
|
||||
using VirtualChannelMap = std::unordered_map<VcId_t, VirtualChannel*>;
|
||||
using VirtualChannelMapIter = VirtualChannelMap::iterator;
|
||||
|
||||
PtmeIF& ptme;
|
||||
VirtualChannelMap virtualChannelMap;
|
||||
// using VirtualChannelMap = std::unordered_map<VcId_t, VirtualChannelWithQueue*>;
|
||||
// VirtualChannelMap virtualChannelMap;
|
||||
std::atomic_bool& linkState;
|
||||
|
||||
object_id_t tcDestination;
|
||||
|
||||
@ -156,15 +160,13 @@ class CcsdsIpCoreHandler : public SystemObject,
|
||||
// GPIO to enable RS485 transceiver for TX data signal
|
||||
gpioId_t enTxData = gpio::NO_GPIO;
|
||||
|
||||
bool linkState = DOWN;
|
||||
|
||||
void readCommandQueue(void);
|
||||
void handleTelemetry();
|
||||
|
||||
/**
|
||||
* @brief Forward link state to virtual channels.
|
||||
*/
|
||||
void forwardLinkstate();
|
||||
void updateLinkState();
|
||||
|
||||
/**
|
||||
* @brief Starts transmit timer and enables transmitter.
|
||||
|
Reference in New Issue
Block a user