語言

BluetoothGattService.GetCharacteristic(UUID) 方法

定義

從服務提供的特徵列表中回傳具有特定 UUID 的特徵。

[Android.Runtime.Register("getCharacteristic", "(Ljava/util/UUID;)Landroid/bluetooth/BluetoothGattCharacteristic;", "GetGetCharacteristic_Ljava_util_UUID_Handler")]
public virtual Android.Bluetooth.BluetoothGattCharacteristic? GetCharacteristic(Java.Util.UUID? uuid);
[<Android.Runtime.Register("getCharacteristic", "(Ljava/util/UUID;)Landroid/bluetooth/BluetoothGattCharacteristic;", "GetGetCharacteristic_Ljava_util_UUID_Handler")>]
abstract member GetCharacteristic : Java.Util.UUID -> Android.Bluetooth.BluetoothGattCharacteristic
override this.GetCharacteristic : Java.Util.UUID -> Android.Bluetooth.BluetoothGattCharacteristic

參數

uuid
UUID

傳回

GATT 特徵物件或空,若未找到符合該 UUID 的特徵。

屬性

備註

從服務提供的特徵列表中回傳具有特定 UUID 的特徵。

這是一個方便的函式,允許存取特定特徵,而不必手動列舉回傳的清單 #getCharacteristics 。

若遠端服務提供多個特徵且具有相同 UUID,則會回傳與該 UUID 特徵的第一個實例。

Java 文件 android.bluetooth.BluetoothGattService.getCharacteristic(java.util.UUID)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於