changing the device class while running

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
LIM
Posts: 4
Joined: Wed Sep 25, 2013 6:29 pm

changing the device class while running

Post by LIM » Wed Sep 25, 2013 7:03 pm

is it possible to change the device class from keyboard to joystick while the USB device is plugged in and running?
I want to use both function at one time.
I'm planning to change between both classes by pressing Scroll Lock.
have anyone done this or do know if it's possible? sorry for my bad English writing.. :lol:

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

Re: changing the device class while running

Post by ulao » Wed Sep 25, 2013 8:30 pm

No that is in prog mem I think. You would be better off with a dual device layout and figure out how to switch via vendor ( using software) or a hardware switch.

LIM
Posts: 4
Joined: Wed Sep 25, 2013 6:29 pm

Re: changing the device class while running

Post by LIM » Thu Sep 26, 2013 2:18 pm

ulao wrote:No that is in prog mem I think. You would be better off with a dual device layout and figure out how to switch via vendor ( using software) or a hardware switch.

I decided to make this device by using software and found an information about the composite device.
And I remember your ID from your posts about this. :D
As you can guess, I'm beginner to this function so I need your advice.
Can you please tell me a little bit more about this function?

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

Re: changing the device class while running

Post by ulao » Fri Sep 27, 2013 1:57 pm

I'm not sure what you want to know? There are a few composite examples around that is how I figure it out.

Madara
Posts: 7
Joined: Fri Jun 29, 2012 1:35 pm

Re: changing the device class while running

Post by Madara » Mon Sep 30, 2013 10:01 am

It is possible to change between two device class without plugging the device out.
This can be done by making the device descriptors,configuration descriptors,hid descriptors,strings,serial etc all dynamic and selecting them according to the state of any specific key and change them when the key state is changed.

AVR is soft-reseted and upon starting new device is detected.

Donot Know if this is what you are searchinf for.

LIM
Posts: 4
Joined: Wed Sep 25, 2013 6:29 pm

Re: changing the device class while running

Post by LIM » Wed Oct 02, 2013 7:09 pm

ulao wrote:I'm not sure what you want to know? There are a few composite examples around that is how I figure it out.

The problem is that I can't find them because of my english skill I guess.. can you link one of those example codes for me please?

LIM
Posts: 4
Joined: Wed Sep 25, 2013 6:29 pm

Re: changing the device class while running

Post by LIM » Wed Oct 02, 2013 7:21 pm

Madara wrote:It is possible to change between two device class without plugging the device out.
This can be done by making the device descriptors,configuration descriptors,hid descriptors,strings,serial etc all dynamic and selecting them according to the state of any specific key and change them when the key state is changed.

AVR is soft-reseted and upon starting new device is detected.

Donot Know if this is what you are searchinf for.


yes this is what I'm looking for! thanks. but I can't really find out the way to code it..

Do you mean I have to make the new ones of them? or should I just fix the original arrangements etc..Because I just found that they already exist.

And which part exactly do I need to change or make???

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

Re: changing the device class while running

Post by ulao » Wed Oct 02, 2013 9:29 pm

Look at http://www.raphnet.net/electronique/sne ... dex_en.php ( source at bottom of page )
He made an adapter that changes the reportDescriptor based on a variable. Depending on what the condition is, it leads a new descriptor. This maybe what you are after.

Post Reply