语言

BluetoothGatt.GetService(UUID) 方法

定义

如果远程设备支持所请求的 UUID,则返回 a BluetoothGattService。

[Android.Runtime.Register("getService", "(Ljava/util/UUID;)Landroid/bluetooth/BluetoothGattService;", "")]
public Android.Bluetooth.BluetoothGattService? GetService(Java.Util.UUID? uuid);
[<Android.Runtime.Register("getService", "(Ljava/util/UUID;)Landroid/bluetooth/BluetoothGattService;", "")>]
member this.GetService : Java.Util.UUID -> Android.Bluetooth.BluetoothGattService

参数

uuid
UUID

所请求服务的 UUID

返回

如果支持蓝牙GattService,则为 null;如果远程设备未提供所请求的服务,则为 null。

特性

注解

如果远程设备支持所请求的 UUID,则返回 a BluetoothGattService。

此函数要求为给定设备完成服务发现。

如果存在同一服务的多个实例(由 UUID 标识),则返回服务的第一个实例。

Java文档android.bluetooth.BluetoothGatt.getService(java.util.UUID)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于