src/ESPStepperMotorServer.cpp
byte ESPStepperMotorServer::getPositionSwitchStatus(int positionSwitchIndex)
{
    ESPStepperMotorServer_PositionSwitch *posSwitch = this->serverConfiguration->getSwitch(positionSwitchIndex);
    if (posSwitch)
    {
        byte buttonState = digitalRead(posSwitch->getIoPinNumber());
        if ((posSwitch->getSwitchType() & ESPServerSwitchType_ActiveHigh) == ESPServerSwitchType_ActiveHigh)
        {
            return (buttonState) ? 1 : 0;
        }
        else
        {
            return (buttonState) ? 0 : 1;
        }
    }
    return 0;
}
/**
 * checks if the configured position switch at the given configuration index is triggered (active) or not
 * This function takes the configured type ESPServerSwitchType_ActiveHigh or ESPServerSwitchType_ActiveLow into account when determining the current active state
 * e.g. if a switch is configured to be ESPServerSwitchType_ActiveLow the function will return 1 when the switch is triggered (low signal on IO pin).
 * For a switch that is configured ESPServerSwitchType_ActiveHigh on the other side, the function will return 0 when a low signal is on the IO pin, and 1 when a high signal is present
 */
checks if the configured position switch at the given configuration index is triggered (active) or not
This function takes the configured type ESPServerSwitchType_ActiveHigh or ESPServerSwitchType_ActiveLow into account when determining the current active state
e.g. if a switch is configured to be ESPServerSwitchType_ActiveLow the function will return 1 when the switch is triggered (low signal on IO pin).
For a switch that is configured ESPServerSwitchType_ActiveHigh on the other side, the function will return 0 when a low signal is on the IO pin, and 1 when a high signal is present
checks if the configured position switch at the given configuration index is triggered ( active ) or not This function takes the configured type ESPServerSwitchType_ActiveHigh or ESPServerSwitchType_ActiveLow into account when determining the current active state e . g . if a switch is configured to be ESPServerSwitchType_ActiveLow the function will return 1 when the switch is triggered ( low signal on IO pin ) . For a switch that is configured ESPServerSwitchType_ActiveHigh on the other side the function will return 0 when a low signal is on the IO pin and 1 when a high signal is present
byte ESPStepperMotorServer::getPositionSwitchStatus(int positionSwitchIndex)
{
    ESPStepperMotorServer_PositionSwitch *posSwitch = this->serverConfiguration->getSwitch(positionSwitchIndex);
    if (posSwitch)
    {
        byte buttonState = digitalRead(posSwitch->getIoPinNumber());
        if ((posSwitch->getSwitchType() & ESPServerSwitchType_ActiveHigh) == ESPServerSwitchType_ActiveHigh)
        {
            return (buttonState) ? 1 : 0;
        }
        else
        {
            return (buttonState) ? 0 : 1;
        }
    }
    return 0;
}
byte ESPStepperMotorServer :: getPositionSwitchStatus ( int positionSwitchIndex ) { ESPStepperMotorServer_PositionSwitch * posSwitch = this -> serverConfiguration -> getSwitch ( positionSwitchIndex ) ; if ( posSwitch ) { byte buttonState = digitalRead ( posSwitch -> getIoPinNumber ( ) ) ; if ( ( posSwitch -> getSwitchType ( ) & ESPServerSwitchType_ActiveHigh ) == ESPServerSwitchType_ActiveHigh ) { return ( buttonState ) ? 1 : 0 ; } else { return ( buttonState ) ? 0 : 1 ; } } return 0 ; }
checks if the configured position switch at the given configuration index is triggered (active) or not
 This function takes the configured type ESPServerSwitchType_ActiveHigh or ESPServerSwitchType_ActiveLow into account when determining the current active state
 e.g.
checks if the configured position switch at the given configuration index is triggered ( active ) or not This function takes the configured type ESPServerSwitchType_ActiveHigh or ESPServerSwitchType_ActiveLow into account when determining the current active state e . g .