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.

public ref class UsbDeviceClass sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class UsbDeviceClass final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class UsbDeviceClass final
[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
[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
function UsbDeviceClass()
Public NotInheritable Class UsbDeviceClass
Inheritance
Object IInspectable 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.

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