Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
public interface GpioListener
Receives edge events from a GpioPin that was opened as an input with
edge detection.
Events are delivered through Hardware.deliver(Runnable) (the event dispatch
thread on a client port), in the order the kernel reported them.
Methods
public abstract void edgeDetected(GpioPin pin, boolean rising, long timestampNanos) | Called once per detected edge. |
Method details
edgeDetected
public abstract void edgeDetected(GpioPin pin, boolean rising, long timestampNanos)Called once per detected edge.
Parameters
pinGpioPin- the pin the edge occurred on
risingbooleantruefor a low-to-high transition,falsefor high-to-lowtimestampNanoslong- the kernel’s monotonic timestamp of the edge, in
nanoseconds;
0when the port has no timestamp