locked
Reading from a HID Device RRS feed

  • Question

  • How can I read data from a HID device (USB RFID Reader)and  which acts like a keyboard.
    Friday, March 19, 2010 4:34 PM

Answers

  • you can look at the codeplex for the HID library

    http://hidlibrary.codeplex.com/

    • Marked as answer by SamAgain Monday, March 29, 2010 3:50 AM
    Friday, March 19, 2010 4:52 PM
  •  

    When I was in need to deal with USB HID device, which was basically a usb gamepad, I used this one and it worked absolutely fine for me.

    http://www.codeproject.com/KB/cs/USB_HID.aspx

     

    I dont know if its fixed now but when I tried it, it gave me error while compiling, so I used already compiled dll from release folder and there were no problems at all.

    However I do not have experience in sending data to HID device as I only needed to read from it.

     


    Thanks

    #define sizeof(x) rand()
    • Marked as answer by SamAgain Monday, March 29, 2010 3:50 AM
    Friday, March 19, 2010 6:16 PM
  • If it acts as a keyboard just put the focus on a text box and scan away! If you want more fancy stuff like reading when a textbox doesn't have the focus you'll have to ask the manufactorer what your options are, there is not generic works for all solution there.
    • Marked as answer by SamAgain Monday, March 29, 2010 3:50 AM
    Friday, March 19, 2010 4:46 PM

All replies

  • If it acts as a keyboard just put the focus on a text box and scan away! If you want more fancy stuff like reading when a textbox doesn't have the focus you'll have to ask the manufactorer what your options are, there is not generic works for all solution there.
    • Marked as answer by SamAgain Monday, March 29, 2010 3:50 AM
    Friday, March 19, 2010 4:46 PM
  • you can look at the codeplex for the HID library

    http://hidlibrary.codeplex.com/

    • Marked as answer by SamAgain Monday, March 29, 2010 3:50 AM
    Friday, March 19, 2010 4:52 PM
  •  

    When I was in need to deal with USB HID device, which was basically a usb gamepad, I used this one and it worked absolutely fine for me.

    http://www.codeproject.com/KB/cs/USB_HID.aspx

     

    I dont know if its fixed now but when I tried it, it gave me error while compiling, so I used already compiled dll from release folder and there were no problems at all.

    However I do not have experience in sending data to HID device as I only needed to read from it.

     


    Thanks

    #define sizeof(x) rand()
    • Marked as answer by SamAgain Monday, March 29, 2010 3:50 AM
    Friday, March 19, 2010 6:16 PM
  • I tried to set focus to the TextBox/NotePad and then treid to to scan  nothing happens.

    I seams like I have to capture the keyboard input as Windows 2000 and Windows XP obtain exclusive access to Input and Output reports for this kind (keyboard/mouse) devices.

    Tuesday, March 23, 2010 11:58 AM
  • I tried to set focus to the TextBox/NotePad and then treid to to scan  nothing happens.


    Seems like its not behaving like a keyboard then, i suggest you contact the support department of the manufactorer and ask for programming information once you have that you could use some of the code available here to talk to the device.  
    Tuesday, March 23, 2010 1:32 PM
  • Thanks every one who replied

    Good news; After changing the reader configuration (A Demo Program came with reader). I am able to read data from the reader

     (1) by setting focus to textbox/notpad

    and also using

    (2) capture the raw input from the device (following link help me a lot)

    http://www.codeproject.com/KB/system/rawinput.aspx

    but the problem I want to send some protocol bytes to reader to change the configuration (whic i done through the Demo application.)

    I also tried to use HID Interface to communicate with device ;

    Also tried to used the the following links:

    http://www.lvr.com/hidpage.htm

    http://www.florian-leitner.de/index.php/2007/08/03/hid-usb-driver-library/

    But I came to to know that as it acts like keyboard; so  Windows 2000 and Windows XP obtain exclusive access to Input and Output reports for this kind (keyboard/mouse) devices. due to which i gets the error ("{"Msg:Failed to create device file WinEr:00000005"}")

    Is their any way i can send some bytes to the this kind (keyboard) of HID Device.

    Tuesday, March 23, 2010 4:25 PM