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

UartDeviceCallback

public interface UartDeviceCallback

com.google.android.things.pio.UartDeviceCallback


UART interrupt callback.

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

Summary

Public methods

abstract boolean onUartDeviceDataAvailable(UartDevice uart)

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

default void onUartDeviceError(UartDevice uart, int error)

Called when an error occurs with the interrupt event listener.

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.