public abstract class AbstractDigitalInputDevice extends GpioInputDevice<DigitalInputEvent> implements DigitalInputDeviceInterface
Modifier and Type | Field and Description |
---|---|
protected boolean |
activeHigh |
gpio
Constructor and Description |
---|
AbstractDigitalInputDevice(int gpio,
boolean activeHigh) |
Modifier and Type | Method and Description |
---|---|
protected void |
disableDeviceListener() |
protected void |
enableDeviceListener() |
boolean |
isActiveHigh()
Get active high configuration.
|
protected abstract void |
removeListener() |
protected abstract void |
setListener() |
void |
valueChanged(DigitalInputEvent event) |
void |
whenActivated(Action action)
Action to perform when the device state is active.
|
void |
whenDeactivated(Action action)
Action to perform when the device state is inactive.
|
addListener, removeAllListeners, removeListener
getGpio
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getValue
public AbstractDigitalInputDevice(int gpio, boolean activeHigh)
public boolean isActiveHigh()
protected void enableDeviceListener()
enableDeviceListener
in class GpioInputDevice<DigitalInputEvent>
protected void disableDeviceListener()
disableDeviceListener
in class GpioInputDevice<DigitalInputEvent>
public void valueChanged(DigitalInputEvent event)
valueChanged
in interface InputEventListener<DigitalInputEvent>
valueChanged
in class GpioInputDevice<DigitalInputEvent>
public void whenActivated(Action action)
action
- Action callback object.public void whenDeactivated(Action action)
action
- Action callback object.protected abstract void setListener()
protected abstract void removeListener()
Copyright © 2016–2017 mattjlewis. All rights reserved.