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 and Description |
|---|---|
protected |
GPIOSample(GPIO gpio,
GPIOValue value,
long timestamp)
Creates a GPIO sample with the given GPIO, value and timestamp.
|
| Modifier and Type | Method and 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.LOWpublic GPIO getGPIO()
GPIOpublic GPIOValue getValue()
GPIOValuepublic long getTimestamp()