PLOC SUPV dummy has switch now
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit Details

This commit is contained in:
Robin Müller 2023-03-16 18:52:32 +01:00
parent b1d2f73b01
commit 3c6eb265c7
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 19 additions and 5 deletions

View File

@ -1,8 +1,10 @@
#include "PlocSupervisorDummy.h"
PlocSupervisorDummy::PlocSupervisorDummy(object_id_t objectId, object_id_t comif,
CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
CookieIF *comCookie, PowerSwitchIF &pwrSwitcher)
: DeviceHandlerBase(objectId, comif, comCookie) {
setPowerSwitcher(&pwrSwitcher);
}
PlocSupervisorDummy::~PlocSupervisorDummy() {}
@ -42,3 +44,10 @@ ReturnValue_t PlocSupervisorDummy::initializeLocalDataPool(localpool::DataPool &
LocalDataPoolManager &poolManager) {
return returnvalue::OK;
}
ReturnValue_t PlocSupervisorDummy::getSwitches(const uint8_t **switches,
uint8_t *numberOfSwitches) {
*numberOfSwitches = 1;
*switches = reinterpret_cast<const uint8_t *>(&switchId);
return returnvalue::OK;
}

View File

@ -1,6 +1,7 @@
#pragma once
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <mission/powerDefs.h>
class PlocSupervisorDummy : public DeviceHandlerBase {
public:
@ -10,10 +11,13 @@ class PlocSupervisorDummy : public DeviceHandlerBase {
static const uint8_t SIMPLE_COMMAND_DATA = 1;
static const uint8_t PERIODIC_REPLY_DATA = 2;
PlocSupervisorDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
PlocSupervisorDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie,
PowerSwitchIF &pwrSwitcher);
virtual ~PlocSupervisorDummy();
protected:
const power::Switches switchId = power::Switches::PDU1_CH6_PLOC_12V;
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
@ -27,4 +31,5 @@ class PlocSupervisorDummy : public DeviceHandlerBase {
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) override;
};

View File

@ -221,8 +221,8 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
auto* plocMpsocDummy =
new PlocMpsocDummy(objects::PLOC_MPSOC_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
plocMpsocDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
auto* plocSupervisorDummy = new PlocSupervisorDummy(objects::PLOC_SUPERVISOR_HANDLER,
objects::DUMMY_COM_IF, comCookieDummy);
auto* plocSupervisorDummy = new PlocSupervisorDummy(
objects::PLOC_SUPERVISOR_HANDLER, objects::DUMMY_COM_IF, comCookieDummy, pwrSwitcher);
plocSupervisorDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
}
}