共用方式為


GattDeviceService.GetDeviceSelectorFromShortId(UInt16) 方法

定義

從 16 位藍牙 GATT 服務 UUID 建立適當的 AQS 篩選字串,以搭配 CreateWatcher 方法使用。

重要

GetDeviceSelectorFromShortId API 已被取代,未來版本的 Windows 可能無法使用。 請改用 GetDeviceSelectorFromUuid

public:
 static Platform::String ^ GetDeviceSelectorFromShortId(unsigned short serviceShortId);
 static winrt::hstring GetDeviceSelectorFromShortId(uint16_t const& serviceShortId);
/// [Windows.Foundation.Metadata.Deprecated("Use GetDeviceSelectorFromUuid instead of GetDeviceSelectorFromShortId.  For more information, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
 static winrt::hstring GetDeviceSelectorFromShortId(uint16_t const& serviceShortId);
public static string GetDeviceSelectorFromShortId(ushort serviceShortId);
[Windows.Foundation.Metadata.Deprecated("Use GetDeviceSelectorFromUuid instead of GetDeviceSelectorFromShortId.  For more information, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
public static string GetDeviceSelectorFromShortId(ushort serviceShortId);
function getDeviceSelectorFromShortId(serviceShortId)
Public Shared Function GetDeviceSelectorFromShortId (serviceShortId As UShort) As String

參數

serviceShortId
UInt16

unsigned short

uint16_t

16 位藍牙 GATT 服務 UUID。

傳回

String

Platform::String

winrt::hstring

適當的 AQS 選取器字串,可當做參數傳遞至 CreateWatcher 方法,以便擷取 GATT 服務實例路徑

屬性

Windows 需求

應用程式功能
bluetooth

適用於