Added in API level 14
Deprecated in API level 29

BluetoothHealthCallback


abstract class BluetoothHealthCallback

This abstract class is used to implement BluetoothHealth callbacks.

Summary

Public constructors

Public methods
open Unit

Callback to inform change in registration state of the health application.

open Unit
onHealthChannelStateChange(config: BluetoothHealthAppConfiguration!, device: BluetoothDevice!, prevState: Int, newState: Int, fd: ParcelFileDescriptor!, channelId: Int)

Callback to inform change in channel state.

Public constructors

BluetoothHealthCallback

Added in API level 14
BluetoothHealthCallback()

Public methods

onHealthAppConfigurationStatusChange

Added in API level 14
open fun onHealthAppConfigurationStatusChange(
    config: BluetoothHealthAppConfiguration!,
    status: Int
): Unit

Deprecated: Health Device Profile (HDP) and MCAP protocol are no longer used. New apps should use Bluetooth Low Energy based solutions such as BluetoothGatt, android.bluetooth.BluetoothAdapter#listenUsingL2capChannel(), or android.bluetooth.BluetoothDevice#createL2capChannel(int)

Callback to inform change in registration state of the health application.

This callback is called on the binder thread (not on the UI thread)

onHealthChannelStateChange

Added in API level 14
open fun onHealthChannelStateChange(
    config: BluetoothHealthAppConfiguration!,
    device: BluetoothDevice!,
    prevState: Int,
    newState: Int,
    fd: ParcelFileDescriptor!,
    channelId: Int
): Unit

Deprecated: Health Device Profile (HDP) and MCAP protocol are no longer used. New apps should use Bluetooth Low Energy based solutions such as BluetoothGatt, android.bluetooth.BluetoothAdapter#listenUsingL2capChannel(), or android.bluetooth.BluetoothDevice#createL2capChannel(int)

Callback to inform change in channel state.

It's the responsibility of the implementer of this callback to close the parcel file descriptor when done. This callback is called on the Binder thread (not the UI thread)

Parameters
config BluetoothHealthAppConfiguration!: The Health app configuration
device BluetoothDevice!: The Bluetooth Device
prevState Int: The previous state of the channel
newState Int: The new state of the channel.
fd ParcelFileDescriptor!: The Parcel File Descriptor when the channel state is connected.
channelId Int: The id associated with the channel. This id will be used in future calls like when disconnecting the channel.