public RelayState?GetRelayState(int gpioPin) { var IsPinOpen = _gpioController.IsPinOpen(gpioPin); if (!IsPinOpen) { _gpioController.OpenPin(gpioPin); } var pinState = _gpioController.GetPinMode(gpioPin); return(pinState == PinMode.Output ? RelayState.On : RelayState.Off); }
public PinMode GetPinMode(int pinNumber) { return(_controller.GetPinMode(pinNumber)); }