eive-obsw/dummies/PlocMpsocDummy.cpp

58 lines
2.1 KiB
C++
Raw Normal View History

2023-02-13 17:59:08 +01:00
#include "PlocMpsocDummy.h"
PlocMpsocDummy::PlocMpsocDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
PlocMpsocDummy::~PlocMpsocDummy() {}
2023-03-14 11:33:14 +01:00
void PlocMpsocDummy::doStartUp() { setMode(MODE_ON); }
2023-02-13 17:59:08 +01:00
2023-03-14 11:33:14 +01:00
void PlocMpsocDummy::doShutDown() { setMode(MODE_OFF); }
2023-02-13 17:59:08 +01:00
ReturnValue_t PlocMpsocDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t PlocMpsocDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t PlocMpsocDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData,
size_t commandDataLen) {
return returnvalue::OK;
}
2023-10-10 10:06:10 +02:00
ReturnValue_t PlocMpsocDummy::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
uint32_t *msToReachTheMode) {
if (commandedMode != MODE_OFF) {
PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) {
if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) {
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode);
}
}
return NON_OP_STATE_OF_CHARGE;
}
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode);
}
2023-02-13 17:59:08 +01:00
ReturnValue_t PlocMpsocDummy::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
return returnvalue::OK;
}
ReturnValue_t PlocMpsocDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return returnvalue::OK;
}
void PlocMpsocDummy::fillCommandAndReplyMap() {}
uint32_t PlocMpsocDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t PlocMpsocDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
return returnvalue::OK;
}