Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

GpioCallback

public interface GpioCallback

com.google.android.things.pio.GpioCallback


GPIO interrupt callback. First call setEdgeTriggerType(int) to set an interrupt edge to watch, then registerGpioCallback(Handler, GpioCallback) to start getting callbacks.

Summary

Public methods

abstract boolean onGpioEdge(Gpio gpio)

Called when an edge event triggers.

default void onGpioError(Gpio gpio, int error)

Called when an error occurs with the interrupt event listener.

Public methods

onGpioEdge

boolean onGpioEdge (Gpio gpio)

Called when an edge event triggers.

Parameters
gpio Gpio: The Gpio that received an edge event.

Returns
boolean True to keep watching for events, false to stop.

onGpioError

void onGpioError (Gpio gpio, 
                int error)

Called when an error occurs with the interrupt event listener. At this point the receiver should assume that this Gpio is no longer usable. No further callbacks will be received on this object.

Parameters
gpio Gpio: The Gpio that received an error.

error int: An OsConstants errno code.