General Category > Discussion - Software

FT90X Get an Interface's HID Report Descriptor

(1/1)

kaspro:
I'm trying to write some code on my FT90X to both get and parse multiple Interface HID Report Descriptors.

I'm doing this to make sure I'm only listening to interfaces that are Keyboard/Keypad and to parse out the data properly using the report descriptor.

Looking through the FT9xx API Programmers Manual and all the example code in the Bridgetek folder, I never see an example of getting the report descriptors. Only setting them (USB Device examples)

The end goal is that I listen to all keyboard-reporting interfaces, parse the data they send back so I can see what keys a user is pressing, and use that data for my main application.

How can I get this information? My USB Host code can currently listen for a HID device, initialize the interfaces, and listen to them. I just don't know where to get those Interface HID Report Descriptors.

FTDI Community:
Hello,

There's a function USBH_device_get_descriptor() in usbh.c which allows you to get a descriptor.
It will get a device, config or report descriptor.

The type of descriptor to get is defined in ft900_usb.h:

/**
    @name USB Descriptor Types
    @brief Table 9-5. Descriptor Types.
    Used for wValue high byte in 9.4.3 Get Descriptor, 9.4.8 Set Descriptor.
 */

You'll have to decode the report descriptor yourself.

In the file ft900_usb_hid.h all the constituent parts of a report descriptor are defined. These can be decoded when looking through the report descriptor. So, it is a case of all the possible values already typed into the header file.

Even better there are loads of online ones to check the results against.

Best Regards,
FTDI Community

Navigation

[0] Message Index

Go to full version