5V stack commanding for device handlers #335

Merged
meierj merged 30 commits from mueller_5v_stack_cmd_for_devices into develop 2023-01-10 15:49:10 +01:00
Showing only changes of commit d52ee5ff38 - Show all commits

View File

@ -25,7 +25,7 @@ PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF,
sdcMan(sdcMan) {}
void PayloadPcduHandler::doStartUp() {
if ((state != States::PL_PCDU_OFF) and (state != States::ON_TRANS_SSR)) {
if (state > States::STACK_5V_CORRECT) {
// Config error
sif::error << "PayloadPcduHandler::doStartUp: Invalid state" << std::endl;
}
@ -60,16 +60,13 @@ void PayloadPcduHandler::doShutDown() {
std::memset(adcSet.processed.value, 0, adcSet.processed.getSerializedSize());
clearSetOnOffFlag = false;
}
if (state == States::STACK_5V_SWITCHING) {
ReturnValue_t retval = stackHandler.deviceToOff(StackCommander::PL_PCDU, true);
if (retval == BUSY) {
return;
}
state = States::PL_PCDU_OFF;
// No need to set mode _MODE_POWER_DOWN, power switching was already handled
setMode(MODE_OFF);
ReturnValue_t retval = stackHandler.deviceToOff(StackCommander::PL_PCDU, true);
if (retval == BUSY) {
return;
}
state = States::PL_PCDU_OFF;
// No need to set mode _MODE_POWER_DOWN, power switching was already handled
setMode(MODE_OFF);
}
void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {