lightbulb_outline Please take our October 2018 developer survey. Start survey

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

default void onPaired(BluetoothDevice bluetoothDevice)

Invoked when successfully paired with a device.

default void onPairingError(BluetoothDevice bluetoothDevice, BluetoothPairingCallback.PairingError error)

Invoked when pairing with a device is cancelled or fails.

default void onPairingInitiated(BluetoothDevice bluetoothDevice, PairingParams pairingParams)

Pairing callback invoked when pairing process has been initiated with a remote Bluetooth device.

default void onUnpaired(BluetoothDevice bluetoothDevice)

Invoked when the pairing with an existing device is removed.

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.