none
How to fetch data from a usb-hid device using hid.dll

    Question

  • Hi

    I am new to this area of work.

    Our customer has developed a USB HID device. This device store different kinds of data. Customer has specified formats of all these datas as well. eg. One of the data format is

    {

    id

    date

    Type

    ... }

    They have also specified length of each field)

    From whatever I have read on internet, is that hid.dll talks in terms of input and output reports. so my question is how the above data will be part of an input report. If someone can suggest the methods of hid.dll that I need to call to fetch the data from the device that would be helpful

    1. How input report contains data

    2. Sequence of method calls that I need to call for fetching some data from the device.

    We are using C# as the language for development.

    Regards

    JC


    • Edited by jc0616 Tuesday, July 10, 2012 11:29 AM
    Tuesday, July 10, 2012 10:38 AM

Answers

  • You'll find all the HID information here http://msdn.microsoft.com/en-us/library/dd446410.aspx  

    Furthermore the following link provides useful information and samples http://www.lvr.com/hidpage.htm/


    Phil Ineichen - This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, July 10, 2012 1:24 PM
  • A report descriptor defines the format and use of the data in the HID’s reports. If the device is a mouse, the data reports mouse movements and
    button clicks. If the device is a relay controller, the data specifies which relays to open and close.

    The HID specification defines six class-specific requests. Two requests, Set_Report and Get_Report, provide a way for the host and device to transfer reports to and from the device using control transfers. The host uses Set_Report to send reports and Get_Report to receive reports. The other four requests relate to configuring the device. The Set_Idle and Get_Idle requests set and read the Idle rate, which determines whether or not a device resends data that hasn’t changed since the last poll. The Set_Protocol and Get_Protocol requests set and read a protocol value, which can enable a device to function with a simplified protocol when the full HID drivers aren’t loaded on the host, such as during boot up.

    You'll find more detailed information in Jan Axelson's "USB Complete Third Edition" book. It might also worth to check the samples on http://www.lvr.com/hidpage.htm/


    Phil Ineichen - This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, July 11, 2012 11:16 AM

All replies

  • You'll find all the HID information here http://msdn.microsoft.com/en-us/library/dd446410.aspx  

    Furthermore the following link provides useful information and samples http://www.lvr.com/hidpage.htm/


    Phil Ineichen - This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, July 10, 2012 1:24 PM
  • Hi

    Thanks for the input.

    but can someone provide me with concrete details about

    1. How input report contains data - May be if you can explain structure of input report for how it contains custom data.

    2. Sequence of method calls that I need to call for fetching some data from the device.  - I am assuming I will have to call some method which will act as a request and device will reply to this request with the data.

    Regards

    JC

    Wednesday, July 11, 2012 10:07 AM
  • A report descriptor defines the format and use of the data in the HID’s reports. If the device is a mouse, the data reports mouse movements and
    button clicks. If the device is a relay controller, the data specifies which relays to open and close.

    The HID specification defines six class-specific requests. Two requests, Set_Report and Get_Report, provide a way for the host and device to transfer reports to and from the device using control transfers. The host uses Set_Report to send reports and Get_Report to receive reports. The other four requests relate to configuring the device. The Set_Idle and Get_Idle requests set and read the Idle rate, which determines whether or not a device resends data that hasn’t changed since the last poll. The Set_Protocol and Get_Protocol requests set and read a protocol value, which can enable a device to function with a simplified protocol when the full HID drivers aren’t loaded on the host, such as during boot up.

    You'll find more detailed information in Jan Axelson's "USB Complete Third Edition" book. It might also worth to check the samples on http://www.lvr.com/hidpage.htm/


    Phil Ineichen - This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, July 11, 2012 11:16 AM
  • you have to ask the vendor which created teh device in what collection they put teh data and under what usage. hid is pretty generic, hid undersstands the usage page and usage values, it is up to the reader to understand the data that is in that report


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Saturday, July 14, 2012 12:23 AM
    Owner