語言

BluetoothDevice.GetDeviceSelectorFromClassOfDevice 方法

定義

從 BluetoothClassOfDevice 物件建立進階查詢語法(AQS)過濾字串。 AQS 字串會被傳遞到 CreateWatcher 方法,以回傳一組 DeviceInformation 物件。

public:
 static Platform::String ^ GetDeviceSelectorFromClassOfDevice(BluetoothClassOfDevice ^ classOfDevice);
 static winrt::hstring GetDeviceSelectorFromClassOfDevice(BluetoothClassOfDevice const& classOfDevice);
public static string GetDeviceSelectorFromClassOfDevice(BluetoothClassOfDevice classOfDevice);
function getDeviceSelectorFromClassOfDevice(classOfDevice)
Public Shared Function GetDeviceSelectorFromClassOfDevice (classOfDevice As BluetoothClassOfDevice) As String

參數

classOfDevice
BluetoothClassOfDevice

用於構建 AQS 字串的裝置類別。

傳回

String

Platform::String

winrt::hstring

一個可以作為參數傳遞給 CreateWatcher 方法的 AQS 字串。

Windows 需求

規格需求 Description
裝置系列
Windows 10 (已於 10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v2.0 引進)
應用程式功能
bluetooth

備註

classOfDevice 參數的每個區段都是可選的。 然而,如果裝置的次要類別已設定,那麼主要類別的裝置也必須被設定。 以下是與設定內容相關的行為。

  • 若未設定主要或次要類別的裝置,所有符合所提供服務能力的裝置都會被回傳。
  • 若未設定次要類別裝置,所有符合主要類別且具備服務能力的裝置都會回傳。
  • 若設定服務能力,所有至少符合所提供服務能力且主要/次要類別的裝置都會被退回。
  • 若未設定服務能力,所有符合主要/次要裝置類別的裝置都會被回傳。
  • 若未設定主要或次要類別的裝置,且未設定服務能力,所有裝置都會被退還。 此 AQS 過濾字串將請求發出查詢。

適用於