共用方式為


BluetoothLEDevice.GetGattService(Guid) 方法

定義

傳回具有指定服務識別碼的 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 服務的服務識別碼。

傳回

以指定服務識別碼表示的 GATT 服務。

屬性

Windows 需求

應用程式功能
bluetooth

適用於