FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FT90X Get an Interface's HID Report Descriptor  (Read 6751 times)

kaspro

  • Newbie
  • *
  • Posts: 5
    • View Profile
FT90X Get an Interface's HID Report Descriptor
« on: January 06, 2021, 04:04:15 AM »

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.
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: FT90X Get an Interface's HID Report Descriptor
« Reply #1 on: January 07, 2021, 05:10:33 PM »

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
Logged