switch descriptor on the fly

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

switch descriptor on the fly

Post by ulao » Wed Nov 04, 2009 10:27 pm

I was wondering if its possible to set up a new descriptor without unplugging the usb. In this cause I'm referring to a general HID game controller. I want to change the descriptor during game play. And most games get upset if the usb cable is disconnected. I'm guessing the normal usbDisconnect would do the same thing though unsure. So I was hopping to find a way to change from a 2 axis 8 button to a 4 axis 16 buttons for example. Of course the trick here being to do it while its still connected.

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Re: switch descriptor on the fly

Post by Grendel » Thu Nov 05, 2009 1:01 am

The descriptors are only read during enumeration. The only way to get the host to enumerate is via a connect event. That can be done by un- and then re-plugging the USB cable or by dis- and re-connecting the USB ID resistor (UsbConnect() & UsbDisconnect()).

Even if you could change the layout of the device during game play the game probably wouldn't recognize it. It would have to be written w/ changing controllers during game play in mind, AFAIK no game is. They all assume you have your hardware set up as you want it when the game starts.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: switch descriptor on the fly

Post by ulao » Thu Nov 05, 2009 4:49 pm

thx Grendel, wanted to be sure.

Post Reply