C# Класс LibUsbDotNet.LibUsb.LibUsbDevice

Contains members that are specific to the LibUsb-Win32 driver.
Use the T:LibUsbDotNet.UsbDevice class instead to allow your code to work with either LibUsb or WinUsb.
Наследование: UsbDevice, IUsbDevice
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
ClaimInterface ( int interfaceID ) : bool

Claims the specified interface of the device.

Close ( ) : bool

Closes the UsbDevice and disposes any UsbDevice.ActiveEndpoints.

Open ( ) : bool

Opens the USB device handle.

Open ( string deviceFilename, LibUsbDevice &usbDevice ) : bool

Opens the USB device for communucation.

ReleaseAllInterfaces ( ) : int

Releases all interface claimed by ClaimInterface.

ReleaseInterface ( ) : bool

Releases the last interface claimed by ClaimInterface.

ReleaseInterface ( int interfaceID ) : bool

Releases an interface that was previously claimed with ClaimInterface.

ResetDevice ( ) : bool

Sends a usb device reset command.

After calling ResetDevice, the LibUsbDevice instance is disposed and no longer usable. A new LibUsbDevice instance must be obtained from the device list.

SetAltInterface ( int alternateID ) : bool

Sets an alternate interface for the most recent claimed interface.

SetAltInterface ( int interfaceID, int alternateID ) : bool

Sets an alternate interface for the specified interface.

SetConfiguration ( byte config ) : bool

Sets the USB devices active configuration value.

A USB device can have several different configurations, but only one active configuration.

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

Метод Описание
ControlTransferEx ( UsbSetupPacket setupPacket, IntPtr buffer, int bufferLength, int &lengthTransferred, int timeout ) : bool
LibUsbDevice ( UsbApiBase api, SafeHandle usbHandle, string deviceFilename ) : System
UsbIoSync ( int controlCode, Object inBuffer, int inSize, IntPtr outBuffer, int outSize, int &ret ) : bool

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

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

Claims the specified interface of the device.
public ClaimInterface ( int interfaceID ) : bool
interfaceID int The interface to claim.
Результат bool

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

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

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

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

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

Opens the USB device for communucation.
public static Open ( string deviceFilename, LibUsbDevice &usbDevice ) : bool
deviceFilename string The LibUsb device filename to open.
usbDevice LibUsbDevice The newly created UsbDevice.
Результат bool

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

Releases all interface claimed by ClaimInterface.
public ReleaseAllInterfaces ( ) : int
Результат int

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

Releases the last interface claimed by ClaimInterface.
public ReleaseInterface ( ) : bool
Результат bool

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

Releases an interface that was previously claimed with ClaimInterface.
public ReleaseInterface ( int interfaceID ) : bool
interfaceID int The interface to release.
Результат bool

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

Sends a usb device reset command.
After calling ResetDevice, the LibUsbDevice instance is disposed and no longer usable. A new LibUsbDevice instance must be obtained from the device list.
public ResetDevice ( ) : bool
Результат bool

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

Sets an alternate interface for the most recent claimed interface.
public SetAltInterface ( int alternateID ) : bool
alternateID int The alternate interface to select for the most recent claimed interface See .
Результат bool

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

Sets an alternate interface for the specified interface.
public SetAltInterface ( int interfaceID, int alternateID ) : bool
interfaceID int The interface index to specify an alternate setting for.
alternateID int The alternate interface setting.
Результат bool

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

Sets the USB devices active configuration value.
A USB device can have several different configurations, but only one active configuration.
public SetConfiguration ( byte config ) : bool
config byte The active configuration value. A zero value means the device is not configured and a non-zero value indicates the device is configured.
Результат bool