public class GPIOSample
extends java.lang.Object
A GPIOSample
contains the GPIO
object that generates
the sample, its value, and the time when it was taken in milliseconds.
Use the GPIO.registerListener(IGPIOListener)
method to
subscribe your listener and receive GPIO samples.
GPIO
,
GPIOValue
,
IGPIOListener
Modifier | Constructor | Description |
---|---|---|
protected |
GPIOSample(GPIO gpio,
GPIOValue value,
long timestamp) |
Creates a GPIO sample with the given GPIO, value and timestamp.
|
Modifier and Type | Method | Description |
---|---|---|
GPIO |
getGPIO() |
Gets the GPIO object where this sample was taken.
|
long |
getTimestamp() |
Gets the time when this sample was taken.
|
GPIOValue |
getValue() |
Gets the GPIO value of this sample.
|
protected GPIOSample(GPIO gpio, GPIOValue value, long timestamp)
gpio
- The GPIO object where the sample was taken.value
- The value of the sample.timestamp
- The time in milliseconds when the GPIO was sampled.java.lang.IllegalArgumentException
- If timestamp < 0
.java.lang.NullPointerException
- If gpio == null
or
if value == null
.GPIO
,
GPIOValue.HIGH
,
GPIOValue.LOW
public GPIO getGPIO()
GPIO
public GPIOValue getValue()
GPIOValue
public long getTimestamp()