added active function
This commit is contained in:
parent
d791fc87b7
commit
6dd6f28db0
@ -55,6 +55,13 @@ void PowerSwitcher::turnOff() {
|
|||||||
state = WAIT_OFF;
|
state = WAIT_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PowerSwitcher::active() {
|
||||||
|
if(state == WAIT_OFF or state == WAIT_ON) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
PowerSwitcher::SwitchReturn_t PowerSwitcher::howManySwitches() {
|
PowerSwitcher::SwitchReturn_t PowerSwitcher::howManySwitches() {
|
||||||
if (secondSwitch == power::NO_SWITCH) {
|
if (secondSwitch == power::NO_SWITCH) {
|
||||||
return ONE_SWITCH;
|
return ONE_SWITCH;
|
||||||
|
@ -22,6 +22,7 @@ class PowerSwitcher : public HasReturnvaluesIF {
|
|||||||
State_t setStartState = SWITCH_IS_OFF);
|
State_t setStartState = SWITCH_IS_OFF);
|
||||||
void turnOn();
|
void turnOn();
|
||||||
void turnOff();
|
void turnOff();
|
||||||
|
bool active();
|
||||||
void doStateMachine();
|
void doStateMachine();
|
||||||
State_t getState();
|
State_t getState();
|
||||||
ReturnValue_t checkSwitchState();
|
ReturnValue_t checkSwitchState();
|
||||||
|
Loading…
Reference in New Issue
Block a user