Package jmri.jmrix.pi.simulator
Class GpioPinDigitalInputSimulator
java.lang.Object
jmri.jmrix.pi.simulator.GpioPinDigitalInputSimulator
Simulates a digital input GPIO pin for the JMRI Raspberry Pi simulator.
Pure JMRI implementation — no Pi4J dependency.
The initial state is HIGH so that sensors constructed in tests start as
Sensor.ACTIVE, preserving the behaviour of the former
PiGpioProviderScaffold which returned PinState.HIGH.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Consumer<Boolean> listener) booleanisHigh()voidremoveListener(Consumer<Boolean> listener) voidsetState(boolean high) Change the simulated pin state and notify all registered listeners.
-
Constructor Details
-
GpioPinDigitalInputSimulator
public GpioPinDigitalInputSimulator()
-
-
Method Details
-
isHigh
-
setState
Change the simulated pin state and notify all registered listeners.- Parameters:
high-true= HIGH,false= LOW
-
addListener
-
removeListener
-