C# Класс LDHID, LitDev

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

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

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

Приватные методы

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

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

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

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.
Результат Primitive,

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

List all found HID (Human Interface Devices).
public static FindDevices ( ) : Primitive,
Результат Primitive,

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

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).
Результат Primitive,

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

Get the input record length for a HID device.
public static InputLength ( Primitive, name ) : Primitive,
name Primitive, The device name.
Результат Primitive,

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

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.
Результат Primitive,

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

Get the output record length for a HID device.
public static OutputLength ( Primitive, name ) : Primitive,
name Primitive, The HID device name.
Результат Primitive,

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

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).
Результат Primitive,