GattDescriptor 类

定义

表示 GATT 特征的描述符。 GattDescriptor 对象表示特定特征的 GATT 描述符,可从 GattCharacteristic 对象的描述符属性获取。

public ref class GattDescriptor sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class GattDescriptor final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class GattDescriptor final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class GattDescriptor
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class GattDescriptor
Public NotInheritable Class GattDescriptor
继承
Object Platform::Object IInspectable GattDescriptor
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)
应用功能
bluetooth

注解

版本历史记录

Windows 版本 SDK 版本 已添加值
1703 15063 WriteValueWithResultAsync

属性

AttributeHandle

获取用于在 GATT 服务器设备上唯一标识此属性的 GATT 属性句柄。

ProtectionLevel

获取或设置与设备的无线通信所需的 GATT 安全选项。

在配对过程中,Windows 将与设备协商可能的最大安全性,并且指定较低的安全级别不会降低现有安全级别。

Uuid

获取此 GattDescriptor 的 GATT 描述符 UUID。

方法

ConvertShortIdToUuid(UInt16)

将蓝牙 SIG 定义的短 ID 转换为完整的 GATT UUID。

重要

ConvertShortIdToUuid API 已弃用,将来的 Windows 版本中可能不可用。 请改用 BluetoothUuidHelper.FromShortId

ReadValueAsync()

执行从 Windows 维护的值缓存中读取的描述符值。

ReadValueAsync(BluetoothCacheMode)

从 Windows 维护的值缓存中读取或直接从设备读取描述符值。

WriteValueAsync(IBuffer)

对蓝牙 LE 设备执行描述符值写入。

WriteValueWithResultAsync(IBuffer)

对蓝牙 LE 设备执行描述符值写入。

适用于