Page 1 of 1
changing the device class while running
Posted: Wed Sep 25, 2013 7:03 pm
by LIM
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..
Re: changing the device class while running
Posted: Wed Sep 25, 2013 8:30 pm
by ulao
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.
Re: changing the device class while running
Posted: Thu Sep 26, 2013 2:18 pm
by LIM
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.
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?
Re: changing the device class while running
Posted: Fri Sep 27, 2013 1:57 pm
by ulao
I'm not sure what you want to know? There are a few composite examples around that is how I figure it out.
Re: changing the device class while running
Posted: Mon Sep 30, 2013 10:01 am
by Madara
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.
Re: changing the device class while running
Posted: Wed Oct 02, 2013 7:09 pm
by LIM
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?
Re: changing the device class while running
Posted: Wed Oct 02, 2013 7:21 pm
by LIM
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???
Re: changing the device class while running
Posted: Wed Oct 02, 2013 9:29 pm
by ulao
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.