T
- Event class that extends DeviceEvent. See
DigitalInputEvent
and
AnalogInputEvent
.public abstract class GpioInputDevice<T extends DeviceEvent> extends GpioDevice implements InputEventListener<T>
gpio
Constructor and Description |
---|
GpioInputDevice(int gpio) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(InputEventListener<T> listener)
Add a new listener.
|
protected abstract void |
disableDeviceListener() |
protected abstract void |
enableDeviceListener() |
void |
removeAllListeners()
Remove all listeners.
|
void |
removeListener(InputEventListener<T> listener)
Remove a specific listener.
|
void |
valueChanged(T event) |
getGpio
public GpioInputDevice(int gpio)
gpio
- GPIO to which the device is connected.public void addListener(InputEventListener<T> listener)
listener
- Callback instance.public void removeListener(InputEventListener<T> listener)
listener
- Callback instance to remove.public void removeAllListeners()
public void valueChanged(T event)
valueChanged
in interface InputEventListener<T extends DeviceEvent>
protected abstract void enableDeviceListener()
protected abstract void disableDeviceListener()
Copyright © 2016–2017 mattjlewis. All rights reserved.