BluetoothLEDevice.GetGattService(Guid) 方法

定义

返回具有给定服务 ID 的 GATT 服务。

重要

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

public:
 virtual GattDeviceService ^ GetGattService(Platform::Guid serviceUuid) = GetGattService;
GattDeviceService GetGattService(winrt::guid const& serviceUuid);
/// [Windows.Foundation.Metadata.Deprecated("Use GetGattServicesForUuidAsync instead of GetGattService.  For more information, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
GattDeviceService GetGattService(winrt::guid const& serviceUuid);
public GattDeviceService GetGattService(Guid serviceUuid);
[Windows.Foundation.Metadata.Deprecated("Use GetGattServicesForUuidAsync instead of GetGattService.  For more information, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
public GattDeviceService GetGattService(Guid serviceUuid);
function getGattService(serviceUuid)
Public Function GetGattService (serviceUuid As Guid) As GattDeviceService

参数

serviceUuid
Guid

Platform::Guid

winrt::guid

GATT 服务的服务 ID。

返回

由给定服务 ID 表示的 GATT 服务。

属性

Windows 要求

应用功能
bluetooth

适用于