Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# and USB HID Devices

Tags:

c#

usb

hid

I'm looking for one of either 2 things

1 - A working example of code using Florian's library from: http://www.florian-leitner.de/index.php/2007/08/03/hid-usb-driver-library/

This seems to be one of the better (only???) C#/HID libraries but the author has gone MIA and I can't seem to get a code example to work. The code I have is:

{
    USBHIDDRIVER.USBInterface usb = new USBInterface(myvid,mypid);
    if (usb.Connect())
        MessageBox.Show(”connection!”);
    else
        MessageBox.Show(”FAIL”);

    usb.enableUsbBufferEvent(new System.EventHandler(myEventCacher));
    usb.startRead();
}

private void myEventCacher(object sender, EventArgs e)
{
    string content = e.ToString();
    MessageBox.Show(content);
}

The connection part works but the event proc is never fired. So I'd like to know if anyone has a working example of this library code with the event handler firing.

2 - If there is a better library for handling C#/HID interaction I'd like to hear about it.

like image 313
Unknown Coder Avatar asked Aug 23 '11 16:08

Unknown Coder


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

Is C language easy?

C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.

What is C in C language?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.


1 Answers

The library you mention is now hosted on google see http://code.google.com/p/csharp-usb-hid-driver/

Perhaps these are helpful too:

  • https://github.com/mikeobrien/HidLibrary
  • http://www.usbhidnetclass.com/ (commercial) (usbhidnetclass.org previously)
  • http://www.codeproject.com/KB/cs/USB_HID.aspx
  • http://janaxelson.com/hidpage.htm
  • http://www.codeproject.com/KB/system/HIDAche.aspx?q=C%23+and+USB+HID+Devices
  • http://www.codeproject.com/Tips/530836/Csharp-USB-HID-Interface
like image 117
Yahia Avatar answered Nov 02 '22 20:11

Yahia