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

pin GpioPin
the pin the edge occurred on
rising boolean
true for a low-to-high transition, false for high-to-low
timestampNanos long
the kernel’s monotonic timestamp of the edge, in nanoseconds; 0 when the port has no timestamp