ReceiveCallback


interface ReceiveCallback
android.ranging.oob.TransportHandle.ReceiveCallback

TransportHandle callback.

Summary

Public methods
abstract Unit

Notifies the receiver that the TransportHandle instance can't be used anymore to receive or send data.

abstract Unit

Notifies the receiver that the TransportHandle instance can't be used to receive or send data until {@see onReconnect()} is called.

abstract Unit

Notifies and provides data received from the peer device.

abstract Unit

Notifies the receiver the TransportHandle instance can be used again to send and receive data.

abstract Unit

Called when a data send operation fails.

Public methods

onClose

abstract fun onClose(): Unit

Notifies the receiver that the TransportHandle instance can't be used anymore to receive or send data. Also call this in AutoCloseable.close().

onDisconnect

abstract fun onDisconnect(): Unit

Notifies the receiver that the TransportHandle instance can't be used to receive or send data until {@see onReconnect()} is called.

onReceiveData

abstract fun onReceiveData(data: ByteArray): Unit

Notifies and provides data received from the peer device.

Parameters
data ByteArray: the data received from the peer device. Must not be null.

onReconnect

abstract fun onReconnect(): Unit

Notifies the receiver the TransportHandle instance can be used again to send and receive data. Should only be called if {@see onDisconnect()} preceded it.

onSendFailed

abstract fun onSendFailed(): Unit

Called when a data send operation fails.