using System.Runtime.InteropServices;
using System.Collections;
using System;
using System.Text;
public class HIDapi {
[DllImport("hidapi")]
public static extern int hid_init();
[DllImport("hidapi")]
public static extern int hid_exit();
[DllImport("hidapi")]
public static extern IntPtr hid_error(IntPtr device);
[DllImport("hidapi")]
public static extern IntPtr hid_enumerate(ushort vendor_id, ushort product_id);
[DllImport("hidapi")]
public static extern void hid_free_enumeration(IntPtr devs);
[DllImport("hidapi")]
public static extern int hid_get_feature_report(IntPtr device, byte[] data, UIntPtr length);
[DllImport("hidapi")]
public static extern int hid_get_indexed_string(IntPtr device, int string_index, StringBuilder str, UIntPtr maxlen);
[DllImport("hidapi")]
public static extern int hid_get_manufacturer_string(IntPtr device, StringBuilder str, UIntPtr maxlen);
[DllImport("hidapi")]
public static extern int hid_get_product_string(IntPtr device, StringBuilder str, UIntPtr maxlen);
[DllImport("hidapi")]
public static extern int hid_get_serial_number_string(IntPtr device, StringBuilder str, UIntPtr maxlen);
[DllImport("hidapi")]
public static extern IntPtr hid_open(ushort vendor_id, ushort product_id, string serial_number);
[DllImport("hidapi")]
public static extern void hid_close(IntPtr device);
[DllImport("hidapi")]
public static extern IntPtr hid_open_path(string path);
[DllImport("hidapi")]
public static extern int hid_read(IntPtr device, byte[] data, UIntPtr length);
...