What really annoys me in modeswitch is the fact that I either have to edit config file everytime I change the device or I have to have multiple config files (one per device and select it with -c option).
I was thinking about possibility of having multiple configurations in one file labeled somehow so I can specify using some command line option which to use. For example either windows ini file format could be used or xml for config file. As xml parsers are quite heavyweight the first option seems better.
Let me provide a basic example:
assuming the following config file:
Code: Select all
[config1]
DefaultVendor= 0x05c6
DefaultProduct= 0x1000
TargetVendor= 0x0af0
TargetProduct= 0x6600
MessageEndpoint=0x05
MessageContent="55534243123456780000000000000601000000000000000000000000000000"
[config2]
DefaultVendor= 0x05c6
DefaultProduct= 0x1000
TargetVendor= 0x0af0
TargetProduct= 0x6901
MessageEndpoint=0x05
MessageContent="55534243123456780000000000000601000000000000000000000000000000"
Code: Select all
# usb_modeswitch -L config1
To make it backward compatible program would use first found configuration if no -L flag is provided.
What do you think?
Thanks
Morg