C# Class ScpControl.Usb.PnP.UsbNotifier

A modified version of the USB HID Component for C#. http://www.codeproject.com/Articles/18099/A-USB-HID-Component-for-C
Inheritance: ScpControl.Usb.PnP.Win32Usb
Exibir arquivo Open project: nefarius/ScpToolkit

Public Methods

Method Description
CheckDevicePresent ( ) : void

Checks the devices that are present at the moment and checks if one of those is the device you defined by filling in the product id and vendor id.

ParseMessages ( int msg, IntPtr wParam ) : void

This method will filter the messages that are passed for usb device change messages only. And parse them and take the appropriate action

RegisterHandle ( IntPtr handle ) : void

Registers this application, so it will be notified for usb events.

UnregisterHandle ( ) : bool

Unregisters this application, so it won't be notified for usb events.

UsbNotifier ( ) : System
UsbNotifier ( System.Guid classGuid ) : System

UsbNotifier ( ushort vid, ushort pid ) : System

UsbNotifier ( ushort vid, ushort pid, System.Guid classGuid ) : System

Private Methods

Method Description
FindDevice ( int nVid, int nPid ) : bool

Finds a device given its PID and VID

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.

Method Details

CheckDevicePresent() public method

Checks the devices that are present at the moment and checks if one of those is the device you defined by filling in the product id and vendor id.
public CheckDevicePresent ( ) : void
return void

ParseMessages() public method

This method will filter the messages that are passed for usb device change messages only. And parse them and take the appropriate action
public ParseMessages ( int msg, IntPtr wParam ) : void
msg int The window message received by the window procedure.
wParam System.IntPtr The wParam argument.
return void

RegisterHandle() public method

Registers this application, so it will be notified for usb events.
public RegisterHandle ( IntPtr handle ) : void
handle System.IntPtr a IntPtr, that is a handle to the application.
return void

UnregisterHandle() public method

Unregisters this application, so it won't be notified for usb events.
public UnregisterHandle ( ) : bool
return bool

UsbNotifier() public method

public UsbNotifier ( ) : System
return System

UsbNotifier() public method

public UsbNotifier ( System.Guid classGuid ) : System
classGuid System.Guid GUID that specifies the device interface class.
return System

UsbNotifier() public method

public UsbNotifier ( ushort vid, ushort pid ) : System
vid ushort Vendor identifier.
pid ushort Product identifier.
return System

UsbNotifier() public method

public UsbNotifier ( ushort vid, ushort pid, System.Guid classGuid ) : System
vid ushort Vendor identifier.
pid ushort Product identifier.
classGuid System.Guid GUID that specifies the device interface class.
return System