Property | Type | Description | |
---|---|---|---|
BeginAsyncRead | void | ||
GetDevicePath | string | ||
HIDDevice | System | ||
HidD_GetProductString | bool | ||
HidD_GetSerialNumberString | bool | ||
Initialise | void |
Method | Description | |
---|---|---|
CreateInputReport ( ) : |
Virtual method to create an input report for this device. Override to use.
|
|
Dispose ( ) : void |
Dispose method
|
|
FindDevice ( int nVid, int nPid, |
Finds a device given its PID and VID
|
|
RegisterForUsbEvents ( |
||
ToString ( ) : string |
Converts all significant properties of USBDevice to human readble string
|
|
UnregisterForUsbEvents ( |
Unregisters notifications. Can be used in form dispose
|
Method | Description | |
---|---|---|
Dispose ( bool bDisposing ) : void |
Disposer called by both dispose and finalise
|
|
HandleDataReceived ( |
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 ( |
Write an output report to the device.
|
Method | Description | |
---|---|---|
BeginAsyncRead ( ) : void |
Kicks off an asynchronous read which completes when data is read or when the device is disconnected. Uses a callback.
|
|
GetDevicePath ( |
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.
|
|
HIDDevice ( uint pid, uint vid ) : System | ||
HidD_GetProductString ( |
||
HidD_GetSerialNumberString ( |
||
Initialise ( string strPath ) : void |
Initialises the device
|
protected Dispose ( bool bDisposing ) : void | ||
bDisposing | bool | True if disposing |
return | void |
public static FindDevice ( int nVid, int nPid, |
||
nVid | int | Vendor id for device (VID) |
nPid | int | Product id for device (PID) |
oType | Type of device class to create | |
return |
protected HandleDataReceived ( |
||
oInRep | The input report that was received | |
return | void |
protected ReadCompleted ( IAsyncResult iResult ) : void | ||
iResult | IAsyncResult | Async result parameter |
return | void |
public static RegisterForUsbEvents ( |
||
hWnd | ||
gClass | System.Guid | |
return |
public static UnregisterForUsbEvents ( |
||
hHandle | Handle returned from RegisterForUSBEvents | |
return | bool |
protected Write ( |
||
oOutRep | Output report to write | |
return | void |