C# Class LDHID, LitDev

Afficher le fichier Open project: litdev1/LitDev Class Usage Examples

Méthodes publiques

Méthode Description
AddDevice ( Primitive, VID, Primitive, PID, Primitive, name ) : Primitive,

Add a HID connected device from its VID and PID. The VID and PID are 4 character (hex) values, and can be found from: Device Manager->Properties->Details->Hardware ids For example: HID\VID_046D PID_C215 REV_0204 has VID "046D" and PID "C215". Only add a device once.

FindDevices ( ) : Primitive,

List all found HID (Human Interface Devices).

GetBits ( Primitive, data ) : Primitive,

Get an 8 element array of 1s and 0s indicating which bit of a byte are set.

InputLength ( Primitive, name ) : Primitive,

Get the input record length for a HID device.

Output ( Primitive, name, Primitive, data ) : Primitive,

Send data to the HID device. This must be an array of bytes (0 to 255). The array must be indexed from 1 and have size OutputLength.

OutputLength ( Primitive, name ) : Primitive,

Get the output record length for a HID device.

SetBits ( Primitive, data ) : Primitive,

Set a byte from an 8 element array of 1s and 0s indicating which bit of a byte are set.

Private Methods

Méthode Description
CreateDevice ( string VID, string PID, string name ) : bool
DeviceExists ( int VID, int PID, string name ) : bool
FindAllDevices ( ) : List>
GetDevice ( string name ) : HID_Device
_OnDeviceChanged ( object sender, HIDChangedEventArgs args ) : void
_OnDeviceRemoved ( object sender, EventArgs, args ) : void

Method Details

AddDevice() public static méthode

Add a HID connected device from its VID and PID. The VID and PID are 4 character (hex) values, and can be found from: Device Manager->Properties->Details->Hardware ids For example: HID\VID_046D PID_C215 REV_0204 has VID "046D" and PID "C215". Only add a device once.
public static AddDevice ( Primitive, VID, Primitive, PID, Primitive, name ) : Primitive,
VID Primitive, The device VID.
PID Primitive, The device PID.
name Primitive, A name for the device.
Résultat Primitive,

FindDevices() public static méthode

List all found HID (Human Interface Devices).
public static FindDevices ( ) : Primitive,
Résultat Primitive,

GetBits() public static méthode

Get an 8 element array of 1s and 0s indicating which bit of a byte are set.
public static GetBits ( Primitive, data ) : Primitive,
data Primitive, A byte number (0 to 255).
Résultat Primitive,

InputLength() public static méthode

Get the input record length for a HID device.
public static InputLength ( Primitive, name ) : Primitive,
name Primitive, The device name.
Résultat Primitive,

Output() public static méthode

Send data to the HID device. This must be an array of bytes (0 to 255). The array must be indexed from 1 and have size OutputLength.
public static Output ( Primitive, name, Primitive, data ) : Primitive,
name Primitive, The HID device name.
data Primitive, The data to send.
Résultat Primitive,

OutputLength() public static méthode

Get the output record length for a HID device.
public static OutputLength ( Primitive, name ) : Primitive,
name Primitive, The HID device name.
Résultat Primitive,

SetBits() public static méthode

Set a byte from an 8 element array of 1s and 0s indicating which bit of a byte are set.
public static SetBits ( Primitive, data ) : Primitive,
data Primitive, An 8 element array of 1s and 0s (small bit first).
Résultat Primitive,