Share via


BluetoothDevice.GetDeviceSelectorFromClassOfDevice Method

Definition

Creates an Advanced Query Syntax (AQS) filter string from a BluetoothClassOfDevice object. The AQS string is passed into the CreateWatcher method to return a collection of DeviceInformation objects.

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

Parameters

classOfDevice
BluetoothClassOfDevice

The class of device used for constructing the AQS string.

Returns

String

Platform::String

winrt::hstring

An AQS string that can be passed as a parameter to the CreateWatcher method.

Windows requirements

Device family
Windows 10 (introduced in 10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v2.0)
App capabilities
bluetooth

Remarks

Each section of the classOfDevice parameter is optional. However, if the minor class of device is set, then the major class of device must also be set. The following are behaviors related what is set.

  • If no major/minor class of device is set, all devices matching the supplied service capabilities will be returned.
  • If no minor class of device is set, all devices matching the major class of devices AND the supplied service capabilities will be returned.
  • If service capabilities are set, all devices that match at LEAST the supplied service capabilities AND the major/minor class of device will be returned.
  • If no service capabilities are set, all devices that match the major/minor class of device will be returned.
  • If no major/minor class of device is set AND no service capabilities are set, all devices will be returned. This AQS Filter string will request an inquiry to be issued.

Applies to