BluetoothPairingCallback
public
interface
BluetoothPairingCallback
com.google.android.things.bluetooth.BluetoothPairingCallback
|
This callback is invoked during the Bluetooth pairing process and contains all the relevant
pairing information required for pairing.
Summary
Nested classes |
class |
BluetoothPairingCallback.PairingError
|
Public methods
onPaired
void onPaired (BluetoothDevice bluetoothDevice)
Invoked when successfully paired with a device.
Parameters |
bluetoothDevice |
BluetoothDevice : remote Bluetooth device to pair with.
|
onPairingError
void onPairingError (BluetoothDevice bluetoothDevice,
BluetoothPairingCallback.PairingError error)
Invoked when pairing with a device is cancelled or fails.
Parameters |
bluetoothDevice |
BluetoothDevice : remote Bluetooth device to pair with.
|
error |
BluetoothPairingCallback.PairingError |
onPairingInitiated
void onPairingInitiated (BluetoothDevice bluetoothDevice,
PairingParams pairingParams)
Pairing callback invoked when pairing process has been initiated with a remote Bluetooth
device.
Parameters |
bluetoothDevice |
BluetoothDevice : remote Bluetooth device to pair with. |
pairingParams |
PairingParams : parameters of the pairing attempt such as type and passkey etc.
|
onUnpaired
void onUnpaired (BluetoothDevice bluetoothDevice)
Invoked when the pairing with an existing device is removed.
Parameters |
bluetoothDevice |
BluetoothDevice : remote Bluetooth device to pair with.
|
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-02-10 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-02-10 UTC."],[],[],null,["# BluetoothPairingCallback\n========================\n\n\n`\npublic\n\n\ninterface\nBluetoothPairingCallback\n`\n\n\n`\n\n\n`\n\n|--------------------------------------------------------------|\n| com.google.android.things.bluetooth.BluetoothPairingCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThis callback is invoked during the Bluetooth pairing process and contains all the relevant\npairing information required for pairing.\n\nSummary\n-------\n\n| ### Nested classes ||\n|----------|-------------------------------------------------------------------------------------------------------------------------------|\n| ` class` | [BluetoothPairingCallback.PairingError](/reference/com/google/android/things/bluetooth/BluetoothPairingCallback.PairingError) |\n\n| ### Public methods ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` default void` | ` `[onPaired](/reference/com/google/android/things/bluetooth/BluetoothPairingCallback#onPaired(android.bluetooth.BluetoothDevice))`(`[BluetoothDevice](https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html)` bluetoothDevice) ` Invoked when successfully paired with a device. |\n| ` default void` | ` `[onPairingError](/reference/com/google/android/things/bluetooth/BluetoothPairingCallback#onPairingError(android.bluetooth.BluetoothDevice, com.google.android.things.bluetooth.BluetoothPairingCallback.PairingError))`(`[BluetoothDevice](https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html)` bluetoothDevice, `[BluetoothPairingCallback.PairingError](/reference/com/google/android/things/bluetooth/BluetoothPairingCallback.PairingError)` error) ` Invoked when pairing with a device is cancelled or fails. |\n| ` default void` | ` `[onPairingInitiated](/reference/com/google/android/things/bluetooth/BluetoothPairingCallback#onPairingInitiated(android.bluetooth.BluetoothDevice, com.google.android.things.bluetooth.PairingParams))`(`[BluetoothDevice](https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html)` bluetoothDevice, `[PairingParams](/reference/com/google/android/things/bluetooth/PairingParams)` pairingParams) ` Pairing callback invoked when pairing process has been initiated with a remote Bluetooth device. |\n| ` default void` | ` `[onUnpaired](/reference/com/google/android/things/bluetooth/BluetoothPairingCallback#onUnpaired(android.bluetooth.BluetoothDevice))`(`[BluetoothDevice](https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html)` bluetoothDevice) ` Invoked when the pairing with an existing device is removed. |\n\nPublic methods\n--------------\n\n### onPaired\n\n```\nvoid onPaired (BluetoothDevice bluetoothDevice)\n```\n\nInvoked when successfully paired with a device.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------------|-----------------------------------------------------------------|\n| `bluetoothDevice` | `BluetoothDevice`: remote Bluetooth device to pair with. \u003cbr /\u003e |\n\n### onPairingError\n\n```\nvoid onPairingError (BluetoothDevice bluetoothDevice, \n BluetoothPairingCallback.PairingError error)\n```\n\nInvoked when pairing with a device is cancelled or fails.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------------|-----------------------------------------------------------------|\n| `bluetoothDevice` | `BluetoothDevice`: remote Bluetooth device to pair with. \u003cbr /\u003e |\n| `error` | `BluetoothPairingCallback.PairingError` \u003cbr /\u003e |\n\n### onPairingInitiated\n\n```\nvoid onPairingInitiated (BluetoothDevice bluetoothDevice, \n PairingParams pairingParams)\n```\n\nPairing callback invoked when pairing process has been initiated with a remote Bluetooth\ndevice.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------------|-----------------------------------------------------------------------------------------|\n| `bluetoothDevice` | `BluetoothDevice`: remote Bluetooth device to pair with. \u003cbr /\u003e |\n| `pairingParams` | `PairingParams`: parameters of the pairing attempt such as type and passkey etc. \u003cbr /\u003e |\n\n### onUnpaired\n\n```\nvoid onUnpaired (BluetoothDevice bluetoothDevice)\n```\n\nInvoked when the pairing with an existing device is removed.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------------|-----------------------------------------------------------------|\n| `bluetoothDevice` | `BluetoothDevice`: remote Bluetooth device to pair with. \u003cbr /\u003e |\n\n-\n\n Interfaces\n ----------\n\n - [BluetoothConnectionCallback](/reference/com/google/android/things/bluetooth/BluetoothConnectionCallback)\n - [BluetoothPairingCallback](/reference/com/google/android/things/bluetooth/BluetoothPairingCallback)\n-\n\n Classes\n -------\n\n - [BluetoothClassFactory](/reference/com/google/android/things/bluetooth/BluetoothClassFactory)\n - [BluetoothConfigManager](/reference/com/google/android/things/bluetooth/BluetoothConfigManager)\n - [BluetoothConnectionManager](/reference/com/google/android/things/bluetooth/BluetoothConnectionManager)\n - [BluetoothPairingCallback.PairingError](/reference/com/google/android/things/bluetooth/BluetoothPairingCallback.PairingError)\n - [BluetoothProfile](/reference/com/google/android/things/bluetooth/BluetoothProfile)\n - [BluetoothProfileManager](/reference/com/google/android/things/bluetooth/BluetoothProfileManager)\n - [ConnectionParams](/reference/com/google/android/things/bluetooth/ConnectionParams)\n - [PairingParams](/reference/com/google/android/things/bluetooth/PairingParams)"]]