Skip to content

Most visited

Recently visited

navigation

UartDeviceCallback

UartDeviceCallback

public abstract class UartDeviceCallback
extends Object

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


UART interrupt callback. Call registerUartDeviceCallback(UartDeviceCallback, Handler) to start getting callbacks.

Summary

Public constructors

UartDeviceCallback()

Public methods

boolean onUartDeviceDataAvailable(UartDevice uart)

Called when data is ready to be read from the UART.

void onUartDeviceError(UartDevice uart, int error)

Called when an error occurs with the interrupt event listener.

Inherited methods

From class java.lang.Object

Public constructors

UartDeviceCallback

UartDeviceCallback ()

Public methods

onUartDeviceDataAvailable

boolean onUartDeviceDataAvailable (UartDevice uart)

Called when data is ready to be read from the UART.

Parameters
uart UartDevice: The UartDevice that has data ready.
Returns
boolean True to keep watching for events, false to stop.

onUartDeviceError

void onUartDeviceError (UartDevice uart, 
                int error)

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

Parameters
uart UartDevice: The UartDevice 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.