GattDeviceService.GetCharacteristics(Guid) 方法

定义

返回由指定的 UUID 标识并属于此 GattDeviceService 实例的特征向量。

重要

GetCharacteristics API 已弃用,将来的 Windows 版本中可能不可用。 请改用 GetCharacteristicsForUuidAsync

public:
 virtual IVectorView<GattCharacteristic ^> ^ GetCharacteristics(Platform::Guid characteristicUuid) = GetCharacteristics;
IVectorView<GattCharacteristic> GetCharacteristics(winrt::guid const& characteristicUuid);
/// [Windows.Foundation.Metadata.Deprecated("Use GetCharacteristicsForUuidAsync instead of GetCharacteristics.  For more information, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
IVectorView<GattCharacteristic> GetCharacteristics(winrt::guid const& characteristicUuid);
public IReadOnlyList<GattCharacteristic> GetCharacteristics(Guid characteristicUuid);
[Windows.Foundation.Metadata.Deprecated("Use GetCharacteristicsForUuidAsync instead of GetCharacteristics.  For more information, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
public IReadOnlyList<GattCharacteristic> GetCharacteristics(Guid characteristicUuid);
function getCharacteristics(characteristicUuid)
Public Function GetCharacteristics (characteristicUuid As Guid) As IReadOnlyList(Of GattCharacteristic)

参数

characteristicUuid
Guid

Platform::Guid

winrt::guid

要检索的特征的 UUID。

返回

UUID 与特征 Uuid 匹配的 GattCharacteristic 对象的向量。

属性

Windows 要求

应用功能
bluetooth

注解

只有一个应用可以访问单个服务。 如果某个应用已注册 GATT 通知触发器,则此方法将为子随后调用此 API 的所有其他应用引发异常。

适用于