Stay organized with collections
Save and categorize content based on your preferences.
TransportHandle.ReceiveCallback
public
static
interface
TransportHandle.ReceiveCallback
android.ranging.oob.TransportHandle.ReceiveCallback
|
TransportHandle callback.
Summary
Public methods |
abstract
void
|
onClose()
Notifies the receiver that the TransportHandle instance can't be used anymore to receive
or send data.
|
abstract
void
|
onDisconnect()
Notifies the receiver that the TransportHandle instance can't be used to receive or send
data until is called.
|
abstract
void
|
onReceiveData(byte[] data)
Notifies and provides data received from the peer device.
|
abstract
void
|
onReconnect()
Notifies the receiver the TransportHandle instance can be used again to send and receive
data.
|
abstract
void
|
onSendFailed()
Called when a data send operation fails.
|
Public methods
onClose
public abstract void onClose ()
Notifies the receiver that the TransportHandle instance can't be used anymore to receive
or send data. Also call this in AutoCloseable.close()
.
onDisconnect
public abstract void onDisconnect ()
Notifies the receiver that the TransportHandle instance can't be used to receive or send
data until is called.
onReceiveData
public abstract void onReceiveData (byte[] data)
Notifies and provides data received from the peer device.
Parameters |
data |
byte : the data received from the peer device. Must not be null. |
onReconnect
public abstract void onReconnect ()
Notifies the receiver the TransportHandle instance can be used again to send and receive
data. Should only be called if preceded it.
onSendFailed
public abstract void onSendFailed ()
Called when a data send operation fails.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-13 UTC."],[],[],null,["# TransportHandle.ReceiveCallback\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nTransportHandle.ReceiveCallback\n===============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/ranging/oob/TransportHandle.ReceiveCallback \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nTransportHandle.ReceiveCallback\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------------|\n| android.ranging.oob.TransportHandle.ReceiveCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nTransportHandle callback.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onClose](/reference/android/ranging/oob/TransportHandle.ReceiveCallback#onClose())`() ` Notifies the receiver that the TransportHandle instance can't be used anymore to receive or send data. |\n| ` abstract void` | ` `[onDisconnect](/reference/android/ranging/oob/TransportHandle.ReceiveCallback#onDisconnect())`() ` Notifies the receiver that the TransportHandle instance can't be used to receive or send data until is called. |\n| ` abstract void` | ` `[onReceiveData](/reference/android/ranging/oob/TransportHandle.ReceiveCallback#onReceiveData(byte[]))`(byte[] data) ` Notifies and provides data received from the peer device. |\n| ` abstract void` | ` `[onReconnect](/reference/android/ranging/oob/TransportHandle.ReceiveCallback#onReconnect())`() ` Notifies the receiver the TransportHandle instance can be used again to send and receive data. |\n| ` abstract void` | ` `[onSendFailed](/reference/android/ranging/oob/TransportHandle.ReceiveCallback#onSendFailed())`() ` Called when a data send operation fails. |\n\nPublic methods\n--------------\n\n### onClose\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onClose ()\n```\n\nNotifies the receiver that the TransportHandle instance can't be used anymore to receive\nor send data. Also call this in [AutoCloseable.close()](/reference/java/lang/AutoCloseable#close()).\n\n\u003cbr /\u003e\n\n### onDisconnect\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onDisconnect ()\n```\n\nNotifies the receiver that the TransportHandle instance can't be used to receive or send\ndata until is called.\n\n\u003cbr /\u003e\n\n**See also:**\n\n- [ERROR(/onReconnect())](/) \n\n### onReceiveData\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onReceiveData (byte[] data)\n```\n\nNotifies and provides data received from the peer device.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|--------------------------------------------------------------------------|\n| `data` | `byte`: the data received from the peer device. Must not be null. \u003cbr /\u003e |\n\n### onReconnect\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onReconnect ()\n```\n\nNotifies the receiver the TransportHandle instance can be used again to send and receive\ndata. Should only be called if preceded it.\n\n\u003cbr /\u003e\n\n**See also:**\n\n- [ERROR(/onDisconnect())](/) \n\n### onSendFailed\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onSendFailed ()\n```\n\nCalled when a data send operation fails.\n\n\u003cbr /\u003e"]]