2023-03-14 11:21:37 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
|
|
|
#include <fsfw/power/DummyPowerSwitcher.h>
|
|
|
|
|
2023-04-14 21:44:23 +02:00
|
|
|
class PcduHandlerDummy : public PowerSwitchIF,
|
|
|
|
public HasLocalDataPoolIF,
|
|
|
|
public SystemObject,
|
|
|
|
public ExecutableObjectIF {
|
2023-03-14 11:21:37 +01:00
|
|
|
public:
|
|
|
|
static const DeviceCommandId_t SIMPLE_COMMAND = 1;
|
|
|
|
static const DeviceCommandId_t PERIODIC_REPLY = 2;
|
|
|
|
|
|
|
|
static const uint8_t SIMPLE_COMMAND_DATA = 1;
|
|
|
|
static const uint8_t PERIODIC_REPLY_DATA = 2;
|
|
|
|
|
2023-04-14 21:44:23 +02:00
|
|
|
PcduHandlerDummy(object_id_t objectId);
|
2023-03-14 11:21:37 +01:00
|
|
|
virtual ~PcduHandlerDummy();
|
|
|
|
|
|
|
|
protected:
|
2023-04-14 21:44:23 +02:00
|
|
|
MessageQueueIF* queue;
|
|
|
|
LocalDataPoolManager manager;
|
|
|
|
MutexIF* switcherLock;
|
2023-03-14 11:21:37 +01:00
|
|
|
DummyPowerSwitcher dummySwitcher;
|
2023-03-31 23:41:30 +02:00
|
|
|
using SwitcherBoolArray = std::array<bool, 18>;
|
2023-03-14 11:21:37 +01:00
|
|
|
|
2023-04-14 21:44:23 +02:00
|
|
|
ReturnValue_t performOperation(uint8_t opCode) override;
|
2023-03-31 23:41:30 +02:00
|
|
|
SwitcherBoolArray switchChangeArray{};
|
2023-04-14 21:44:23 +02:00
|
|
|
|
|
|
|
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
|
|
|
LocalDataPoolManager& poolManager) override;
|
2023-03-14 11:21:37 +01:00
|
|
|
|
|
|
|
ReturnValue_t sendSwitchCommand(power::Switch_t switchNr, ReturnValue_t onOff) override;
|
|
|
|
ReturnValue_t sendFuseOnCommand(uint8_t fuseNr) override;
|
|
|
|
ReturnValue_t getSwitchState(power::Switch_t switchNr) const override;
|
|
|
|
ReturnValue_t getFuseState(uint8_t fuseNr) const override;
|
|
|
|
uint32_t getSwitchDelayMs(void) const override;
|
2023-04-14 21:44:23 +02:00
|
|
|
|
|
|
|
object_id_t getObjectId() const override;
|
|
|
|
|
|
|
|
/** Command queue for housekeeping messages. */
|
|
|
|
MessageQueueId_t getCommandQueue() const override;
|
|
|
|
|
|
|
|
dur_millis_t getPeriodicOperationFrequency() const override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Every class implementing this interface should have a local data pool manager. This
|
|
|
|
* function will return a reference to the manager.
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
LocalDataPoolManager* getHkManagerHandle() override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is used by the pool manager to get a valid dataset
|
|
|
|
* from a SID. This function is protected to prevent users from
|
|
|
|
* using raw data set pointers which could not be thread-safe. Users
|
|
|
|
* should use the #ProvidesDataPoolSubscriptionIF.
|
|
|
|
* @param sid Corresponding structure ID
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
2023-03-14 11:21:37 +01:00
|
|
|
};
|