UsbDeviceClass Class

Definition

Provides a way for the app to get an Advanced Query Syntax (AQS) string by specifying the class code, subclass code, and the protocol code defined by the device. The properties in this class are passed in the call to GetDeviceClassSelector.

C#
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class UsbDeviceClass
C#
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class UsbDeviceClass
Inheritance
Object UsbDeviceClass
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

This C# code example shows how to specify the device class and subclass codes to obtain a UsbDevice object.

C#
byte deviceClass = 0xf0;
byte deviceSubclass = 0x01;

var myDevices = await
    Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(
        Windows.Devices.Usb.UsbDevice.GetDeviceClassSelector(
            new Windows.Devices.Usb.UsbDeviceClass()
            {
                ClassCode = deviceClass,
                SubclassCode = deviceSubclass
            }));

Remarks

You can create a UsbDeviceClass object by specifying any one of the following sets of properties:

  • Class code.
  • Class and subclass codes.
  • Class, subclass, and protocol codes.

Constructors

UsbDeviceClass()

Creates a UsbDeviceClass object.

Properties

ClassCode

Gets or sets the class code of the device.

ProtocolCode

Gets or sets the protocol code of the device.

SubclassCode

Gets or sets the subclass code of the device.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100