Skip to content

Most visited

Recently visited

navigation

GpioCallback

GpioCallback

public abstract class GpioCallback
extends Object

java.lang.Object
   ↳ com.google.android.things.pio.GpioCallback


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

Summary

Public constructors

GpioCallback()

Public methods

boolean onGpioEdge(Gpio gpio)

Called when an edge event triggers.

void onGpioError(Gpio gpio, int error)

Called when an error occurs with the interrupt event listener.

Inherited methods

From class java.lang.Object

Public constructors

GpioCallback

GpioCallback ()

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.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.