C# Class LibUsbDotNet.WinUsb.WinUsbDevice

Contains members specific to Microsofts WinUSB driver.
A WinUsbDevice should be thought of as a part of, or an interface of a USB device. The WinUsbDevice class does not have members for selecting configurations and intefaces. This is done at a lower level by the winusb driver depending on which interface the WinUsbDevice belongs to.
Inheritance: UsbDevice, IUsbInterface
Afficher le fichier Open project: arvydas/BlinkStickDotNet Class Usage Examples

Méthodes publiques

Méthode Description
Close ( ) : bool

Closes the UsbDevice and disposes any UsbDevice.ActiveEndpoints.

EndpointPolicies ( ReadEndpointID epNum ) : PipePolicies

Gets endpoint policies for the specified endpoint id.

EndpointPolicies ( WriteEndpointID epNum ) : PipePolicies

Gets endpoint policies for the specified endpoint id.

GetAssociatedInterface ( byte associatedInterfaceIndex, WinUsbDevice &usbDevice ) : bool

Gets an interface associated with this WinUsbDevice.

GetCurrentAlternateSetting ( byte &settingNumber ) : bool

Gets the currently selected alternate settings number for the selected inteface.

GetDevicePathList ( System.Guid interfaceGuid, List &devicePathList ) : bool

Gets a list a valid, connected WinUSB device inteface paths for the a given WinUSB device interface guid.

Open ( ) : bool

Opens the USB device handle.

Open ( string devicePath, WinUsbDevice &usbDevice ) : bool

Opens a WinUsb directly from the user supplied device path.

QueryDeviceSpeed ( DeviceSpeedTypes &deviceSpeed ) : bool

Gets the device speed.

QueryInterfaceSettings ( byte alternateInterfaceNumber, UsbInterfaceDescriptor &usbAltInterfaceDescriptor ) : bool

Gets a UsbInterfaceDescriptor for the specified AlternateInterfaceNumber,

Private Methods

Méthode Description
GetPowerPolicy ( PowerPolicyType policyType, int &valueLength, IntPtr pBuffer ) : bool
SetPowerPolicy ( PowerPolicyType policyType, int valueLength, IntPtr pBuffer ) : bool
WinUsbDevice ( UsbApiBase usbApi, SafeFileHandle usbHandle, SafeHandle handle, string devicePath ) : System

Method Details

Close() public méthode

Closes the UsbDevice and disposes any UsbDevice.ActiveEndpoints.
public Close ( ) : bool
Résultat bool

EndpointPolicies() public méthode

Gets endpoint policies for the specified endpoint id.
public EndpointPolicies ( ReadEndpointID epNum ) : PipePolicies
epNum ReadEndpointID The endpoint ID to retrieve for.
Résultat PipePolicies

EndpointPolicies() public méthode

Gets endpoint policies for the specified endpoint id.
public EndpointPolicies ( WriteEndpointID epNum ) : PipePolicies
epNum WriteEndpointID The endpoint ID to retrieve for.
Résultat PipePolicies

GetAssociatedInterface() public méthode

Gets an interface associated with this WinUsbDevice.
public GetAssociatedInterface ( byte associatedInterfaceIndex, WinUsbDevice &usbDevice ) : bool
associatedInterfaceIndex byte The index to retrieve. (0 = next interface, 1= interface after next, etc.).
usbDevice WinUsbDevice A new class for the specified AssociatedInterfaceIndex.
Résultat bool

GetCurrentAlternateSetting() public méthode

Gets the currently selected alternate settings number for the selected inteface.
public GetCurrentAlternateSetting ( byte &settingNumber ) : bool
settingNumber byte The selected AlternateSetting number.
Résultat bool

GetDevicePathList() public static méthode

Gets a list a valid, connected WinUSB device inteface paths for the a given WinUSB device interface guid.
public static GetDevicePathList ( System.Guid interfaceGuid, List &devicePathList ) : bool
interfaceGuid System.Guid A WinUSB DeviceInterfaceGUID. This is set in the usb devices inf file when the drivers for it are installed.
devicePathList List A list of connected WinUSB device inteface paths.
Résultat bool

Open() public méthode

Opens the USB device handle.
public Open ( ) : bool
Résultat bool

Open() public static méthode

Opens a WinUsb directly from the user supplied device path.
public static Open ( string devicePath, WinUsbDevice &usbDevice ) : bool
devicePath string Device path (symbolic link) of the WinUsb device to open.
usbDevice WinUsbDevice Returns an opened WinUsb device on success, null on failure.
Résultat bool

QueryDeviceSpeed() public méthode

Gets the device speed.
public QueryDeviceSpeed ( DeviceSpeedTypes &deviceSpeed ) : bool
deviceSpeed DeviceSpeedTypes The device speed.
Résultat bool

QueryInterfaceSettings() public méthode

Gets a UsbInterfaceDescriptor for the specified AlternateInterfaceNumber,
public QueryInterfaceSettings ( byte alternateInterfaceNumber, UsbInterfaceDescriptor &usbAltInterfaceDescriptor ) : bool
alternateInterfaceNumber byte The alternate interface index for the to retrieve.
usbAltInterfaceDescriptor LibUsbDotNet.Descriptors.UsbInterfaceDescriptor The for the specified AlternateInterfaceNumber.
Résultat bool