Author Topic: How to get Device Descriptor from Host PC?  (Read 755 times)

yindengxie

  • Member
  • ***
  • Posts: 28
How to get Device Descriptor from Host PC?
« on: August 10, 2020, 05:55:47 am »
Hello Sirs,
 
 I request your help:

  1) How to get Device Descriptor, Configuration Descriptor, Interface Descriptor from Host PC?

  2) Can we use  ReadFile(ReadHandle,InputReport,Capabilities.InputReportByteLength,&NumberOfBytesRead,(LPOVERLAPPED) &HIDOverlapped); to get Device Descriptor, Configuration Descriptor, Interface Descriptor from Host PC?
 
   THANKS for your help and supports!
 

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2959
    • Lakeview Research

yindengxie

  • Member
  • ***
  • Posts: 28
Re: How to get Device Descriptor from Host PC?
« Reply #2 on: August 10, 2020, 03:42:44 pm »
Hello Jan,

 Thanks for your help!

 I have the following questions to request your help.

 1) What is the difference between Input Report and Input Feature Report?

 2) I am working on Joystick . Can the all data of Joystick be read by
     ReadFile(ReadHandle,InputReport,Capabilities.InputReportByteLength,&NumberOfBytesRead,(LPOVERLAPPED) &HIDOverlapped); ?   

     THANKS for your support!


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2959
    • Lakeview Research
Re: How to get Device Descriptor from Host PC?
« Reply #3 on: August 10, 2020, 05:53:23 pm »
Input reports can use interrupt or control transfers. Feature reports only use control transfers.

A joystick filter driver on the host might capture the Input report data and prevent reading it using Readfile. I'm not sure offhand.

yindengxie

  • Member
  • ***
  • Posts: 28
Re: How to get Device Descriptor from Host PC?
« Reply #4 on: August 11, 2020, 12:01:54 am »
Hello Jan,

 Thanks for your help!

 1) How to get the Joystick Data on Host PC  for calibrating the system?

 2) May we use DirectX Input to read Joystick data?

  THANKS for your support.

yindengxie

  • Member
  • ***
  • Posts: 28
Re: How to get Device Descriptor from Host PC?
« Reply #5 on: August 11, 2020, 12:55:31 am »
Hello Jan,

 Thanks for your help!

 1) How to get the USB Joystick Data from Host PC ?

 2) May we use DirectX Input to get  the USB Joystick data?

  THANKS for your support.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2959
    • Lakeview Research

yindengxie

  • Member
  • ***
  • Posts: 28
Re: How to get Device Descriptor from Host PC?
« Reply #7 on: August 12, 2020, 09:13:30 am »
Hello Jan,

  Thank you very much for your link info.

  OK! XInput and DirectInput can be used to get  data from Joystick.
 
  Is it possible to use Windows USB Host API to get the data from Joystick?

     THANKS for your supports!

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2959
    • Lakeview Research
Re: How to get Device Descriptor from Host PC?
« Reply #8 on: August 17, 2020, 06:18:05 pm »
A joystick filter driver on the host might capture the Input report data and prevent reading it using Readfile. I'm not sure offhand.
 

ulao

  • Frequent Contributor
  • ****
  • Posts: 161
Re: How to get Device Descriptor from Host PC?
« Reply #9 on: August 17, 2020, 08:57:16 pm »
You can get data in way you want.

If you set up a joystick as a HID or Xinput, its available in DX or SDL. You can also get the raw data from the USB report itself.  You can even set up a control transfer to read and write to a device and get it that way. All all depends on that Implementation you use PC side. DX for HIS, newer DX for xinput, HIDAPI for control  transfers, and WINUSB for raw read. We'd need more info about how you are attempting to read the device.

yindengxie

  • Member
  • ***
  • Posts: 28
Re: How to get Device Descriptor from Host PC?
« Reply #10 on: August 18, 2020, 06:50:41 am »
Many THANKS ulao for your help and Info!
Best Regards!