added gpio read function
This commit is contained in:
@ -214,21 +214,13 @@ void HeaterHandler::handleSwitchOnCommand(HeaterMapIter heaterMapIter) {
|
||||
gpioId_t gpioId = getGpioIdFromSwitchNr(switchNr);
|
||||
result = gpioInterface->pullHigh(gpioId);
|
||||
if (result != RETURN_OK) {
|
||||
sif::error << "HeaterHandler::handleSwitchOnCommand: Failed to pull gpio with id"
|
||||
<< gpioId << "high" << std::endl;
|
||||
sif::error << "HeaterHandler::handleSwitchOnCommand: Failed to pull gpio with id "
|
||||
<< gpioId << " high" << std::endl;
|
||||
triggerEvent(GPIO_PULL_HIGH_FAILED, result);
|
||||
}
|
||||
else {
|
||||
switchStates[switchNr] = ON;
|
||||
}
|
||||
int gpioState;
|
||||
result = gpioInterface->readGpio(gpioId, &gpioState);
|
||||
if (result != RETURN_OK) {
|
||||
sif::debug << "HeaterHandler::handleSwitchOnCommand: Failed to read gpio"
|
||||
<< std::endl;
|
||||
}
|
||||
sif::debug << "HeaterHandler::handleSwitchOnCommand: GPIO state: " << gpioState
|
||||
<< std::endl;
|
||||
}
|
||||
else {
|
||||
triggerEvent(SWITCH_ALREADY_ON, switchNr);
|
||||
@ -283,14 +275,6 @@ void HeaterHandler::handleSwitchOffCommand(HeaterMapIter heaterMapIter) {
|
||||
mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF);
|
||||
}
|
||||
}
|
||||
int gpioState;
|
||||
result = gpioInterface->readGpio(gpioId, &gpioState);
|
||||
if (result != RETURN_OK) {
|
||||
sif::debug << "HeaterHandler::handleSwitchOnCommand: Failed to read gpio"
|
||||
<< std::endl;
|
||||
}
|
||||
sif::debug << "HeaterHandler::handleSwitchOnCommand: GPIO state: " << gpioState
|
||||
<< std::endl;
|
||||
}
|
||||
else {
|
||||
sif::info << "HeaterHandler::handleSwitchOffCommand: Switch already off" << std::endl;
|
||||
|
Reference in New Issue
Block a user