public class SysFsDigitalInputOutputDevice extends AbstractInputDevice<DigitalInputEvent> implements GpioDigitalInputOutputDeviceInterface, PollEventListener
Modifier and Type | Field and Description |
---|---|
protected int |
gpio |
protected DeviceMode |
mode |
Constructor and Description |
---|
SysFsDigitalInputOutputDevice(SysFsDeviceFactory deviceFactory,
String key,
PinInfo pinInfo,
DeviceMode mode) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeDevice() |
protected void |
disableListener() |
protected void |
enableListener() |
int |
getGpio() |
DeviceMode |
getMode() |
boolean |
getValue() |
void |
notify(long epochTime,
long nanoTime,
char value) |
void |
setMode(DeviceMode mode) |
void |
setValue(boolean value) |
generatesEvents, removeListener, setListener, valueChanged
close, getDeviceFactory, getKey, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
removeListener, setListener
close, getKey, isOpen
protected int gpio
protected DeviceMode mode
public SysFsDigitalInputOutputDevice(SysFsDeviceFactory deviceFactory, String key, PinInfo pinInfo, DeviceMode mode)
public DeviceMode getMode()
getMode
in interface GpioDeviceInterface
getMode
in interface GpioDigitalOutputDeviceInterface
public void setMode(DeviceMode mode)
setMode
in interface GpioDigitalInputOutputDeviceInterface
public int getGpio()
getGpio
in interface GpioDeviceInterface
public boolean getValue() throws RuntimeIOException
getValue
in interface GpioDigitalDeviceInterface
RuntimeIOException
public void setValue(boolean value) throws RuntimeIOException
setValue
in interface GpioDigitalOutputDeviceInterface
RuntimeIOException
protected void enableListener()
enableListener
in class AbstractInputDevice<DigitalInputEvent>
protected void disableListener()
disableListener
in class AbstractInputDevice<DigitalInputEvent>
protected void closeDevice() throws RuntimeIOException
closeDevice
in class AbstractDevice
RuntimeIOException
public void notify(long epochTime, long nanoTime, char value)
notify
in interface PollEventListener
Copyright © 2016–2018 mattjlewis. All rights reserved.