C# Класс NewTOAPIA.HidDevice

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

Открытые свойства

Свойство Тип Описание
DeviceFileHandle SafeFileHandle
DevicePath string
ProductID short
VendorID short

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

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

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

Dispose ( ) : void

Dispose method

GetDevices ( ) : IEnumerable
GetVendorName ( short vendorId ) : string
HidDevice ( string devicePathName ) : System
Initialize ( string devicePathName ) : void
ToString ( ) : string

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

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

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

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

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

public static GetDevices ( ) : IEnumerable
Результат IEnumerable

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

public static GetVendorName ( short vendorId ) : string
vendorId short
Результат string

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

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

public HidDevice ( string devicePathName ) : System
devicePathName string
Результат System

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

public Initialize ( string devicePathName ) : void
devicePathName string
Результат 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

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

public ToString ( ) : string
Результат string

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

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

Описание свойств

DeviceFileHandle публичное свойство

public SafeFileHandle DeviceFileHandle
Результат SafeFileHandle

DevicePath публичное свойство

public string DevicePath
Результат string

ProductID публичное свойство

public short ProductID
Результат short

VendorID публичное свойство

public short VendorID
Результат short