C# Класс LitDev.Engines.HIDDevice

Наследование: Win32Usb, IDisposable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
CreateInputReport ( ) : InputReport

Virtual method to create an input report for this device. Override to use.

Dispose ( ) : void

Dispose method

FindDevice ( int nVid, int nPid, Type oType ) : HIDDevice

Finds a device given its PID and VID

Защищенные методы

Метод Описание
Dispose ( bool bDisposing ) : void

Disposer called by both dispose and finalise

HandleDataReceived ( InputReport oInRep ) : void

virtual handler for any action to be taken when data is received. Override to use.

HandleDeviceRemoved ( ) : void

Virtual handler for any action to be taken when a device is removed. Override to use.

ReadCompleted ( IAsyncResult iResult ) : void

Callback for above. Care with this as it will be called on the background thread from the async read

Write ( OutputReport oOutRep ) : void

Write an output report to the device.

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

Метод Описание
BeginAsyncRead ( ) : void

Kicks off an asynchronous read which completes when data is read or when the device is disconnected. Uses a callback.

GetDeviceName ( ) : string
GetDevicePath ( IntPtr hInfoSet, DeviceInterfaceData &oInterface ) : string

Helper method to return the device path given a DeviceInterfaceData structure and an InfoSet handle. Used in 'FindDevice' so check that method out to see how to get an InfoSet handle and a DeviceInterfaceData.

Initialise ( string strPath ) : void

Initialises the device

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

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

Virtual method to create an input report for this device. Override to use.
public CreateInputReport ( ) : InputReport
Результат InputReport

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

Dispose method
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Disposer called by both dispose and finalise
protected Dispose ( bool bDisposing ) : void
bDisposing bool True if disposing
Результат void

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

Finds a device given its PID and VID
public static FindDevice ( int nVid, int nPid, Type oType ) : HIDDevice
nVid int Vendor id for device (VID)
nPid int Product id for device (PID)
oType System.Type Type of device class to create
Результат HIDDevice

HandleDataReceived() защищенный Метод

virtual handler for any action to be taken when data is received. Override to use.
protected HandleDataReceived ( InputReport oInRep ) : void
oInRep InputReport The input report that was received
Результат void

HandleDeviceRemoved() защищенный Метод

Virtual handler for any action to be taken when a device is removed. Override to use.
protected HandleDeviceRemoved ( ) : void
Результат void

ReadCompleted() защищенный Метод

Callback for above. Care with this as it will be called on the background thread from the async read
protected ReadCompleted ( IAsyncResult iResult ) : void
iResult IAsyncResult Async result parameter
Результат void

Write() защищенный Метод

Write an output report to the device.
protected Write ( OutputReport oOutRep ) : void
oOutRep OutputReport Output report to write
Результат void