다음을 통해 공유


BluetoothHealth.GetMainChannelFd Method

Definition

Get the file descriptor of the main channel associated with the remote device and application configuration.

[Android.Runtime.Register("getMainChannelFd", "(Landroid/bluetooth/BluetoothDevice;Landroid/bluetooth/BluetoothHealthAppConfiguration;)Landroid/os/ParcelFileDescriptor;", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.OS.ParcelFileDescriptor? GetMainChannelFd (Android.Bluetooth.BluetoothDevice? device, Android.Bluetooth.BluetoothHealthAppConfiguration? config);
[<Android.Runtime.Register("getMainChannelFd", "(Landroid/bluetooth/BluetoothDevice;Landroid/bluetooth/BluetoothHealthAppConfiguration;)Landroid/os/ParcelFileDescriptor;", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.GetMainChannelFd : Android.Bluetooth.BluetoothDevice * Android.Bluetooth.BluetoothHealthAppConfiguration -> Android.OS.ParcelFileDescriptor

Parameters

device
BluetoothDevice

The remote Bluetooth health device

config
BluetoothHealthAppConfiguration

The application configuration

Returns

null on failure, ParcelFileDescriptor on success.

Attributes

Remarks

Get the file descriptor of the main channel associated with the remote device and application configuration.

It's the responsibility of the caller to close the ParcelFileDescriptor when done.

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

Java documentation for android.bluetooth.BluetoothHealth.getMainChannelFd(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to