Interface GpioListener


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.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    edgeDetected(GpioPin pin, boolean rising, long timestampNanos)
    Called once per detected edge.
  • Method Details

    • edgeDetected

      void edgeDetected(GpioPin pin, boolean rising, long timestampNanos)

      Called once per detected edge.

      Parameters
      • pin: the pin the edge occurred on

      • rising: true for a low-to-high transition, false for high-to-low

      • timestampNanos: the kernel's monotonic timestamp of the edge, in nanoseconds; 0 when the port has no timestamp