C# Class NewTOAPIA.HidDevice

Inheritance: IDisposable
Afficher le fichier Open project: Wiladams/NewTOAPIA Class Usage Examples

Méthodes publiques

Свойство Type Description
DeviceFileHandle SafeFileHandle
DevicePath string
ProductID short
VendorID short

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
BeginAsyncRead ( ) : void

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

Method Details

CreateInputReport() public méthode

Virtual method to create an input report for this device. Override to use.
public CreateInputReport ( ) : InputReport
Résultat InputReport

Dispose() public méthode

Dispose method
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Disposer called by both dispose and finalise
protected Dispose ( bool bDisposing ) : void
bDisposing bool True if disposing
Résultat void

GetDevices() public static méthode

public static GetDevices ( ) : IEnumerable
Résultat IEnumerable

GetVendorName() public static méthode

public static GetVendorName ( short vendorId ) : string
vendorId short
Résultat string

HandleDataReceived() protected méthode

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
Résultat void

HandleDeviceRemoved() protected méthode

Virtual handler for any action to be taken when a device is removed. Override to use.
protected HandleDeviceRemoved ( ) : void
Résultat void

HidDevice() public méthode

public HidDevice ( string devicePathName ) : System
devicePathName string
Résultat System

Initialize() public méthode

public Initialize ( string devicePathName ) : void
devicePathName string
Résultat void

ReadCompleted() protected méthode

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
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string

Write() protected méthode

Write an output report to the device.
protected Write ( OutputReport oOutRep ) : void
oOutRep OutputReport Output report to write
Résultat void

Property Details

DeviceFileHandle public_oe property

public SafeFileHandle DeviceFileHandle
Résultat SafeFileHandle

DevicePath public_oe property

public string DevicePath
Résultat string

ProductID public_oe property

public short ProductID
Résultat short

VendorID public_oe property

public short VendorID
Résultat short