C# Класс 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.
Наследование: UsbDevice, IUsbInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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,

Приватные методы

Метод Описание
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

Описание методов

Close() публичный Метод

Closes the UsbDevice and disposes any UsbDevice.ActiveEndpoints.
public Close ( ) : bool
Результат bool

EndpointPolicies() публичный Метод

Gets endpoint policies for the specified endpoint id.
public EndpointPolicies ( ReadEndpointID epNum ) : PipePolicies
epNum ReadEndpointID The endpoint ID to retrieve for.
Результат PipePolicies

EndpointPolicies() публичный Метод

Gets endpoint policies for the specified endpoint id.
public EndpointPolicies ( WriteEndpointID epNum ) : PipePolicies
epNum WriteEndpointID The endpoint ID to retrieve for.
Результат PipePolicies

GetAssociatedInterface() публичный Метод

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.
Результат bool

GetCurrentAlternateSetting() публичный Метод

Gets the currently selected alternate settings number for the selected inteface.
public GetCurrentAlternateSetting ( byte &settingNumber ) : bool
settingNumber byte The selected AlternateSetting number.
Результат bool

GetDevicePathList() публичный статический Метод

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.
Результат bool

Open() публичный Метод

Opens the USB device handle.
public Open ( ) : bool
Результат bool

Open() публичный статический Метод

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.
Результат bool

QueryDeviceSpeed() публичный Метод

Gets the device speed.
public QueryDeviceSpeed ( DeviceSpeedTypes &deviceSpeed ) : bool
deviceSpeed DeviceSpeedTypes The device speed.
Результат bool

QueryInterfaceSettings() публичный Метод

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.
Результат bool