UsbDeviceClass UsbDeviceClass UsbDeviceClass UsbDeviceClass Class

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(Windows.Devices.Usb.UsbDeviceClass).

Syntax

Declaration

public sealed class UsbDeviceClasspublic sealed class UsbDeviceClassPublic NotInheritable Class UsbDeviceClass

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.

This 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(
                          UsbDevice.GetDeviceClassSelector(
                          new UsbDeviceClass() {
                          Class = deviceClass, Subclass = deviceSubclass }));

Constructors summary

Creates a UsbDeviceClass object.

Properties summary

Gets or sets the class code of the device.

Gets or sets the protocol code of the device.

Gets or sets the subclass code of the device.

Constructors

  • UsbDeviceClass()
    UsbDeviceClass()
    UsbDeviceClass()
    UsbDeviceClass()

    Creates a UsbDeviceClass object.

    public UsbDeviceClass()public UsbDeviceClass()Public Function UsbDeviceClass() As

Properties

  • ClassCode
    ClassCode
    ClassCode
    ClassCode

    Gets or sets the class code of the device.

    public byte ClassCode { get; set; }public byte ClassCode { get; set; }Public ReadWrite Property ClassCode As byte

    Property Value

    • byte
      byte
      byte
      byte

      The device class code.

  • ProtocolCode
    ProtocolCode
    ProtocolCode
    ProtocolCode

    Gets or sets the protocol code of the device.

    public IReference<byte> ProtocolCode { get; set; }public IReference<byte> ProtocolCode { get; set; }Public ReadWrite Property ProtocolCode As IReference<byte>

    Property Value

    • The protocol code of the device.

    Remarks

    You can set the ProtocolCode value only when SubclassCode value is set to a non-null value.

  • SubclassCode
    SubclassCode
    SubclassCode
    SubclassCode

    Gets or sets the subclass code of the device.

    public IReference<byte> SubclassCode { get; set; }public IReference<byte> SubclassCode { get; set; }Public ReadWrite Property SubclassCode As IReference<byte>

    Property Value

    • The subclass code of the device.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Devices.Usb.dll