Author Topic: Understanding Get Feature Report - Windows Touchscreen  (Read 5262 times)

dh29

  • Member
  • ***
  • Posts: 2
Understanding Get Feature Report - Windows Touchscreen
« on: December 21, 2016, 05:16:38 am »
I have implemented a USB touchscreen device within an embedded micro-controller that is interfacing to a Windows platform (Win7, Win8 or Win10).

It is now working correctly, but initially I had some problems and using a USB h/w debugger I 'sniffed' an off-the-shelf touchscreen to 'learn' its approach.

I do not understand one of the steps of the USB process, Get Feature Report, and was hoping somebody could offer an explanation.

Summary of USB enumeration process:
  • Device reset
  • Get Device Descriptor
  • Set Address
  • Get Device Descriptor
  • Get Configuration Descriptor
  • Get String Descriptor
  • Get String Descriptor
  • Get Device Descriptor
  • Get Configuration Descriptor
  • Get Configuration Descriptor
  • Set Configuration
  • Set Idle
  • Get Report Descriptor
  • Get Feature Report[4]
Reading Jan's book (4th Ed, which is my USB bible), I understand that a 'Get Feature Report' is used to ask the device for some configuration information. The detailed Get Feature Report transaction is provided here:
  • SETUP txn: A1 01 04 03 00 02 00
  • IN txn: 04 02
From the 'SETUP txn' I can see that the USB host sends a Get Report (bRequest 0x01) for Feature (wValue high byte 0x03) Report Id 4  (wValue low byte 0x04).
The device (touchscreen) always replies with data 0x04 0x02.

My question:
  • What is the meaning of the 0x04 0x02 data returned by the touchscreen's Get Feature Report[4]?
Get/Set Feature Reports are for configuration data, so it could be proprietary data as defined by the original device manufacturer. But in the case of this touchscreen, Windows natively supports the touchscreen - it does not need a specific manufacturer supplied driver. So where is the meaning of this data defined? Is there a Microsoft document that defines what this means?

dh29

  • Member
  • ***
  • Posts: 2
Re: Understanding Get Feature Report - Windows Touchscreen
« Reply #1 on: December 21, 2016, 10:06:42 am »
I think I understand it now!

As part of the Report Descriptor, Report Id (4) defines a Maximum Contact Count usage that is defined as a Feature:
0x05, 0x0D,        //     Usage Page (Digitizer)
0x09, 0x55,        //     Usage (Contact count maximum)
0x25, 0x08,        //     Logical Maximum (8)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0xB1, 0x02,        //     Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
As can be seen the Contact Count may be up to 8. So as Windows receives the Report Descriptor it sees that Report Id (4) has a variable field, and hence Windows asks the device 'how many simultaneous contacts do you support?' As the touchscreen supports 2 simultaneous touches, it replies with 0x04 (Report ID) and 0x02 (two touches).

I would be grateful if somebody could confirm my explanation.

[Some useful links that helped me find this information:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff553734(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/hardware/jj151563(v=vs.85).aspx
http://janaxelson.com/forum/index.php?PHPSESSID=hmgmghq7mugbllnoejnpt5ugp0&topic=1284.0
http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
http://www.usb.org/developers/hidpage/HUTRR34.zip
]

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Understanding Get Feature Report - Windows Touchscreen
« Reply #2 on: December 21, 2016, 10:13:16 am »
Makes sense to me. Thank you for reporting what you found.