共用方式為


GattDeviceService.FromIdAsync 方法

定義

多載

FromIdAsync(String, GattSharingMode)

從裝置識別碼具現化新的 GattDeviceService 物件。

FromIdAsync(String)

從裝置識別碼具現化新的 GattDeviceService。

FromIdAsync(String, GattSharingMode)

從裝置識別碼具現化新的 GattDeviceService 物件。

public:
 static IAsyncOperation<GattDeviceService ^> ^ FromIdAsync(Platform::String ^ deviceId, GattSharingMode sharingMode);
/// [Windows.Foundation.Metadata.Overload("FromIdWithSharingModeAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<GattDeviceService> FromIdAsync(winrt::hstring const& deviceId, GattSharingMode const& sharingMode);
[Windows.Foundation.Metadata.Overload("FromIdWithSharingModeAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<GattDeviceService> FromIdAsync(string deviceId, GattSharingMode sharingMode);
function fromIdAsync(deviceId, sharingMode)
Public Shared Function FromIdAsync (deviceId As String, sharingMode As GattSharingMode) As IAsyncOperation(Of GattDeviceService)

參數

deviceId
String

Platform::String

winrt::hstring

GATT 裝置識別碼。

sharingMode
GattSharingMode

GATT 裝置的共用模式。

傳回

使用 GattDeviceService 物件完成的非同步作業。

屬性

Windows 需求

裝置系列
Windows 10 Creators Update (已於 10.0.15063.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v4.0 引進)
應用程式功能
bluetooth

適用於

FromIdAsync(String)

從裝置識別碼具現化新的 GattDeviceService。

public:
 static IAsyncOperation<GattDeviceService ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<GattDeviceService> FromIdAsync(winrt::hstring const& deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
/// [Windows.Foundation.Metadata.Overload("FromIdAsync")]
 static IAsyncOperation<GattDeviceService> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<GattDeviceService> FromIdAsync(string deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
[Windows.Foundation.Metadata.Overload("FromIdAsync")]
public static IAsyncOperation<GattDeviceService> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of GattDeviceService)

參數

deviceId
String

Platform::String

winrt::hstring

GATT 裝置識別碼。

傳回

用來管理非同步作業的物件,完成時會傳回新具現化的 GattDeviceService。

屬性

Windows 需求

應用程式功能
bluetooth

備註

第一次由市集應用程式叫用此方法時,應該從 UI 執行緒呼叫此方法,以顯示同意提示。 在使用者授與同意之後,即可從任何應用程式執行緒叫用 方法。

如果市集應用程式未宣告正確的功能,或使用者未授與同意,此方法會傳回 null 物件。

適用於