Author Topic: How to programatically force enumeration  (Read 10573 times)

stivo77

  • Member
  • ***
  • Posts: 1
How to programatically force enumeration
« on: February 02, 2021, 05:04:44 pm »
I have an interesting problem with a touch screen device that interoperates with windows by responding to queries for touch HID report descriptors.  The project I am working on requires that the device be put into 'rotation mode' via a USB control message.  The device firmware is handling the command and dynamically does the rotation transform when reporting touches.  But the problem is that windows has already queried for the report descriptor and now the logical x/y limits in the descriptor are wrong.  Is there a windows API that can be called to force windows to request the report descriptor again? The device firmware knows that rotation  is in effect and will answer back with the right descriptor with the rotated x/y limits.  The control code that initiates the rotation is a C# library that uses LibUsbK, so I have a logical place in code to make windows API calls. Just not sure if there is a way to make windows ask for the report descriptor using the C# library.  Any help appreciated.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How to programatically force enumeration
« Reply #1 on: February 02, 2021, 05:14:26 pm »
I believe a new report descriptor would require enumerating as a new device or version in the device descriptor. This would require emulating detach and reattach.

Renate

  • Frequent Contributor
  • ****
  • Posts: 97
Re: How to programatically force enumeration
« Reply #2 on: February 03, 2021, 01:38:16 pm »
Well, you could force enumeration:
By sending something to your device to make it disconnect.
By sending something to the controlling hub to make it disabled/enabled.

But it's better to leave everything connected.

Doesn't Windows scale whatever the touch screen is to what the screen is (at least for a single screen)?
Can't you just report the range as [0, 0] to [65535, 65535]?
Then you can scale/rotate the touches on your side.