cam switcher mode change soc check

This commit is contained in:
2023-09-29 15:26:21 +02:00
parent b66b202373
commit 8847ed611d
2 changed files with 22 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#include "CamSwitcher.h"
CamSwitcher::CamSwitcher(object_id_t objectId, PowerSwitchIF &pwrSwitcher,
CamSwitcher::CamSwitcher(object_id_t objectId, PowerSwitchIF& pwrSwitcher,
power::Switch_t pwrSwitch)
: PowerSwitcherComponent(objectId, &pwrSwitcher, pwrSwitch) {}
void CamSwitcher::performFaultyOperation() {
@ -8,3 +8,17 @@ void CamSwitcher::performFaultyOperation() {
switcher.turnOff();
}
}
ReturnValue_t CamSwitcher::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 not enablePl.plUseAllowed.value) {
return TRANS_NOT_ALLOWED;
}
}
}
return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode);
}