corrected logic

This commit is contained in:
Marius Eggert 2023-10-10 10:06:32 +02:00
parent 33d3e7686c
commit 000077f327
4 changed files with 16 additions and 8 deletions

View File

@ -1511,10 +1511,12 @@ ReturnValue_t PlocMpsocHandler::checkModeCommand(Mode_t commandedMode, Submode_t
if (commandedMode != MODE_OFF) { if (commandedMode != MODE_OFF) {
PoolReadGuard pg(&enablePl); PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) {
return NON_OP_STATE_OF_CHARGE; return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode);
} }
} }
return NON_OP_STATE_OF_CHARGE;
} }
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode);
} }

View File

@ -1999,10 +1999,12 @@ ReturnValue_t PlocSupervisorHandler::checkModeCommand(Mode_t commandedMode,
if (commandedMode != MODE_OFF) { if (commandedMode != MODE_OFF) {
PoolReadGuard pg(&enablePl); PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) {
return NON_OP_STATE_OF_CHARGE; return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode);
} }
} }
return NON_OP_STATE_OF_CHARGE;
} }
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode);
} }

View File

@ -569,10 +569,12 @@ ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode
if (commandedMode != MODE_OFF) { if (commandedMode != MODE_OFF) {
PoolReadGuard pg(&enablePl); PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) {
return NON_OP_STATE_OF_CHARGE; return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode);
} }
} }
return NON_OP_STATE_OF_CHARGE;
} }
return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode); return DeviceHandlerBase::checkModeCommand(commandedMode, commandedSubmode, msToReachTheMode);
} }

View File

@ -14,10 +14,12 @@ ReturnValue_t CamSwitcher::checkModeCommand(Mode_t commandedMode, Submode_t comm
if (commandedMode != MODE_OFF) { if (commandedMode != MODE_OFF) {
PoolReadGuard pg(&enablePl); PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) { if (enablePl.plUseAllowed.isValid() and enablePl.plUseAllowed.value) {
return TRANS_NOT_ALLOWED; return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode);
} }
} }
return TRANS_NOT_ALLOWED;
} }
return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode, return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode); msToReachTheMode);