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