Click or drag to resize

USBDevice Class

The UsbDevice class represents a single WinUSB device.
Inheritance Hierarchy
SystemObject
  MadWizard.WinUSBNetUSBDevice

Namespace:  MadWizard.WinUSBNet
Assembly:  WinUSBNet (in WinUSBNet.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
public class USBDevice : IDisposable

The USBDevice type exposes the following members.

Constructors
  NameDescription
Public methodUSBDevice(String)
Constructs a new USB device
Public methodUSBDevice(USBDeviceInfo)
Constructs a new USB device
Top
Properties
  NameDescription
Public propertyControlPipeTimeout
Specifies the timeout in milliseconds for control pipe operations. If a control transfer does not finish within the specified time it will fail. When set to zero, no timeout is used. Default value is 5000 milliseconds.
Public propertyDescriptor
Device descriptor with information about the device
Public propertyInterfaces
Collection of all interfaces available on the USB device
Public propertyPipes
Collection of all pipes available on the USB device
Top
Methods
  NameDescription
Public methodBeginControlIn(Byte, Byte, Int32, Int32, AsyncCallback, Object)
Initiates an asynchronous control transfer without a data stage over the default control endpoint. The request should have an IN direction (specified by the highest bit of the requestType parameter). The setup packets' length member will be set to zero.
Public methodBeginControlIn(Byte, Byte, Int32, Int32, Byte, AsyncCallback, Object)
Initiates an asynchronous control transfer over the default control endpoint. The request should have an IN direction (specified by the highest bit of the requestType parameter).
Public methodBeginControlIn(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object)
Initiates an asynchronous control transfer over the default control endpoint. The request should have an IN direction (specified by the highest bit of the requestType parameter).
Public methodBeginControlOut(Byte, Byte, Int32, Int32, AsyncCallback, Object)
Initiates an asynchronous control transfer without a data stage over the default control endpoint. The request should have an OUT direction (specified by the highest bit of the requestType parameter). The setup packets' length member will be set to zero.
Public methodBeginControlOut(Byte, Byte, Int32, Int32, Byte, AsyncCallback, Object)
Initiates an asynchronous control transfer over the default control endpoint. The request should have an OUT direction (specified by the highest bit of the requestType parameter).
Public methodBeginControlOut(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object)
Initiates an asynchronous control transfer over the default control endpoint. The request should have an OUT direction (specified by the highest bit of the requestType parameter).
Public methodBeginControlTransfer(Byte, Byte, Int32, Int32, AsyncCallback, Object)
Initiates an asynchronous control transfer without a data stage over the default control endpoint. This method allows both IN and OUT direction transfers, depending on the highest bit of the requestType parameter. Alternatively, BeginControlIn(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object) and BeginControlIn(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object) can be used for asynchronous control transfers in a specific direction, which is the recommended way because it prevents using the wrong direction accidentally. Use the BeginControlTransfer method when the direction is not known at compile time.
Public methodBeginControlTransfer(Byte, Byte, Int32, Int32, Byte, AsyncCallback, Object)
Initiates an asynchronous control transfer over the default control endpoint. This method allows both IN and OUT direction transfers, depending on the highest bit of the requestType parameter. Alternatively, BeginControlIn(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object) and BeginControlIn(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object) can be used for asynchronous control transfers in a specific direction, which is the recommended way because it prevents using the wrong direction accidentally. Use the BeginControlTransfer method when the direction is not known at compile time.
Public methodBeginControlTransfer(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object)
Initiates an asynchronous control transfer over the default control endpoint. This method allows both IN and OUT direction transfers, depending on the highest bit of the requestType parameter. Alternatively, BeginControlIn(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object) and BeginControlIn(Byte, Byte, Int32, Int32, Byte, Int32, AsyncCallback, Object) can be used for asynchronous control transfers in a specific direction, which is the recommended way because it prevents using the wrong direction accidentally. Use the BeginControlTransfer method when the direction is not known at compile time.
Public methodControlIn(Byte, Byte, Int32, Int32)
Initiates a control transfer without a data stage over the default control endpoint. The request should have an IN direction (specified by the highest bit of the requestType parameter). The setup packets' length member will be set to zero.
Public methodControlIn(Byte, Byte, Int32, Int32, Byte)
Initiates a control transfer over the default control endpoint. The request should have an IN direction (specified by the highest bit of the requestType parameter). The length of buffer given by the buffer parameter will dictate the number of bytes that are transfered and the value of the setup packet's length member.
Public methodControlIn(Byte, Byte, Int32, Int32, Int32)
Initiates a control transfer over the default control endpoint. The request should have an IN direction (specified by the highest bit of the requestType parameter). A buffer to receive the data is automatically created by this method.
Public methodControlIn(Byte, Byte, Int32, Int32, Byte, Int32)
Initiates a control transfer over the default control endpoint. The request should have an IN direction (specified by the highest bit of the requestType parameter).
Public methodControlOut(Byte, Byte, Int32, Int32)
Initiates a control transfer without a data stage over the default control endpoint. The request should have an OUT direction (specified by the highest bit of the requestType parameter. The setup packets' length member will be set to zero.
Public methodControlOut(Byte, Byte, Int32, Int32, Byte)
Initiates a control transfer over the default control endpoint. The request should have an OUT direction (specified by the highest bit of the requestType parameter).
Public methodControlOut(Byte, Byte, Int32, Int32, Byte, Int32)
Initiates a control transfer over the default control endpoint. The request should have an OUT direction (specified by the highest bit of the requestType parameter).
Public methodControlTransfer(Byte, Byte, Int32, Int32)
Initiates a control transfer without a data stage over the default control endpoint. This method allows both IN and OUT direction transfers, depending on the highest bit of the requestType parameter). Alternatively, ControlIn(Byte, Byte, Int32, Int32) and ControlOut(Byte, Byte, Int32, Int32) can be used for control transfers in a specific direction, which is the recommended way because it prevents using the wrong direction accidentally. Use the ControlTransfer method when the direction is not known at compile time.
Public methodControlTransfer(Byte, Byte, Int32, Int32, Byte)
Initiates a control transfer over the default control endpoint. This method allows both IN and OUT direction transfers, depending on the highest bit of the requestType parameter). Alternatively, ControlIn(Byte, Byte, Int32, Int32, Byte) and ControlOut(Byte, Byte, Int32, Int32, Byte) can be used for control transfers in a specific direction, which is the recommended way because it prevents using the wrong direction accidentally. Use the ControlTransfer method when the direction is not known at compile time.
Public methodControlTransfer(Byte, Byte, Int32, Int32, Byte, Int32)
Initiates a control transfer over the default control endpoint. This method allows both IN and OUT direction transfers, depending on the highest bit of the requestType parameter. Alternatively, ControlIn(Byte, Byte, Int32, Int32, Byte, Int32) and ControlOut(Byte, Byte, Int32, Int32, Byte, Int32) can be used for control transfers in a specific direction, which is the recommended way because it prevents using the wrong direction accidentally. Use the ControlTransfer method when the direction is not known at compile time.
Public methodDispose
Disposes the UsbDevice including all unmanaged WinUSB handles. This function should be called when the UsbDevice object is no longer in use, otherwise unmanaged handles will remain open until the garbage collector finalizes the object.
Protected methodDispose(Boolean)
Disposes the object
Public methodEndControlTransfer
Waits for a pending asynchronous control transfer to complete.
Public methodEquals (Inherited from Object.)
Protected methodFinalize
Finalizer for the UsbDevice. Disposes all unmanaged handles.
(Overrides ObjectFinalize.)
Public methodStatic memberGetDevices(Guid)
Finds WinUSB devices with a GUID matching the parameter guid
Public methodStatic memberGetDevices(String)
Finds WinUSB devices with a GUID matching the parameter guidString
Public methodGetHashCode (Inherited from Object.)
Public methodStatic memberGetSingleDevice(Guid)
Finds the first WinUSB device with a GUID matching the parameter guid. If multiple WinUSB devices match the GUID only the first one is returned.
Public methodStatic memberGetSingleDevice(String)
Finds the first WinUSB device with a GUID matching the parameter guidString. If multiple WinUSB devices match the GUID only the first one is returned.
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top
See Also