eive-obsw/dummies/PduDummy.cpp

46 lines
1.7 KiB
C++
Raw Permalink Normal View History

2022-06-16 08:26:40 +02:00
#include "PduDummy.h"
2023-03-26 16:13:54 +02:00
#include <mission/power/gsDefs.h>
2022-06-16 08:26:40 +02:00
PduDummy::PduDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
2023-02-21 21:37:30 +01:00
: DeviceHandlerBase(objectId, comif, comCookie),
coreHk(this, static_cast<uint32_t>(P60System::SetIds::CORE)) {}
2022-06-16 08:26:40 +02:00
PduDummy::~PduDummy() {}
void PduDummy::doStartUp() { setMode(MODE_NORMAL); }
2022-06-16 08:26:40 +02:00
void PduDummy::doShutDown() { setMode(MODE_OFF); }
2022-06-16 08:26:40 +02:00
ReturnValue_t PduDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
ReturnValue_t PduDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t PduDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData, size_t commandDataLen) {
2022-08-24 17:27:47 +02:00
return returnvalue::OK;
2022-06-16 08:26:40 +02:00
}
ReturnValue_t PduDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) {
2022-08-24 17:27:47 +02:00
return returnvalue::OK;
2022-06-16 08:26:40 +02:00
}
ReturnValue_t PduDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
2022-08-24 17:27:47 +02:00
return returnvalue::OK;
2022-06-16 08:26:40 +02:00
}
void PduDummy::fillCommandAndReplyMap() {}
uint32_t PduDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t PduDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(PDU::pool::PDU_TEMPERATURE, new PoolEntry<float>({10.0}, true));
2023-02-21 21:37:30 +01:00
localDataPoolMap.emplace(PDU::pool::PDU_VOLTAGES, &pduVoltages);
localDataPoolMap.emplace(PDU::pool::PDU_CURRENTS, &pduCurrents);
2022-08-24 17:27:47 +02:00
return returnvalue::OK;
2022-06-16 08:26:40 +02:00
}